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.23\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2010-10-22 23:11+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-edit.pl:31 ../tools/virt-win-reg.pl:34 ../tools/virt-df.pl:32 ../tools/virt-ls.pl:31 ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28 ../tools/virt-cat.pl:30 ../tools/virt-tar.pl:30 ../tools/virt-rescue.pl:29 ../tools/virt-make-fs.pl:33 ../tools/virt-list-partitions.pl:28
25 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pl:38 ../tools/virt-edit.pl:33 ../tools/virt-win-reg.pl:36 ../tools/virt-df.pl:34 ../tools/virt-ls.pl:33 ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30 ../tools/virt-cat.pl:32 ../tools/virt-tar.pl:32 ../tools/virt-rescue.pl:31 ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
30 #: ../src/guestfs.pod:5
31 msgid "guestfs - Library for accessing and modifying virtual machine images"
35 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pl:42 ../tools/virt-edit.pl:37 ../tools/virt-win-reg.pl:40 ../tools/virt-df.pl:38 ../tools/virt-ls.pl:37 ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34 ../tools/virt-cat.pl:36 ../tools/virt-tar.pl:36 ../tools/virt-rescue.pl:35 ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
40 #: ../src/guestfs.pod:9
43 " #include <guestfs.h>\n"
48 #: ../src/guestfs.pod:11
51 " guestfs_h *g = guestfs_create ();\n"
52 " guestfs_add_drive (g, \"guest.img\");\n"
53 " guestfs_launch (g);\n"
54 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
55 " guestfs_touch (g, \"/hello\");\n"
56 " guestfs_umount (g, \"/\");\n"
57 " guestfs_sync (g);\n"
58 " guestfs_close (g);\n"
63 #: ../src/guestfs.pod:20
66 " cc prog.c -o prog -lguestfs\n"
68 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
73 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:30 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:16 ../inspector/virt-inspector.pl:48 ../tools/virt-edit.pl:51 ../tools/virt-win-reg.pl:64 ../tools/virt-df.pl:46 ../tools/virt-ls.pl:43 ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40 ../tools/virt-cat.pl:42 ../tools/virt-tar.pl:73 ../tools/virt-rescue.pl:51 ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
78 #: ../src/guestfs.pod:26
80 "Libguestfs is a library for accessing and modifying guest disk images. "
81 "Amongst the things this is good for: making batch configuration changes to "
82 "guests, getting disk used/free statistics (see also: virt-df), migrating "
83 "between virtualization systems (see also: virt-p2v), performing partial "
84 "backups, performing partial guest clones, cloning guests and changing "
85 "registry/UUID/hostname info, and much else besides."
89 #: ../src/guestfs.pod:34
91 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
92 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
93 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
98 #: ../src/guestfs.pod:39
100 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
101 "what filesystem is in each LV, etc.). It can also run commands in the "
102 "context of the guest. Also you can access filesystems over FUSE."
106 #: ../src/guestfs.pod:44
108 "Libguestfs is a library that can be linked with C and C++ management "
109 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
110 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
115 #: ../src/guestfs.pod:49
117 "You don't need to be root to use libguestfs, although obviously you do need "
118 "enough permissions to access the disk images."
122 #: ../src/guestfs.pod:52
124 "Libguestfs is a large API because it can do many things. For a gentle "
125 "introduction, please read the L</API OVERVIEW> section next."
129 #: ../src/guestfs.pod:55
134 #: ../src/guestfs.pod:57
136 "This section provides a gentler overview of the libguestfs API. We also try "
137 "to group API calls together, where that may not be obvious from reading "
138 "about the individual calls in the main section of this manual."
142 #: ../src/guestfs.pod:62
147 #: ../src/guestfs.pod:64
149 "Before you can use libguestfs calls, you have to create a handle. Then you "
150 "must add at least one disk image to the handle, followed by launching the "
151 "handle, then performing whatever operations you want, and finally closing "
152 "the handle. By convention we use the single letter C<g> for the name of the "
153 "handle variable, although of course you can use any name you want."
157 #: ../src/guestfs.pod:71
158 msgid "The general structure of all libguestfs-using programs looks like this:"
162 #: ../src/guestfs.pod:74
165 " guestfs_h *g = guestfs_create ();\n"
170 #: ../src/guestfs.pod:76
173 " /* Call guestfs_add_drive additional times if there are\n"
174 " * multiple disk images.\n"
176 " guestfs_add_drive (g, \"guest.img\");\n"
181 #: ../src/guestfs.pod:81
184 " /* Most manipulation calls won't work until you've launched\n"
185 " * the handle 'g'. You have to do this _after_ adding drives\n"
186 " * and _before_ other commands.\n"
188 " guestfs_launch (g);\n"
193 #: ../src/guestfs.pod:87
196 " /* Now you can examine what partitions, LVs etc are available.\n"
198 " char **partitions = guestfs_list_partitions (g);\n"
199 " char **logvols = guestfs_lvs (g);\n"
204 #: ../src/guestfs.pod:92
207 " /* To access a filesystem in the image, you must mount it.\n"
209 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
214 #: ../src/guestfs.pod:96
217 " /* Now you can perform filesystem actions on the guest\n"
220 " guestfs_touch (g, \"/hello\");\n"
225 #: ../src/guestfs.pod:101
228 " /* You only need to call guestfs_sync if you have made\n"
229 " * changes to the guest image. (But if you've made changes\n"
230 " * then you *must* sync). See also: guestfs_umount and\n"
231 " * guestfs_umount_all calls.\n"
233 " guestfs_sync (g);\n"
238 #: ../src/guestfs.pod:108
241 " /* Close the handle 'g'. */\n"
242 " guestfs_close (g);\n"
247 #: ../src/guestfs.pod:111
249 "The code above doesn't include any error checking. In real code you should "
250 "check return values carefully for errors. In general all functions that "
251 "return integers return C<-1> on error, and all functions that return "
252 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
253 "how to handle errors, and consult the documentation for each function call "
254 "below to see precisely how they return error indications."
258 #: ../src/guestfs.pod:119
263 #: ../src/guestfs.pod:121
265 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
266 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
267 "actual block device, or simply an empty file of zeroes that you have created "
268 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
273 #: ../src/guestfs.pod:127
275 "The call you should use in modern code for adding drives is "
276 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
277 "specifying that the format is raw, do:"
281 #: ../src/guestfs.pod:131
284 " guestfs_add_drive_opts (g, filename,\n"
285 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
291 #: ../src/guestfs.pod:135
292 msgid "You can add a disk read-only using:"
296 #: ../src/guestfs.pod:137
299 " guestfs_add_drive_opts (g, filename,\n"
300 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
301 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
307 #: ../src/guestfs.pod:142
309 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
310 "libguestfs won't modify the file."
314 #: ../src/guestfs.pod:145
316 "Be extremely cautious if the disk image is in use, eg. if it is being used "
317 "by a virtual machine. Adding it read-write will almost certainly cause disk "
318 "corruption, but adding it read-only is safe."
322 #: ../src/guestfs.pod:149
324 "You must add at least one disk image, and you may add multiple disk images. "
325 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
326 "first one you added), C</dev/sdb> (for the second one you added), etc."
330 #: ../src/guestfs.pod:154
332 "Once L</guestfs_launch> has been called you cannot add any more images. You "
333 "can call L</guestfs_list_devices> to get a list of the device names, in the "
334 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
338 #: ../src/guestfs.pod:159
343 #: ../src/guestfs.pod:161
345 "Before you can read or write files, create directories and so on in a disk "
346 "image that contains filesystems, you have to mount those filesystems using "
347 "L</guestfs_mount>. If you already know that a disk image contains (for "
348 "example) one partition with a filesystem on that partition, then you can "
353 #: ../src/guestfs.pod:167
356 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
361 #: ../src/guestfs.pod:169
363 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
364 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
365 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
369 #: ../src/guestfs.pod:173
371 "If you are given a disk image and you don't know what it contains then you "
372 "have to find out. Libguestfs can do that too: use "
373 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
374 "and LVs, and either try mounting each to see what is mountable, or else "
375 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also "
376 "has a set of APIs for inspection of disk images (see L</INSPECTION> below). "
377 "But you might find it easier to look at higher level programs built on top "
378 "of libguestfs, in particular L<virt-inspector(1)>."
382 #: ../src/guestfs.pod:183
384 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
385 "several other variations of the C<guestfs_mount_*> call."
389 #: ../src/guestfs.pod:186
390 msgid "FILESYSTEM ACCESS AND MODIFICATION"
394 #: ../src/guestfs.pod:188
396 "The majority of the libguestfs API consists of fairly low-level calls for "
397 "accessing and modifying the files, directories, symlinks etc on mounted "
398 "filesystems. There are over a hundred such calls which you can find listed "
399 "in detail below in this man page, and we don't even pretend to cover them "
400 "all in this overview."
404 #: ../src/guestfs.pod:194
406 "Specify filenames as full paths, starting with C<\"/\"> and including the "
411 #: ../src/guestfs.pod:197
413 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
414 "the file called C<\"etc/passwd\"> then you could do:"
418 #: ../src/guestfs.pod:200
421 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
426 #: ../src/guestfs.pod:202
428 "This would return C<data> as a newly allocated buffer containing the full "
429 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
430 "or C<NULL> if there was an error."
434 #: ../src/guestfs.pod:206
436 "As another example, to create a top-level directory on that filesystem "
437 "called C<\"var\"> you would do:"
441 #: ../src/guestfs.pod:209
444 " guestfs_mkdir (g, \"/var\");\n"
449 #: ../src/guestfs.pod:211
450 msgid "To create a symlink you could do:"
454 #: ../src/guestfs.pod:213
457 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
458 " \"/etc/rc3.d/S30portmap\");\n"
463 #: ../src/guestfs.pod:216
465 "Libguestfs will reject attempts to use relative paths and there is no "
466 "concept of a current working directory."
470 #: ../src/guestfs.pod:219
472 "Libguestfs can return errors in many situations: for example if the "
473 "filesystem isn't writable, or if a file or directory that you requested "
474 "doesn't exist. If you are using the C API (documented here) you have to "
475 "check for those error conditions after each call. (Other language bindings "
476 "turn these errors into exceptions)."
480 #: ../src/guestfs.pod:225
482 "File writes are affected by the per-handle umask, set by calling "
483 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
487 #: ../src/guestfs.pod:228
492 #: ../src/guestfs.pod:230
494 "Libguestfs contains API calls to read, create and modify partition tables on "
499 #: ../src/guestfs.pod:233
501 "In the common case where you want to create a single partition covering the "
502 "whole disk, you should use the L</guestfs_part_disk> call:"
506 #: ../src/guestfs.pod:237
509 " const char *parttype = \"mbr\";\n"
510 " if (disk_is_larger_than_2TB)\n"
511 " parttype = \"gpt\";\n"
512 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
517 #: ../src/guestfs.pod:242
519 "Obviously this effectively wipes anything that was on that disk image "
524 #: ../src/guestfs.pod:245
529 #: ../src/guestfs.pod:247
531 "Libguestfs provides access to a large part of the LVM2 API, such as "
532 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
533 "unless you familiarize yourself with the concepts of physical volumes, "
534 "volume groups and logical volumes."
538 #: ../src/guestfs.pod:252
540 "This author strongly recommends reading the LVM HOWTO, online at "
541 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
545 #: ../src/guestfs.pod:255
550 #: ../src/guestfs.pod:257
552 "Use L</guestfs_cat> to download small, text only files. This call is "
553 "limited to files which are less than 2 MB and which cannot contain any ASCII "
554 "NUL (C<\\0>) characters. However it has a very simple to use API."
558 #: ../src/guestfs.pod:262
560 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
561 "bit data, since it returns a (pointer, size) pair. However it is still "
562 "limited to \"small\" files, less than 2 MB."
566 #: ../src/guestfs.pod:266
568 "L</guestfs_download> can be used to download any file, with no limits on "
569 "content or size (even files larger than 4 GB)."
573 #: ../src/guestfs.pod:269
574 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
578 #: ../src/guestfs.pod:272
583 #: ../src/guestfs.pod:274
585 "It's often the case that you want to write a file or files to the disk "
590 #: ../src/guestfs.pod:277
592 "To write a small file with fixed content, use L</guestfs_write>. To create "
593 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
594 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
595 "variety of other functions for creating test files, for example "
596 "L</guestfs_fill> and L</guestfs_fill_pattern>."
600 #: ../src/guestfs.pod:283
602 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
603 "file content or size (even files larger than 4 GB)."
607 #: ../src/guestfs.pod:286
608 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
612 #: ../src/guestfs.pod:288
614 "However the fastest way to upload I<large numbers of arbitrary files> is to "
615 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
616 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
617 "the drive in a predictable way (eg. adding it last after all other drives) "
618 "then you can get the device name from L</guestfs_list_devices> and mount it "
619 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
620 "sometimes non-portable between kernel versions, and they don't support "
621 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
622 "using a label or UUID, use an ISO image instead."
626 #: ../src/guestfs.pod:299
631 #: ../src/guestfs.pod:301
633 "There are various different commands for copying between files and devices "
634 "and in and out of the guest filesystem. These are summarised in the table "
639 #: ../src/guestfs.pod:307
640 msgid "B<file> to B<file>"
644 #: ../src/guestfs.pod:309
646 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
647 "directories recursively."
651 #: ../src/guestfs.pod:312
652 msgid "B<file or device> to B<file or device>"
656 #: ../src/guestfs.pod:314
658 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
659 "devices in the guest."
663 #: ../src/guestfs.pod:317
664 msgid "Example: duplicate the contents of an LV:"
668 #: ../src/guestfs.pod:319
671 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
676 #: ../src/guestfs.pod:321
678 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
679 "(C</dev/VG/Original>). To copy less than the whole source device, use "
680 "L</guestfs_copy_size>."
684 #: ../src/guestfs.pod:325
685 msgid "B<file on the host> to B<file or device>"
689 #: ../src/guestfs.pod:327
690 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
694 #: ../src/guestfs.pod:329
695 msgid "B<file or device> to B<file on the host>"
699 #: ../src/guestfs.pod:331
700 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
704 #: ../src/guestfs.pod:335
705 msgid "LISTING FILES"
709 #: ../src/guestfs.pod:337
711 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
712 "L<guestfish(1)>-equivalent command C<ll>)."
716 #: ../src/guestfs.pod:340
718 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
719 "programs, as a flat list of strings."
723 #: ../src/guestfs.pod:343
725 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
726 "directory, plus additional information about each one. It is more "
727 "equivalent to using the L<readdir(3)> call on a local filesystem."
731 #: ../src/guestfs.pod:347
733 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
738 #: ../src/guestfs.pod:350
739 msgid "RUNNING COMMANDS"
743 #: ../src/guestfs.pod:352
745 "Although libguestfs is primarily an API for manipulating files inside guest "
746 "images, we also provide some limited facilities for running commands inside "
751 #: ../src/guestfs.pod:356
752 msgid "There are many limitations to this:"
756 #: ../src/guestfs.pod:360 ../src/guestfs.pod:365 ../src/guestfs.pod:370 ../src/guestfs.pod:374 ../src/guestfs.pod:379 ../src/guestfs.pod:383 ../src/guestfs.pod:388 ../src/guestfs.pod:1140 ../src/guestfs.pod:1145 ../src/guestfs.pod:1149 ../src/guestfs.pod:1365 ../src/guestfs.pod:1370 ../src/guestfs.pod:1374 ../src/guestfs.pod:1476 ../src/guestfs.pod:1480 ../src/guestfs.pod:1484 ../src/guestfs.pod:1489 ../src/guestfs.pod:1497 ../src/guestfs.pod:1516 ../src/guestfs.pod:1524 ../src/guestfs.pod:1754 ../src/guestfs.pod:1760 ../src/guestfs.pod:1765 ../src/guestfs.pod:1771 ../src/guestfs.pod:1878 ../src/guestfs.pod:1882 ../src/guestfs.pod:1886 ../src/guestfs.pod:1890 ../src/guestfs-actions.pod:14 ../src/guestfs-actions.pod:21 ../src/guestfs-actions.pod:438 ../src/guestfs-actions.pod:446 ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:460 ../src/guestfs-actions.pod:1351 ../src/guestfs-actions.pod:1355 ../src/guestfs-actions.pod:1359 ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1375 ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1389 ../src/guestfs-actions.pod:1393 ../src/guestfs-actions.pod:1397 ../src/guestfs-actions.pod:1520 ../src/guestfs-actions.pod:1524 ../src/guestfs-actions.pod:1529 ../src/guestfs-actions.pod:1534 ../src/guestfs-actions.pod:1586 ../src/guestfs-actions.pod:1590 ../src/guestfs-actions.pod:1595 ../fish/guestfish.pod:364 ../fish/guestfish.pod:368 ../fish/guestfish.pod:372 ../fish/guestfish.pod:376 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:339 ../fish/guestfish-actions.pod:347 ../fish/guestfish-actions.pod:354 ../fish/guestfish-actions.pod:361 ../fish/guestfish-actions.pod:1056 ../fish/guestfish-actions.pod:1060 ../fish/guestfish-actions.pod:1064 ../fish/guestfish-actions.pod:1068 ../fish/guestfish-actions.pod:1076 ../fish/guestfish-actions.pod:1080 ../fish/guestfish-actions.pod:1084 ../fish/guestfish-actions.pod:1094 ../fish/guestfish-actions.pod:1098 ../fish/guestfish-actions.pod:1102 ../fish/guestfish-actions.pod:1192 ../fish/guestfish-actions.pod:1196 ../fish/guestfish-actions.pod:1201 ../fish/guestfish-actions.pod:1206 ../fish/guestfish-actions.pod:1248 ../fish/guestfish-actions.pod:1252 ../fish/guestfish-actions.pod:1257 ../tools/virt-df.pl:161 ../tools/virt-df.pl:167 ../tools/virt-resize.pl:348 ../tools/virt-resize.pl:353 ../tools/virt-resize.pl:363
761 #: ../src/guestfs.pod:362
763 "The kernel version that the command runs under will be different from what "
768 #: ../src/guestfs.pod:367
770 "If the command needs to communicate with daemons, then most likely they "
775 #: ../src/guestfs.pod:372
776 msgid "The command will be running in limited memory."
780 #: ../src/guestfs.pod:376
782 "The network may not be available unless you enable it (see "
783 "L</guestfs_set_network>)."
787 #: ../src/guestfs.pod:381
788 msgid "Only supports Linux guests (not Windows, BSD, etc)."
792 #: ../src/guestfs.pod:385
793 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
797 #: ../src/guestfs.pod:390
799 "For SELinux guests, you may need to enable SELinux and load policy first. "
800 "See L</SELINUX> in this manpage."
804 #: ../src/guestfs.pod:395
806 "The two main API calls to run commands are L</guestfs_command> and "
807 "L</guestfs_sh> (there are also variations)."
811 #: ../src/guestfs.pod:398
813 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
814 "shell globs, redirections, etc will work."
818 #: ../src/guestfs.pod:401
819 msgid "CONFIGURATION FILES"
823 #: ../src/guestfs.pod:403
825 "To read and write configuration files in Linux guest filesystems, we "
826 "strongly recommend using Augeas. For example, Augeas understands how to "
827 "read and write, say, a Linux shadow password file or X.org configuration "
828 "file, and so avoids you having to write that code."
832 #: ../src/guestfs.pod:408
834 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
835 "document Augeas itself here because there is excellent documentation on the "
836 "L<http://augeas.net/> website."
840 #: ../src/guestfs.pod:412
842 "If you don't want to use Augeas (you fool!) then try calling "
843 "L</guestfs_read_lines> to get the file as a list of lines which you can "
848 #: ../src/guestfs.pod:416
853 #: ../src/guestfs.pod:418
855 "We support SELinux guests. To ensure that labeling happens correctly in "
856 "SELinux guests, you need to enable SELinux and load the guest's policy:"
860 #: ../src/guestfs.pod:424
865 #: ../src/guestfs.pod:426
866 msgid "Before launching, do:"
870 #: ../src/guestfs.pod:428
873 " guestfs_set_selinux (g, 1);\n"
878 #: ../src/guestfs.pod:430
883 #: ../src/guestfs.pod:432
885 "After mounting the guest's filesystem(s), load the policy. This is best "
886 "done by running the L<load_policy(8)> command in the guest itself:"
890 #: ../src/guestfs.pod:436
893 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
898 #: ../src/guestfs.pod:438
900 "(Older versions of C<load_policy> require you to specify the name of the "
905 #: ../src/guestfs.pod:441
910 #: ../src/guestfs.pod:443
912 "Optionally, set the security context for the API. The correct security "
913 "context to use can only be known by inspecting the guest. As an example:"
917 #: ../src/guestfs.pod:447
920 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
925 #: ../src/guestfs.pod:451
926 msgid "This will work for running commands and editing existing files."
930 #: ../src/guestfs.pod:453
932 "When new files are created, you may need to label them explicitly, for "
933 "example by running the external command C<restorecon pathname>."
937 #: ../src/guestfs.pod:457
942 #: ../src/guestfs.pod:459
944 "Certain calls are affected by the current file mode creation mask (the "
945 "\"umask\"). In particular ones which create files or directories, such as "
946 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
947 "either the default mode that the file is created with or modifies the mode "
952 #: ../src/guestfs.pod:465
954 "The default umask is C<022>, so files are created with modes such as C<0644> "
955 "and directories with C<0755>."
959 #: ../src/guestfs.pod:468
961 "There are two ways to avoid being affected by umask. Either set umask to 0 "
962 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
963 "L</guestfs_chmod> after creating each file or directory."
967 #: ../src/guestfs.pod:472
968 msgid "For more information about umask, see L<umask(2)>."
972 #: ../src/guestfs.pod:474 ../fish/guestfish.pod:630
973 msgid "ENCRYPTED DISKS"
977 #: ../src/guestfs.pod:476
979 "Libguestfs allows you to access Linux guests which have been encrypted using "
980 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
981 "standard. This includes nearly all whole disk encryption systems used by "
982 "modern Linux guests."
986 #: ../src/guestfs.pod:482
988 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
989 "returns the string C<crypto_LUKS>)."
993 #: ../src/guestfs.pod:485
995 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
996 "will require the passphrase!"
1000 #: ../src/guestfs.pod:488
1002 "Opening a LUKS device creates a new device mapper device called "
1003 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
1004 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
1005 "decrypted from and encrypted to the underlying block device respectively."
1009 #: ../src/guestfs.pod:494
1011 "LVM volume groups on the device can be made visible by calling "
1012 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
1013 "volume(s) can now be mounted in the usual way."
1017 #: ../src/guestfs.pod:498
1019 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1020 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1021 "[\"/dev/VG\"])>. Then close the mapper device by calling "
1022 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1023 "underlying encrypted block device)."
1027 #: ../src/guestfs.pod:505
1032 #: ../src/guestfs.pod:507
1034 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1035 "contains operating systems. (These APIs used to be in a separate Perl-only "
1036 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1037 "frequently used part of this library has been rewritten in C and moved into "
1042 #: ../src/guestfs.pod:513
1044 "Add all disks belonging to the unknown virtual machine and call "
1045 "L</guestfs_launch> in the usual way."
1049 #: ../src/guestfs.pod:516
1051 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1052 "and certain heuristics, and returns a list of operating systems that were "
1053 "found. An empty list means none were found. A single element is the root "
1054 "filesystem of the operating system. For dual- or multi-boot guests, "
1055 "multiple roots can be returned, each one corresponding to a separate "
1056 "operating system. (Multi-boot virtual machines are extremely rare in the "
1057 "world of virtualization, but since this scenario can happen, we have built "
1058 "libguestfs to deal with it.)"
1062 #: ../src/guestfs.pod:525
1064 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1065 "to get additional details about that operating system. For example, call "
1066 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1067 "Windows and Linux-based operating systems respectively."
1071 #: ../src/guestfs.pod:531
1073 "Un*x-like and Linux-based operating systems usually consist of several "
1074 "filesystems which are mounted at boot time (for example, a separate boot "
1075 "partition mounted on C</boot>). The inspection rules are able to detect how "
1076 "filesystems correspond to mount points. Call "
1077 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1078 "hash table like this example:"
1082 #: ../src/guestfs.pod:538
1085 " /boot => /dev/sda1\n"
1086 " / => /dev/vg_guest/lv_root\n"
1087 " /usr => /dev/vg_guest/lv_usr\n"
1092 #: ../src/guestfs.pod:542
1094 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1095 "filesystems as suggested."
1099 #: ../src/guestfs.pod:545
1101 "Be careful to mount filesystems in the right order (eg. C</> before "
1102 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1107 #: ../src/guestfs.pod:549
1109 "Inspection currently only works for some common operating systems. "
1110 "Contributors are welcome to send patches for other operating systems that we "
1111 "currently cannot detect."
1115 #: ../src/guestfs.pod:553
1117 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1118 "for more details. The L</guestfs_inspect_os> function just ignores any "
1119 "encrypted devices."
1123 #: ../src/guestfs.pod:557
1125 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1126 "inspection and caches the results in the guest handle. Subsequent calls to "
1127 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1128 "re-read the disks. If you change the content of the guest disks, you can "
1129 "redo inspection by calling L</guestfs_inspect_os> again."
1133 #: ../src/guestfs.pod:564
1134 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1138 #: ../src/guestfs.pod:566
1140 "Libguestfs can mount NTFS partitions. It does this using the "
1141 "L<http://www.ntfs-3g.org/> driver."
1145 #: ../src/guestfs.pod:569
1147 "DOS and Windows still use drive letters, and the filesystems are always "
1148 "treated as case insensitive by Windows itself, and therefore you might find "
1149 "a Windows configuration file referring to a path like "
1150 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1151 "that directory might be referred to as C</WINDOWS/System32>."
1155 #: ../src/guestfs.pod:575
1157 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1158 "libguestfs to read the appropriate Windows Registry and configuration files, "
1159 "to determine yourself how drives are mapped (see also L<hivex(3)> and "
1160 "L<virt-inspector(1)>)."
1164 #: ../src/guestfs.pod:580
1166 "Replacing backslash characters with forward slash characters is also outside "
1167 "the scope of libguestfs, but something that you can easily do."
1171 #: ../src/guestfs.pod:583
1173 "Where we can help is in resolving the case insensitivity of paths. For "
1174 "this, call L</guestfs_case_sensitive_path>."
1178 #: ../src/guestfs.pod:586
1180 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1181 "files, through the library C<hivex> which is part of the libguestfs project "
1182 "although ships as a separate tarball. You have to locate and download the "
1183 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1184 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1185 "L<virt-win-reg(1)> for more help on this issue."
1189 #: ../src/guestfs.pod:594
1190 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1194 #: ../src/guestfs.pod:596
1196 "Although we don't want to discourage you from using the C API, we will "
1197 "mention here that the same API is also available in other languages."
1201 #: ../src/guestfs.pod:599
1203 "The API is broadly identical in all supported languages. This means that "
1204 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, "
1205 "C<g.mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1206 "words, a straightforward, predictable isomorphism between each language."
1210 #: ../src/guestfs.pod:605
1212 "Error messages are automatically transformed into exceptions if the language "
1217 #: ../src/guestfs.pod:608
1219 "We don't try to \"object orientify\" parts of the API in OO languages, "
1220 "although contributors are welcome to write higher level APIs above what we "
1221 "provide in their favourite languages if they wish."
1225 #: ../src/guestfs.pod:614
1230 #: ../src/guestfs.pod:616
1232 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1233 "identical to the C API. C++ classes and exceptions are not used."
1237 #: ../src/guestfs.pod:620
1242 #: ../src/guestfs.pod:622
1244 "The C# bindings are highly experimental. Please read the warnings at the "
1245 "top of C<csharp/Libguestfs.cs>."
1249 #: ../src/guestfs.pod:625
1254 #: ../src/guestfs.pod:627
1256 "This is the only language binding that is working but incomplete. Only "
1257 "calls which return simple integers have been bound in Haskell, and we are "
1258 "looking for help to complete this binding."
1262 #: ../src/guestfs.pod:631
1267 #: ../src/guestfs.pod:633
1269 "Full documentation is contained in the Javadoc which is distributed with "
1274 #: ../src/guestfs.pod:636
1279 #: ../src/guestfs.pod:638
1280 msgid "For documentation see the file C<guestfs.mli>."
1284 #: ../src/guestfs.pod:640
1289 #: ../src/guestfs.pod:642
1290 msgid "For documentation see L<Sys::Guestfs(3)>."
1294 #: ../src/guestfs.pod:644
1299 #: ../src/guestfs.pod:646
1301 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1302 "the php-libguestfs package for your distribution."
1306 #: ../src/guestfs.pod:649
1307 msgid "The PHP binding only works correctly on 64 bit machines."
1311 #: ../src/guestfs.pod:651
1316 #: ../src/guestfs.pod:653
1317 msgid "For documentation do:"
1321 #: ../src/guestfs.pod:655
1325 " >>> import guestfs\n"
1326 " >>> help (guestfs)\n"
1331 #: ../src/guestfs.pod:659
1336 #: ../src/guestfs.pod:661
1338 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1339 "can find examples written in Ruby in the libguestfs source."
1343 #: ../src/guestfs.pod:664
1344 msgid "B<shell scripts>"
1348 #: ../src/guestfs.pod:666
1349 msgid "For documentation see L<guestfish(1)>."
1353 #: ../src/guestfs.pod:670
1354 msgid "LIBGUESTFS GOTCHAS"
1358 #: ../src/guestfs.pod:672
1360 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1361 "system [...] that works in the way it is documented but is counterintuitive "
1362 "and almost invites mistakes.\""
1366 #: ../src/guestfs.pod:676
1368 "Since we developed libguestfs and the associated tools, there are several "
1369 "things we would have designed differently, but are now stuck with for "
1370 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1371 "release, you can expect these to change. Beware of them."
1375 #: ../src/guestfs.pod:684
1376 msgid "Autosync / forgetting to sync."
1380 #: ../src/guestfs.pod:686
1382 "When modifying a filesystem from C or another language, you B<must> unmount "
1383 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1384 "libguestfs handle. You can also call:"
1388 #: ../src/guestfs.pod:690
1391 " guestfs_set_autosync (g, 1);\n"
1396 #: ../src/guestfs.pod:692
1398 "to have the unmount/sync done automatically for you when the handle 'g' is "
1399 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1404 #: ../src/guestfs.pod:696
1406 "If you forget to do this, then it is entirely possible that your changes "
1407 "won't be written out, or will be partially written, or (very rarely) that "
1408 "you'll get disk corruption."
1412 #: ../src/guestfs.pod:700
1414 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1415 "guestfish scripts that forget to sync will work just fine, which can make "
1416 "this very puzzling if you are trying to debug a problem."
1420 #: ../src/guestfs.pod:704
1421 msgid "Mount option C<-o sync> should not be the default."
1425 #: ../src/guestfs.pod:706
1427 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1428 "However C<-o sync> does not add any reliability benefit, but does have a "
1429 "very large performance impact."
1433 #: ../src/guestfs.pod:710
1435 "The work around is to use L</guestfs_mount_options> and set the mount "
1436 "options that you actually want to use."
1440 #: ../src/guestfs.pod:713
1441 msgid "Read-only should be the default."
1445 #: ../src/guestfs.pod:715
1447 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1448 "specify I<--rw> if you want to make changes to the image."
1452 #: ../src/guestfs.pod:718
1453 msgid "This would reduce the potential to corrupt live VM images."
1457 #: ../src/guestfs.pod:720
1459 "Note that many filesystems change the disk when you just mount and unmount, "
1460 "even if you didn't perform any writes. You need to use "
1461 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1465 #: ../src/guestfs.pod:724
1466 msgid "guestfish command line is hard to use."
1470 #: ../src/guestfs.pod:726
1472 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1473 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1474 "exist, so it fails. In earlier versions of guestfish the error message was "
1475 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1476 "we should have used C<guestfish -c command> to run commands."
1480 #: ../src/guestfs.pod:733
1481 msgid "guestfish megabyte modifiers don't work right on all commands"
1485 #: ../src/guestfs.pod:735
1487 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1488 "other modifiers). What guestfish actually does is to multiply the number "
1489 "part by the modifier part and pass the result to the C API. However this "
1490 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1491 "expecting some other unit (eg. megabytes)."
1495 #: ../src/guestfs.pod:742
1496 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1500 #: ../src/guestfs.pod:744
1503 " lvcreate LV VG 100M\n"
1508 #: ../src/guestfs.pod:746
1510 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1511 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1512 "megabytes * megabytes) logical volume. The error message you get from this "
1513 "is also a little obscure."
1517 #: ../src/guestfs.pod:751
1519 "This could be fixed in the generator by specially marking parameters and "
1520 "return values which take bytes or other units."
1524 #: ../src/guestfs.pod:754
1525 msgid "Library should return errno with error messages."
1529 #: ../src/guestfs.pod:756
1531 "It would be a nice-to-have to be able to get the original value of 'errno' "
1532 "from inside the appliance along error paths (where set). Currently "
1533 "L<guestmount(1)> goes through hoops to try to reverse the error message "
1534 "string into an errno, see the function error() in fuse/guestmount.c."
1538 #: ../src/guestfs.pod:762
1540 "In libguestfs 1.5.4, the protocol was changed so that the Linux errno is "
1541 "sent back from the daemon."
1545 #: ../src/guestfs.pod:765
1546 msgid "Ambiguity between devices and paths"
1550 #: ../src/guestfs.pod:767
1552 "There is a subtle ambiguity in the API between a device name "
1553 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
1554 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1558 #: ../src/guestfs.pod:772
1560 "In the current API we usually resolve this ambiguity by having two separate "
1561 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1562 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1563 "detecting if the path supplied begins with C</dev/>."
1567 #: ../src/guestfs.pod:778
1569 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1570 "make paths/devices into structured names. One way to do this would be to "
1571 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1572 "aspect of grub. Another way would be to use a structured type, equivalent "
1573 "to this OCaml type:"
1577 #: ../src/guestfs.pod:784
1580 " type path = Path of string | Device of int | Partition of int * int\n"
1585 #: ../src/guestfs.pod:786
1586 msgid "which would allow you to pass arguments like:"
1590 #: ../src/guestfs.pod:788
1593 " Path \"/foo/bar\"\n"
1594 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1595 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1596 " Path \"/dev/sdb2\" (* not a device *)\n"
1601 #: ../src/guestfs.pod:793
1603 "As you can see there are still problems to resolve even with this "
1604 "representation. Also consider how it might work in guestfish."
1608 #: ../src/guestfs.pod:798
1609 msgid "PROTOCOL LIMITS"
1613 #: ../src/guestfs.pod:800
1615 "Internally libguestfs uses a message-based protocol to pass API calls and "
1616 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1617 "plenty more detail about this). The maximum message size used by the "
1618 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1619 "aware of this limit. The API calls which may be affected are individually "
1620 "documented, with a link back to this section of the documentation."
1624 #: ../src/guestfs.pod:808
1626 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1627 "a simple string. Because this string is at some point internally encoded as "
1628 "a message, the maximum size that it can return is slightly under 4 MB. If "
1629 "the requested file is larger than this then you will get an error."
1633 #: ../src/guestfs.pod:814
1635 "In order to transfer large files into and out of the guest filesystem, you "
1636 "need to use particular calls that support this. The sections L</UPLOADING> "
1637 "and L</DOWNLOADING> document how to do this."
1641 #: ../src/guestfs.pod:818
1643 "You might also consider mounting the disk image using our FUSE filesystem "
1644 "support (L<guestmount(1)>)."
1648 #: ../src/guestfs.pod:821
1649 msgid "KEYS AND PASSPHRASES"
1653 #: ../src/guestfs.pod:823
1655 "Certain libguestfs calls take a parameter that contains sensitive key "
1656 "material, passed in as a C string."
1660 #: ../src/guestfs.pod:826
1662 "In the future we would hope to change the libguestfs implementation so that "
1663 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1664 "swap. However this is I<not> done at the moment, because of the complexity "
1665 "of such an implementation."
1669 #: ../src/guestfs.pod:831
1671 "Therefore you should be aware that any key parameter you pass to libguestfs "
1672 "might end up being written out to the swap partition. If this is a concern, "
1673 "scrub the swap partition or don't use libguestfs on encrypted devices."
1677 #: ../src/guestfs.pod:836
1678 msgid "CONNECTION MANAGEMENT"
1682 #: ../src/guestfs.pod:838
1687 #: ../src/guestfs.pod:840
1689 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1690 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1691 "handle and release all resources used."
1695 #: ../src/guestfs.pod:844
1697 "For information on using multiple handles and threads, see the section "
1698 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1702 #: ../src/guestfs.pod:847
1703 msgid "guestfs_create"
1707 #: ../src/guestfs.pod:849
1710 " guestfs_h *guestfs_create (void);\n"
1715 #: ../src/guestfs.pod:851
1716 msgid "Create a connection handle."
1720 #: ../src/guestfs.pod:853
1722 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
1723 "on the handle at least once."
1727 #: ../src/guestfs.pod:856
1729 "This function returns a non-NULL pointer to a handle on success or NULL on "
1734 #: ../src/guestfs.pod:859
1735 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1739 #: ../src/guestfs.pod:861
1741 "You may also want to configure error handling for the handle. See L</ERROR "
1742 "HANDLING> section below."
1746 #: ../src/guestfs.pod:864
1747 msgid "guestfs_close"
1751 #: ../src/guestfs.pod:866
1754 " void guestfs_close (guestfs_h *g);\n"
1759 #: ../src/guestfs.pod:868
1760 msgid "This closes the connection handle and frees up all resources used."
1764 #: ../src/guestfs.pod:870
1765 msgid "ERROR HANDLING"
1769 #: ../src/guestfs.pod:872
1771 "The convention in all functions that return C<int> is that they return C<-1> "
1772 "to indicate an error. You can get additional information on errors by "
1773 "calling L</guestfs_last_error> and/or by setting up an error handler with "
1774 "L</guestfs_set_error_handler>."
1778 #: ../src/guestfs.pod:877
1779 msgid "The default error handler prints the information string to C<stderr>."
1783 #: ../src/guestfs.pod:879
1785 "Out of memory errors are handled differently. The default action is to call "
1786 "L<abort(3)>. If this is undesirable, then you can set a handler using "
1787 "L</guestfs_set_out_of_memory_handler>."
1791 #: ../src/guestfs.pod:883
1792 msgid "guestfs_last_error"
1796 #: ../src/guestfs.pod:885
1799 " const char *guestfs_last_error (guestfs_h *g);\n"
1804 #: ../src/guestfs.pod:887
1806 "This returns the last error message that happened on C<g>. If there has not "
1807 "been an error since the handle was created, then this returns C<NULL>."
1811 #: ../src/guestfs.pod:891
1813 "The lifetime of the returned string is until the next error occurs, or "
1814 "L</guestfs_close> is called."
1818 #: ../src/guestfs.pod:894
1820 "The error string is not localized (ie. is always in English), because this "
1821 "makes searching for error messages in search engines give the largest number "
1826 #: ../src/guestfs.pod:898
1827 msgid "guestfs_set_error_handler"
1831 #: ../src/guestfs.pod:900
1834 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1836 " const char *msg);\n"
1837 " void guestfs_set_error_handler (guestfs_h *g,\n"
1838 " guestfs_error_handler_cb cb,\n"
1844 #: ../src/guestfs.pod:907
1846 "The callback C<cb> will be called if there is an error. The parameters "
1847 "passed to the callback are an opaque data pointer and the error message "
1852 #: ../src/guestfs.pod:911
1854 "Note that the message string C<msg> is freed as soon as the callback "
1855 "function returns, so if you want to stash it somewhere you must make your "
1860 #: ../src/guestfs.pod:915
1861 msgid "The default handler prints messages on C<stderr>."
1865 #: ../src/guestfs.pod:917
1866 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
1870 #: ../src/guestfs.pod:919
1871 msgid "guestfs_get_error_handler"
1875 #: ../src/guestfs.pod:921
1878 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
1879 " void **opaque_rtn);\n"
1884 #: ../src/guestfs.pod:924
1885 msgid "Returns the current error handler callback."
1889 #: ../src/guestfs.pod:926
1890 msgid "guestfs_set_out_of_memory_handler"
1894 #: ../src/guestfs.pod:928
1897 " typedef void (*guestfs_abort_cb) (void);\n"
1898 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
1899 " guestfs_abort_cb);\n"
1904 #: ../src/guestfs.pod:932
1906 "The callback C<cb> will be called if there is an out of memory situation. "
1907 "I<Note this callback must not return>."
1911 #: ../src/guestfs.pod:935
1912 msgid "The default is to call L<abort(3)>."
1916 #: ../src/guestfs.pod:937
1917 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
1921 #: ../src/guestfs.pod:940
1922 msgid "guestfs_get_out_of_memory_handler"
1926 #: ../src/guestfs.pod:942
1929 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
1934 #: ../src/guestfs.pod:944
1935 msgid "This returns the current out of memory handler."
1939 #: ../src/guestfs.pod:946
1944 #: ../src/guestfs.pod:948
1946 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1951 #: ../src/guestfs.pod:951
1953 "By default it looks for these in the directory C<$libdir/guestfs> "
1954 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1958 #: ../src/guestfs.pod:954
1960 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1961 "to change the directories that libguestfs will search in. The value is a "
1962 "colon-separated list of paths. The current directory is I<not> searched "
1963 "unless the path contains an empty element or C<.>. For example "
1964 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1965 "then C</usr/lib/guestfs>."
1969 #: ../src/guestfs.pod:961
1970 msgid "HIGH-LEVEL API ACTIONS"
1974 #: ../src/guestfs.pod:963
1975 msgid "ABI GUARANTEE"
1979 #: ../src/guestfs.pod:965
1981 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1982 "actions as outlined in this section. Although we will deprecate some "
1983 "actions, for example if they get replaced by newer calls, we will keep the "
1984 "old actions forever. This allows you the developer to program in confidence "
1985 "against the libguestfs API."
1989 #: ../src/guestfs.pod:971 ../fish/guestfish.pod:860
1994 #: ../src/guestfs.pod:973
1999 #: ../src/guestfs.pod:975
2004 #: ../src/guestfs.pod:977
2005 msgid "AVAILABILITY"
2009 #: ../src/guestfs.pod:979
2010 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2014 #: ../src/guestfs.pod:981
2016 "Using L</guestfs_available> you can test availability of the following "
2017 "groups of functions. This test queries the appliance to see if the "
2018 "appliance you are currently using supports the functionality."
2022 #: ../src/guestfs.pod:986
2023 msgid "@AVAILABILITY@"
2027 #: ../src/guestfs.pod:988
2028 msgid "GUESTFISH supported COMMAND"
2032 #: ../src/guestfs.pod:990
2034 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2035 "prints out the available groups and whether they are supported by this build "
2036 "of libguestfs. Note however that you have to do C<run> first."
2040 #: ../src/guestfs.pod:995
2041 msgid "SINGLE CALLS AT COMPILE TIME"
2045 #: ../src/guestfs.pod:997
2047 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2048 "function, such as:"
2052 #: ../src/guestfs.pod:1000
2055 " #define LIBGUESTFS_HAVE_DD 1\n"
2060 #: ../src/guestfs.pod:1002
2061 msgid "if L</guestfs_dd> is available."
2065 #: ../src/guestfs.pod:1004
2067 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2068 "function is available at compile time, we recommended using build tools such "
2069 "as autoconf or cmake. For example in autotools you could use:"
2073 #: ../src/guestfs.pod:1009
2076 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2077 " AC_CHECK_FUNCS([guestfs_dd])\n"
2082 #: ../src/guestfs.pod:1012
2084 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2089 #: ../src/guestfs.pod:1015
2090 msgid "SINGLE CALLS AT RUN TIME"
2094 #: ../src/guestfs.pod:1017
2096 "Testing at compile time doesn't guarantee that a function really exists in "
2097 "the library. The reason is that you might be dynamically linked against a "
2098 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2099 "This situation unfortunately results in a segmentation fault, which is a "
2100 "shortcoming of the C dynamic linking system itself."
2104 #: ../src/guestfs.pod:1024
2106 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2107 "in this example program (note that you still need the compile time check as "
2112 #: ../src/guestfs.pod:1028
2115 " #include <stdio.h>\n"
2116 " #include <stdlib.h>\n"
2117 " #include <unistd.h>\n"
2118 " #include <dlfcn.h>\n"
2119 " #include <guestfs.h>\n"
2124 #: ../src/guestfs.pod:1034
2129 " #ifdef LIBGUESTFS_HAVE_DD\n"
2131 " int has_function;\n"
2136 #: ../src/guestfs.pod:1040
2139 " /* Test if the function guestfs_dd is really available. */\n"
2140 " dl = dlopen (NULL, RTLD_LAZY);\n"
2142 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2143 " exit (EXIT_FAILURE);\n"
2145 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2151 #: ../src/guestfs.pod:1049
2154 " if (!has_function)\n"
2155 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2157 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2158 " /* Now it's safe to call\n"
2159 " guestfs_dd (g, \"foo\", \"bar\");\n"
2163 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2170 #: ../src/guestfs.pod:1062
2172 "You may think the above is an awful lot of hassle, and it is. There are "
2173 "other ways outside of the C linking system to ensure that this kind of "
2174 "incompatibility never arises, such as using package versioning:"
2178 #: ../src/guestfs.pod:1067
2181 " Requires: libguestfs >= 1.0.80\n"
2186 #: ../src/guestfs.pod:1069
2187 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2191 #: ../src/guestfs.pod:1071
2193 "A recent feature of the API is the introduction of calls which take optional "
2194 "arguments. In C these are declared 3 ways. The main way is as a call which "
2195 "takes variable arguments (ie. C<...>), as in this example:"
2199 #: ../src/guestfs.pod:1076
2202 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2207 #: ../src/guestfs.pod:1078
2209 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2210 "call with no optional arguments specified:"
2214 #: ../src/guestfs.pod:1081
2217 " guestfs_add_drive_opts (g, filename, -1);\n"
2222 #: ../src/guestfs.pod:1083
2223 msgid "With a single optional argument:"
2227 #: ../src/guestfs.pod:1085
2230 " guestfs_add_drive_opts (g, filename,\n"
2231 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2237 #: ../src/guestfs.pod:1089
2242 #: ../src/guestfs.pod:1091
2245 " guestfs_add_drive_opts (g, filename,\n"
2246 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2247 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2253 #: ../src/guestfs.pod:1096
2255 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2260 #: ../src/guestfs.pod:1099
2261 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2265 #: ../src/guestfs.pod:1101
2267 "The second variant has the same name with the suffix C<_va>, which works the "
2268 "same way but takes a C<va_list>. See the C manual for details. For the "
2269 "example function, this is declared:"
2273 #: ../src/guestfs.pod:1105
2276 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2282 #: ../src/guestfs.pod:1108
2283 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2287 #: ../src/guestfs.pod:1110
2289 "The third variant is useful where you need to construct these calls. You "
2290 "pass in a structure where you fill in the optional fields. The structure "
2291 "has a bitmask as the first element which you must set to indicate which "
2292 "fields you have filled in. For our example function the structure and call "
2297 #: ../src/guestfs.pod:1116
2300 " struct guestfs_add_drive_opts_argv {\n"
2301 " uint64_t bitmask;\n"
2303 " const char *format;\n"
2306 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
2307 " const struct guestfs_add_drive_opts_argv *optargs);\n"
2312 #: ../src/guestfs.pod:1125
2313 msgid "You could call it like this:"
2317 #: ../src/guestfs.pod:1127
2320 " struct guestfs_add_drive_opts_argv optargs = {\n"
2321 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
2322 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
2324 " .format = \"qcow2\"\n"
2330 #: ../src/guestfs.pod:1134
2333 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
2338 #: ../src/guestfs.pod:1136 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:1582 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1244
2343 #: ../src/guestfs.pod:1142
2344 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
2348 #: ../src/guestfs.pod:1147
2349 msgid "You do not need to fill in all fields of the structure."
2353 #: ../src/guestfs.pod:1151
2355 "There must be a one-to-one correspondence between fields of the structure "
2356 "that are filled in, and bits set in the bitmask."
2360 #: ../src/guestfs.pod:1156
2361 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
2365 #: ../src/guestfs.pod:1158
2367 "In other languages, optional arguments are expressed in the way that is "
2368 "natural for that language. We refer you to the language-specific "
2369 "documentation for more details on that."
2373 #: ../src/guestfs.pod:1162
2374 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
2378 #: ../src/guestfs.pod:1164 ../src/guestfs.pod:1169
2383 #: ../src/guestfs.pod:1166
2385 "<!-- old anchor for the next section --> <a "
2386 "name=\"state_machine_and_low_level_event_api\"/>"
2390 #: ../src/guestfs.pod:1171
2391 msgid "ARCHITECTURE"
2395 #: ../src/guestfs.pod:1173
2397 "Internally, libguestfs is implemented by running an appliance (a special "
2398 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2399 "process of the main program."
2403 #: ../src/guestfs.pod:1177
2406 " ___________________\n"
2408 " | main program |\n"
2410 " | | child process / appliance\n"
2411 " | | __________________________\n"
2413 " +-------------------+ RPC | +-----------------+ |\n"
2414 " | libguestfs <--------------------> guestfsd | |\n"
2415 " | | | +-----------------+ |\n"
2416 " \\___________________/ | | Linux kernel | |\n"
2417 " | +--^--------------+ |\n"
2418 " \\_________|________________/\n"
2424 " \\______________/\n"
2429 #: ../src/guestfs.pod:1197
2431 "The library, linked to the main program, creates the child process and hence "
2432 "the appliance in the L</guestfs_launch> function."
2436 #: ../src/guestfs.pod:1200
2438 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2439 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2440 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2441 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2442 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2443 "attached to the qemu process which translates device access by the "
2444 "appliance's Linux kernel into accesses to the image."
2448 #: ../src/guestfs.pod:1209
2450 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2451 "Although the disk image you are attached to might also be used by some "
2452 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2453 "care if both libguestfs's qemu process and your virtual machine are trying "
2454 "to update the disk image at the same time, since these usually results in "
2455 "massive disk corruption)."
2459 #: ../src/guestfs.pod:1216
2460 msgid "STATE MACHINE"
2464 #: ../src/guestfs.pod:1218
2465 msgid "libguestfs uses a state machine to model the child process:"
2469 #: ../src/guestfs.pod:1220
2481 " / | \\ \\ guestfs_launch\n"
2482 " / | _\\__V______\n"
2484 " / | | LAUNCHING |\n"
2485 " / | \\___________/\n"
2487 " / | guestfs_launch\n"
2489 " ______ / __|____V\n"
2490 " / \\ ------> / \\\n"
2491 " | BUSY | | READY |\n"
2492 " \\______/ <------ \\________/\n"
2497 #: ../src/guestfs.pod:1242
2499 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2500 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2501 "(3) alternating between READY and BUSY as commands are issued to, and "
2502 "carried out by, the child process."
2506 #: ../src/guestfs.pod:1247
2508 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2509 "asynchronously at any time (eg. due to some internal error), and that causes "
2510 "the state to transition back to CONFIG."
2514 #: ../src/guestfs.pod:1251
2516 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2517 "issued when in the CONFIG state."
2521 #: ../src/guestfs.pod:1254
2523 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2524 "L</guestfs_launch> blocks until the child process is READY to accept "
2525 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2526 "moves the state from CONFIG to LAUNCHING while it is running."
2530 #: ../src/guestfs.pod:1260
2532 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2533 "state. These API calls block waiting for the command to be carried out "
2534 "(ie. the state to transition to BUSY and then back to READY). There are no "
2535 "non-blocking versions, and no way to issue more than one command per handle "
2540 #: ../src/guestfs.pod:1266
2542 "Finally, the child process sends asynchronous messages back to the main "
2543 "program, such as kernel log messages. You can register a callback to "
2544 "receive these messages."
2548 #: ../src/guestfs.pod:1270
2549 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2553 #: ../src/guestfs.pod:1272
2555 "The child process generates events in some situations. Current events "
2556 "include: receiving a log message, the child process exits."
2560 #: ../src/guestfs.pod:1275
2562 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2567 #: ../src/guestfs.pod:1278
2569 "Only I<one callback of each type> can be registered for each handle. "
2570 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2571 "that type. Cancel all callbacks of this type by calling this function with "
2572 "C<cb> set to C<NULL>."
2576 #: ../src/guestfs.pod:1283
2577 msgid "guestfs_set_log_message_callback"
2581 #: ../src/guestfs.pod:1285
2584 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2585 " char *buf, int len);\n"
2586 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2587 " guestfs_log_message_cb cb,\n"
2593 #: ../src/guestfs.pod:1291
2595 "The callback function C<cb> will be called whenever qemu or the guest writes "
2596 "anything to the console."
2600 #: ../src/guestfs.pod:1294
2601 msgid "Use this function to capture kernel messages and similar."
2605 #: ../src/guestfs.pod:1296
2607 "Normally there is no log message handler, and log messages are just "
2612 #: ../src/guestfs.pod:1299
2613 msgid "guestfs_set_subprocess_quit_callback"
2617 #: ../src/guestfs.pod:1301
2620 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2621 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2622 " guestfs_subprocess_quit_cb cb,\n"
2628 #: ../src/guestfs.pod:1306
2630 "The callback function C<cb> will be called when the child process quits, "
2631 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2632 "corresponds to a transition from any state to the CONFIG state)."
2636 #: ../src/guestfs.pod:1311
2637 msgid "guestfs_set_launch_done_callback"
2641 #: ../src/guestfs.pod:1313
2644 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2645 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2646 " guestfs_launch_done_cb cb,\n"
2652 #: ../src/guestfs.pod:1318
2654 "The callback function C<cb> will be called when the child process becomes "
2655 "ready first time after it has been launched. (This corresponds to a "
2656 "transition from LAUNCHING to the READY state)."
2660 #: ../src/guestfs.pod:1322
2661 msgid "guestfs_set_close_callback"
2665 #: ../src/guestfs.pod:1324
2668 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2669 " void guestfs_set_close_callback (guestfs_h *g,\n"
2670 " guestfs_close_cb cb,\n"
2676 #: ../src/guestfs.pod:1329
2678 "The callback function C<cb> will be called while the handle is being closed "
2679 "(synchronously from L</guestfs_close>)."
2683 #: ../src/guestfs.pod:1332
2685 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2686 "handles that are open when the program exits. This means that this callback "
2687 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2688 "problems in higher-level languages (eg. if your HLL interpreter has already "
2689 "been cleaned up by the time this is called, and if your callback then jumps "
2690 "into some HLL function)."
2694 #: ../src/guestfs.pod:1340
2695 msgid "guestfs_set_progress_callback"
2699 #: ../src/guestfs.pod:1342
2702 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2703 " int proc_nr, int serial,\n"
2704 " uint64_t position, uint64_t total);\n"
2705 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2706 " guestfs_progress_cb cb,\n"
2712 #: ../src/guestfs.pod:1349
2714 "Some long-running operations can generate progress messages. If this "
2715 "callback is registered, then it will be called each time a progress message "
2716 "is generated (usually two seconds after the operation started, and three "
2717 "times per second thereafter until it completes, although the frequency may "
2718 "change in future versions)."
2722 #: ../src/guestfs.pod:1355
2724 "The callback receives two numbers: C<position> and C<total>. The units of "
2725 "C<total> are not defined, although for some operations C<total> may relate "
2726 "in some way to the amount of data to be transferred (eg. in bytes or "
2727 "megabytes), and C<position> may be the portion which has been transferred."
2731 #: ../src/guestfs.pod:1361
2732 msgid "The only defined and stable parts of the API are:"
2736 #: ../src/guestfs.pod:1367
2738 "The callback can display to the user some type of progress bar or indicator "
2739 "which shows the ratio of C<position>:C<total>."
2743 #: ../src/guestfs.pod:1372
2744 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2748 #: ../src/guestfs.pod:1376
2750 "If any progress notification is sent during a call, then a final progress "
2751 "notification is always sent when C<position> = C<total>."
2755 #: ../src/guestfs.pod:1379
2757 "This is to simplify caller code, so callers can easily set the progress "
2758 "indicator to \"100%\" at the end of the operation, without requiring special "
2759 "code to detect this case."
2763 #: ../src/guestfs.pod:1385
2765 "The callback also receives the procedure number and serial number of the "
2766 "call. These are only useful for debugging protocol issues, and the callback "
2767 "can normally ignore them. The callback may want to print these numbers in "
2768 "error messages or debugging messages."
2772 #: ../src/guestfs.pod:1390
2773 msgid "PRIVATE DATA AREA"
2777 #: ../src/guestfs.pod:1392
2779 "You can attach named pieces of private data to the libguestfs handle, and "
2780 "fetch them by name for the lifetime of the handle. This is called the "
2781 "private data area and is only available from the C API."
2785 #: ../src/guestfs.pod:1396
2786 msgid "To attach a named piece of data, use the following call:"
2790 #: ../src/guestfs.pod:1398
2793 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2798 #: ../src/guestfs.pod:1400
2800 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2801 "pointer (which can be C<NULL>). Any previous item with the same name is "
2806 #: ../src/guestfs.pod:1404
2808 "You can use any C<key> you want, but names beginning with an underscore "
2809 "character are reserved for internal libguestfs purposes (for implementing "
2810 "language bindings). It is recommended to prefix the name with some unique "
2811 "string to avoid collisions with other users."
2815 #: ../src/guestfs.pod:1409
2816 msgid "To retrieve the pointer, use:"
2820 #: ../src/guestfs.pod:1411
2823 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2828 #: ../src/guestfs.pod:1413
2830 "This function returns C<NULL> if either no data is found associated with "
2831 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2836 #: ../src/guestfs.pod:1417
2838 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2839 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2840 "all. In particular, libguestfs does I<not> try to free the data when the "
2841 "handle is closed. If the data must be freed, then the caller must either "
2842 "free it before calling L</guestfs_close> or must set up a close callback to "
2843 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2844 "can be registered for a handle)."
2848 #: ../src/guestfs.pod:1425
2850 "The private data area is implemented using a hash table, and should be "
2851 "reasonably efficient for moderate numbers of keys."
2855 #: ../src/guestfs.pod:1428
2856 msgid "BLOCK DEVICE NAMING"
2860 #: ../src/guestfs.pod:1430
2862 "In the kernel there is now quite a profusion of schemata for naming block "
2863 "devices (in this context, by I<block device> I mean a physical or virtual "
2864 "hard drive). The original Linux IDE driver used names starting with "
2865 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
2866 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
2867 "replacement for the old IDE driver (particularly for SATA devices) those "
2868 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
2869 "machines with paravirtualized drivers. This has created several different "
2870 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
2875 #: ../src/guestfs.pod:1442
2877 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2878 "Linux kernel to access block devices. We can run a variety of appliances "
2879 "based on a variety of Linux kernels."
2883 #: ../src/guestfs.pod:1446
2885 "This causes a problem for libguestfs because many API calls use device or "
2886 "partition names. Working scripts and the recipe (example) scripts that we "
2887 "make available over the internet could fail if the naming scheme changes."
2891 #: ../src/guestfs.pod:1451
2893 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2894 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2895 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2896 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2900 #: ../src/guestfs.pod:1457
2902 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2903 "L</guestfs_list_partitions> and similar calls return the true names of the "
2904 "devices and partitions as known to the appliance."
2908 #: ../src/guestfs.pod:1462
2909 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2913 #: ../src/guestfs.pod:1464
2915 "Usually this translation is transparent. However in some (very rare) cases "
2916 "you may need to know the exact algorithm. Such cases include where you use "
2917 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
2918 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
2923 #: ../src/guestfs.pod:1470
2925 "The algorithm is applied only to I<parameters> which are known to be either "
2926 "device or partition names. Return values from functions such as "
2927 "L</guestfs_list_devices> are never changed."
2931 #: ../src/guestfs.pod:1478
2932 msgid "Is the string a parameter which is a device or partition name?"
2936 #: ../src/guestfs.pod:1482
2937 msgid "Does the string begin with C</dev/sd>?"
2941 #: ../src/guestfs.pod:1486
2943 "Does the named device exist? If so, we use that device. However if I<not> "
2944 "then we continue with this algorithm."
2948 #: ../src/guestfs.pod:1491
2949 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2953 #: ../src/guestfs.pod:1493
2954 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2958 #: ../src/guestfs.pod:1495
2959 msgid "If that named device exists, use it. If not, continue."
2963 #: ../src/guestfs.pod:1499
2964 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2968 #: ../src/guestfs.pod:1501
2969 msgid "If that named device exists, use it. If not, return an error."
2973 #: ../src/guestfs.pod:1505
2974 msgid "PORTABILITY CONCERNS"
2978 #: ../src/guestfs.pod:1507
2980 "Although the standard naming scheme and automatic translation is useful for "
2981 "simple programs and guestfish scripts, for larger programs it is best not to "
2982 "rely on this mechanism."
2986 #: ../src/guestfs.pod:1511
2988 "Where possible for maximum future portability programs using libguestfs "
2989 "should use these future-proof techniques:"
2993 #: ../src/guestfs.pod:1518
2995 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2996 "device names, and then use those names directly."
3000 #: ../src/guestfs.pod:1521
3001 msgid "Since those device names exist by definition, they will never be translated."
3005 #: ../src/guestfs.pod:1526
3007 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
3008 "filesystem labels."
3012 #: ../src/guestfs.pod:1531
3017 #: ../src/guestfs.pod:1533
3018 msgid "COMMUNICATION PROTOCOL"
3022 #: ../src/guestfs.pod:1535
3024 "Don't rely on using this protocol directly. This section documents how it "
3025 "currently works, but it may change at any time."
3029 #: ../src/guestfs.pod:1538
3031 "The protocol used to talk between the library and the daemon running inside "
3032 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3033 "1014, RFC 1832, RFC 4506)."
3037 #: ../src/guestfs.pod:1542
3039 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3040 "this file is automatically generated)."
3044 #: ../src/guestfs.pod:1545
3046 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3047 "and C<FileOut> parameters, which are handled with very simple request/reply "
3048 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3049 "parameters, which use the same request and reply messages, but they may also "
3050 "be followed by files sent using a chunked encoding."
3054 #: ../src/guestfs.pod:1552
3055 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3059 #: ../src/guestfs.pod:1554
3060 msgid "For ordinary functions, the request message is:"
3064 #: ../src/guestfs.pod:1556
3067 " total length (header + arguments,\n"
3068 " but not including the length word itself)\n"
3069 " struct guestfs_message_header (encoded as XDR)\n"
3070 " struct guestfs_<foo>_args (encoded as XDR)\n"
3075 #: ../src/guestfs.pod:1561
3077 "The total length field allows the daemon to allocate a fixed size buffer "
3078 "into which it slurps the rest of the message. As a result, the total length "
3079 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3080 "effective size of any request is limited to somewhere under this size."
3084 #: ../src/guestfs.pod:1567
3086 "Note also that many functions don't take any arguments, in which case the "
3087 "C<guestfs_I<foo>_args> is completely omitted."
3091 #: ../src/guestfs.pod:1570
3093 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3094 "receiver knows what type of args structure to expect, or none at all."
3098 #: ../src/guestfs.pod:1574
3099 msgid "The reply message for ordinary functions is:"
3103 #: ../src/guestfs.pod:1576
3106 " total length (header + ret,\n"
3107 " but not including the length word itself)\n"
3108 " struct guestfs_message_header (encoded as XDR)\n"
3109 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3114 #: ../src/guestfs.pod:1581
3116 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3117 "functions that return no formal return values."
3121 #: ../src/guestfs.pod:1584
3122 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3126 #: ../src/guestfs.pod:1587
3128 "In the case of an error, a flag is set in the header, and the reply message "
3129 "is slightly changed:"
3133 #: ../src/guestfs.pod:1590
3136 " total length (header + error,\n"
3137 " but not including the length word itself)\n"
3138 " struct guestfs_message_header (encoded as XDR)\n"
3139 " struct guestfs_message_error (encoded as XDR)\n"
3144 #: ../src/guestfs.pod:1595
3146 "The C<guestfs_message_error> structure contains the error message as a "
3151 #: ../src/guestfs.pod:1598
3152 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3156 #: ../src/guestfs.pod:1600
3158 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3159 "The normal request message is sent (see above). However this is followed by "
3160 "a sequence of file chunks."
3164 #: ../src/guestfs.pod:1604
3167 " total length (header + arguments,\n"
3168 " but not including the length word itself,\n"
3169 " and not including the chunks)\n"
3170 " struct guestfs_message_header (encoded as XDR)\n"
3171 " struct guestfs_<foo>_args (encoded as XDR)\n"
3172 " sequence of chunks for FileIn param #0\n"
3173 " sequence of chunks for FileIn param #1 etc.\n"
3178 #: ../src/guestfs.pod:1612
3179 msgid "The \"sequence of chunks\" is:"
3183 #: ../src/guestfs.pod:1614
3186 " length of chunk (not including length word itself)\n"
3187 " struct guestfs_chunk (encoded as XDR)\n"
3188 " length of chunk\n"
3189 " struct guestfs_chunk (encoded as XDR)\n"
3191 " length of chunk\n"
3192 " struct guestfs_chunk (with data.data_len == 0)\n"
3197 #: ../src/guestfs.pod:1622
3199 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3200 "is set in the final chunk to indicate either successful completion or early "
3205 #: ../src/guestfs.pod:1626
3207 "At time of writing there are no functions that have more than one FileIn "
3208 "parameter. However this is (theoretically) supported, by sending the "
3209 "sequence of chunks for each FileIn parameter one after another (from left to "
3214 #: ../src/guestfs.pod:1631
3216 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3217 "transfer. The library does this by sending a chunk with a special flag set "
3218 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3219 "RPC, does I<not> send any reply, and goes back to reading the next request."
3223 #: ../src/guestfs.pod:1637
3225 "The daemon may also cancel. It does this by writing a special word "
3226 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3227 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3228 "cancel chunk). The special word is chosen so that even if cancellation "
3229 "happens right at the end of the transfer (after the library has finished "
3230 "writing and has started listening for the reply), the \"spurious\" cancel "
3231 "flag will not be confused with the reply message."
3235 #: ../src/guestfs.pod:1646
3237 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3238 "limit), and also files where the size is not known in advance (eg. from "
3239 "pipes or sockets). However the chunks are rather small "
3240 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3241 "to keep much in memory."
3245 #: ../src/guestfs.pod:1652
3246 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3250 #: ../src/guestfs.pod:1654
3252 "The protocol for FileOut parameters is exactly the same as for FileIn "
3253 "parameters, but with the roles of daemon and library reversed."
3257 #: ../src/guestfs.pod:1657
3260 " total length (header + ret,\n"
3261 " but not including the length word itself,\n"
3262 " and not including the chunks)\n"
3263 " struct guestfs_message_header (encoded as XDR)\n"
3264 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3265 " sequence of chunks for FileOut param #0\n"
3266 " sequence of chunks for FileOut param #1 etc.\n"
3271 #: ../src/guestfs.pod:1665
3272 msgid "INITIAL MESSAGE"
3276 #: ../src/guestfs.pod:1667
3278 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3279 "which indicates that the guest and daemon is alive. This is what "
3280 "L</guestfs_launch> waits for."
3284 #: ../src/guestfs.pod:1671
3285 msgid "PROGRESS NOTIFICATION MESSAGES"
3289 #: ../src/guestfs.pod:1673
3291 "The daemon may send progress notification messages at any time. These are "
3292 "distinguished by the normal length word being replaced by "
3293 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3297 #: ../src/guestfs.pod:1677
3299 "The library turns them into progress callbacks (see "
3300 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3301 "discards them if not."
3305 #: ../src/guestfs.pod:1681
3307 "The daemon self-limits the frequency of progress messages it sends (see "
3308 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3313 #: ../src/guestfs.pod:1685
3314 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3318 #: ../src/guestfs.pod:1687
3320 "All high-level libguestfs actions are synchronous. If you want to use "
3321 "libguestfs asynchronously then you must create a thread."
3325 #: ../src/guestfs.pod:1690
3327 "Only use the handle from a single thread. Either use the handle exclusively "
3328 "from one thread, or provide your own mutex so that two threads cannot issue "
3329 "calls on the same handle at the same time."
3333 #: ../src/guestfs.pod:1694
3335 "See the graphical program guestfs-browser for one possible architecture for "
3336 "multithreaded programs using libvirt and libguestfs."
3340 #: ../src/guestfs.pod:1697
3341 msgid "QEMU WRAPPERS"
3345 #: ../src/guestfs.pod:1699
3347 "If you want to compile your own qemu, run qemu from a non-standard location, "
3348 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3353 #: ../src/guestfs.pod:1703
3355 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3356 "last command in the shell script (so that qemu replaces the shell and "
3357 "becomes the direct child of the libguestfs-using program). If you don't do "
3358 "this, then the qemu process won't be cleaned up correctly."
3362 #: ../src/guestfs.pod:1708
3364 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3369 #: ../src/guestfs.pod:1711
3373 " qemudir=/home/rjones/d/qemu\n"
3374 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
3380 #: ../src/guestfs.pod:1715
3382 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3383 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3388 #: ../src/guestfs.pod:1719
3391 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3396 #: ../src/guestfs.pod:1721
3398 "Note that libguestfs also calls qemu with the -help and -version options in "
3399 "order to determine features."
3403 #: ../src/guestfs.pod:1724
3404 msgid "LIBGUESTFS VERSION NUMBERS"
3408 #: ../src/guestfs.pod:1726
3410 "Since April 2010, libguestfs has started to make separate development and "
3411 "stable releases, along with corresponding branches in our git repository. "
3412 "These separate releases can be identified by version number:"
3416 #: ../src/guestfs.pod:1731
3419 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3420 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3426 " | `-------- sub-version\n"
3428 " `------ always '1' because we don't change the ABI\n"
3433 #: ../src/guestfs.pod:1742
3434 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3438 #: ../src/guestfs.pod:1744
3440 "As time passes we cherry pick fixes from the development branch and backport "
3441 "those into the stable branch, the effect being that the stable branch should "
3442 "get more stable and less buggy over time. So the stable releases are ideal "
3443 "for people who don't need new features but would just like the software to "
3448 #: ../src/guestfs.pod:1750
3449 msgid "Our criteria for backporting changes are:"
3453 #: ../src/guestfs.pod:1756
3455 "Documentation changes which don't affect any code are backported unless the "
3456 "documentation refers to a future feature which is not in stable."
3460 #: ../src/guestfs.pod:1762
3462 "Bug fixes which are not controversial, fix obvious problems, and have been "
3463 "well tested are backported."
3467 #: ../src/guestfs.pod:1767
3469 "Simple rearrangements of code which shouldn't affect how it works get "
3470 "backported. This is so that the code in the two branches doesn't get too "
3471 "far out of step, allowing us to backport future fixes more easily."
3475 #: ../src/guestfs.pod:1773
3477 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3478 "exceptional case: the new feature is required in order to implement an "
3479 "important bug fix."
3483 #: ../src/guestfs.pod:1779
3485 "A new stable branch starts when we think the new features in development are "
3486 "substantial and compelling enough over the current stable branch to warrant "
3487 "it. When that happens we create new stable and development versions 1.N.0 "
3488 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3489 "stable at this point, but by backporting fixes from development, that branch "
3490 "will stabilize over time."
3494 #: ../src/guestfs.pod:1787 ../fish/guestfish.pod:867 ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330 ../tools/virt-rescue.pl:245
3495 msgid "ENVIRONMENT VARIABLES"
3499 #: ../src/guestfs.pod:1791 ../fish/guestfish.pod:893
3500 msgid "LIBGUESTFS_APPEND"
3504 #: ../src/guestfs.pod:1793 ../fish/guestfish.pod:895
3505 msgid "Pass additional options to the guest kernel."
3509 #: ../src/guestfs.pod:1795 ../fish/guestfish.pod:897
3510 msgid "LIBGUESTFS_DEBUG"
3514 #: ../src/guestfs.pod:1797
3516 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3517 "effect as calling C<guestfs_set_verbose (g, 1)>."
3521 #: ../src/guestfs.pod:1800 ../fish/guestfish.pod:902
3522 msgid "LIBGUESTFS_MEMSIZE"
3526 #: ../src/guestfs.pod:1802 ../fish/guestfish.pod:904
3527 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
3531 #: ../src/guestfs.pod:1805 ../fish/guestfish.pod:907
3534 " LIBGUESTFS_MEMSIZE=700\n"
3539 #: ../src/guestfs.pod:1807 ../fish/guestfish.pod:909
3540 msgid "LIBGUESTFS_PATH"
3544 #: ../src/guestfs.pod:1809
3546 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3547 "the discussion of paths in section PATH above."
3551 #: ../src/guestfs.pod:1812 ../fish/guestfish.pod:914
3552 msgid "LIBGUESTFS_QEMU"
3556 #: ../src/guestfs.pod:1814 ../fish/guestfish.pod:916
3558 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3559 "which was found at compile time by the configure script is used."
3563 #: ../src/guestfs.pod:1818
3564 msgid "See also L</QEMU WRAPPERS> above."
3568 #: ../src/guestfs.pod:1820 ../fish/guestfish.pod:920
3569 msgid "LIBGUESTFS_TRACE"
3573 #: ../src/guestfs.pod:1822
3575 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3576 "effect as calling C<guestfs_set_trace (g, 1)>."
3580 #: ../src/guestfs.pod:1825 ../fish/guestfish.pod:929
3585 #: ../src/guestfs.pod:1827 ../fish/guestfish.pod:931
3586 msgid "Location of temporary directory, defaults to C</tmp>."
3590 #: ../src/guestfs.pod:1829 ../fish/guestfish.pod:933
3592 "If libguestfs was compiled to use the supermin appliance then the real "
3593 "appliance is cached in this directory, shared between all handles belonging "
3594 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
3595 "use in case C</tmp> is not large enough."
3599 #: ../src/guestfs.pod:1837 ../fish/guestfish.pod:991 ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:178 ../inspector/virt-inspector.pl:884 ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:487 ../tools/virt-df.pl:614 ../tools/virt-ls.pl:235 ../tools/virt-resize.pl:1486 ../tools/virt-list-filesystems.pl:216 ../tools/virt-cat.pl:188 ../tools/virt-tar.pl:283 ../tools/virt-rescue.pl:257 ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:254
3604 #: ../src/guestfs.pod:1839
3606 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
3607 "L<virt-edit(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
3608 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
3609 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
3610 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
3614 #: ../src/guestfs.pod:1857
3616 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
3617 "L<lvm(8)>, L<disktype(1)>."
3621 #: ../src/guestfs.pod:1864 ../tools/virt-win-reg.pl:502 ../tools/virt-make-fs.pl:548
3626 #: ../src/guestfs.pod:1866
3627 msgid "To get a list of bugs against libguestfs use this link:"
3631 #: ../src/guestfs.pod:1868
3632 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
3636 #: ../src/guestfs.pod:1870
3637 msgid "To report a new bug against libguestfs use this link:"
3641 #: ../src/guestfs.pod:1872
3642 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
3646 #: ../src/guestfs.pod:1874
3647 msgid "When reporting a bug, please check:"
3651 #: ../src/guestfs.pod:1880
3652 msgid "That the bug hasn't been reported already."
3656 #: ../src/guestfs.pod:1884
3657 msgid "That you are testing a recent version."
3661 #: ../src/guestfs.pod:1888
3662 msgid "Describe the bug accurately, and give a way to reproduce it."
3666 #: ../src/guestfs.pod:1892
3668 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3673 #: ../src/guestfs.pod:1897 ../fish/guestfish.pod:1008 ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:189 ../inspector/virt-inspector.pl:893
3678 #: ../src/guestfs.pod:1899 ../fish/guestfish.pod:1010 ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:191
3679 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3683 #: ../src/guestfs.pod:1901 ../fish/guestfish.pod:1012 ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:193 ../inspector/virt-inspector.pl:899 ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:517 ../tools/virt-df.pl:627 ../tools/virt-ls.pl:250 ../tools/virt-resize.pl:1512 ../tools/virt-list-filesystems.pl:232 ../tools/virt-cat.pl:202 ../tools/virt-tar.pl:298 ../tools/virt-rescue.pl:271 ../tools/virt-make-fs.pl:563 ../tools/virt-list-partitions.pl:269
3688 #: ../src/guestfs.pod:1903 ../fish/guestfish.pod:1014
3689 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3693 #: ../src/guestfs.pod:1906
3695 "This library is free software; you can redistribute it and/or modify it "
3696 "under the terms of the GNU Lesser General Public License as published by the "
3697 "Free Software Foundation; either version 2 of the License, or (at your "
3698 "option) any later version."
3702 #: ../src/guestfs.pod:1911
3704 "This library is distributed in the hope that it will be useful, but WITHOUT "
3705 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3706 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3711 #: ../src/guestfs.pod:1916
3713 "You should have received a copy of the GNU Lesser General Public License "
3714 "along with this library; if not, write to the Free Software Foundation, "
3715 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3719 #: ../src/guestfs-actions.pod:1
3720 msgid "guestfs_add_cdrom"
3724 #: ../src/guestfs-actions.pod:3
3727 " int guestfs_add_cdrom (guestfs_h *g,\n"
3728 "\t\tconst char *filename);\n"
3733 #: ../src/guestfs-actions.pod:6 ../fish/guestfish-actions.pod:5
3734 msgid "This function adds a virtual CD-ROM disk image to the guest."
3738 #: ../src/guestfs-actions.pod:8 ../fish/guestfish-actions.pod:7
3739 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3743 #: ../src/guestfs-actions.pod:16
3745 "This call checks for the existence of C<filename>. This stops you from "
3746 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3747 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3752 #: ../src/guestfs-actions.pod:23
3754 "If you just want to add an ISO file (often you use this as an efficient way "
3755 "to transfer large files into the guest), then you should probably use "
3756 "C<guestfs_add_drive_ro> instead."
3760 #: ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:54 ../src/guestfs-actions.pod:112 ../src/guestfs-actions.pod:144 ../src/guestfs-actions.pod:155 ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:190 ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:304 ../src/guestfs-actions.pod:321 ../src/guestfs-actions.pod:332 ../src/guestfs-actions.pod:368 ../src/guestfs-actions.pod:390 ../src/guestfs-actions.pod:405 ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:496 ../src/guestfs-actions.pod:507 ../src/guestfs-actions.pod:519 ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:615 ../src/guestfs-actions.pod:626 ../src/guestfs-actions.pod:637 ../src/guestfs-actions.pod:783 ../src/guestfs-actions.pod:800 ../src/guestfs-actions.pod:815 ../src/guestfs-actions.pod:890 ../src/guestfs-actions.pod:905 ../src/guestfs-actions.pod:921 ../src/guestfs-actions.pod:932 ../src/guestfs-actions.pod:949 ../src/guestfs-actions.pod:982 ../src/guestfs-actions.pod:1040 ../src/guestfs-actions.pod:1068 ../src/guestfs-actions.pod:1090 ../src/guestfs-actions.pod:1121 ../src/guestfs-actions.pod:1209 ../src/guestfs-actions.pod:1240 ../src/guestfs-actions.pod:1440 ../src/guestfs-actions.pod:1459 ../src/guestfs-actions.pod:1540 ../src/guestfs-actions.pod:1888 ../src/guestfs-actions.pod:2011 ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2096 ../src/guestfs-actions.pod:2505 ../src/guestfs-actions.pod:2517 ../src/guestfs-actions.pod:2534 ../src/guestfs-actions.pod:2642 ../src/guestfs-actions.pod:2653 ../src/guestfs-actions.pod:2663 ../src/guestfs-actions.pod:2674 ../src/guestfs-actions.pod:2686 ../src/guestfs-actions.pod:2716 ../src/guestfs-actions.pod:2780 ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:2811 ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:2851 ../src/guestfs-actions.pod:2880 ../src/guestfs-actions.pod:2896 ../src/guestfs-actions.pod:2912 ../src/guestfs-actions.pod:2924 ../src/guestfs-actions.pod:2933 ../src/guestfs-actions.pod:2966 ../src/guestfs-actions.pod:2979 ../src/guestfs-actions.pod:2989 ../src/guestfs-actions.pod:3001 ../src/guestfs-actions.pod:3015 ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:3112 ../src/guestfs-actions.pod:3122 ../src/guestfs-actions.pod:3167 ../src/guestfs-actions.pod:3182 ../src/guestfs-actions.pod:3197 ../src/guestfs-actions.pod:3210 ../src/guestfs-actions.pod:3221 ../src/guestfs-actions.pod:3232 ../src/guestfs-actions.pod:3246 ../src/guestfs-actions.pod:3258 ../src/guestfs-actions.pod:3275 ../src/guestfs-actions.pod:3306 ../src/guestfs-actions.pod:3334 ../src/guestfs-actions.pod:3350 ../src/guestfs-actions.pod:3366 ../src/guestfs-actions.pod:3375 ../src/guestfs-actions.pod:3389 ../src/guestfs-actions.pod:3399 ../src/guestfs-actions.pod:3411 ../src/guestfs-actions.pod:3423 ../src/guestfs-actions.pod:3455 ../src/guestfs-actions.pod:3467 ../src/guestfs-actions.pod:3484 ../src/guestfs-actions.pod:3495 ../src/guestfs-actions.pod:3509 ../src/guestfs-actions.pod:3549 ../src/guestfs-actions.pod:3580 ../src/guestfs-actions.pod:3591 ../src/guestfs-actions.pod:3616 ../src/guestfs-actions.pod:3630 ../src/guestfs-actions.pod:3645 ../src/guestfs-actions.pod:3767 ../src/guestfs-actions.pod:3819 ../src/guestfs-actions.pod:3838 ../src/guestfs-actions.pod:3853 ../src/guestfs-actions.pod:3879 ../src/guestfs-actions.pod:3936 ../src/guestfs-actions.pod:3950 ../src/guestfs-actions.pod:3960 ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:4226 ../src/guestfs-actions.pod:4242 ../src/guestfs-actions.pod:4253 ../src/guestfs-actions.pod:4262 ../src/guestfs-actions.pod:4273 ../src/guestfs-actions.pod:4282 ../src/guestfs-actions.pod:4293 ../src/guestfs-actions.pod:4306 ../src/guestfs-actions.pod:4324 ../src/guestfs-actions.pod:4340 ../src/guestfs-actions.pod:4356 ../src/guestfs-actions.pod:4371 ../src/guestfs-actions.pod:4391 ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4422 ../src/guestfs-actions.pod:4440 ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:4470 ../src/guestfs-actions.pod:4495 ../src/guestfs-actions.pod:4516 ../src/guestfs-actions.pod:4532 ../src/guestfs-actions.pod:4553 ../src/guestfs-actions.pod:4565 ../src/guestfs-actions.pod:4577 ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4627 ../src/guestfs-actions.pod:4647 ../src/guestfs-actions.pod:4670 ../src/guestfs-actions.pod:4760 ../src/guestfs-actions.pod:4866 ../src/guestfs-actions.pod:4875 ../src/guestfs-actions.pod:4885 ../src/guestfs-actions.pod:4895 ../src/guestfs-actions.pod:4914 ../src/guestfs-actions.pod:4924 ../src/guestfs-actions.pod:4934 ../src/guestfs-actions.pod:4944 ../src/guestfs-actions.pod:4956 ../src/guestfs-actions.pod:5006 ../src/guestfs-actions.pod:5020 ../src/guestfs-actions.pod:5033 ../src/guestfs-actions.pod:5046 ../src/guestfs-actions.pod:5060 ../src/guestfs-actions.pod:5070 ../src/guestfs-actions.pod:5087 ../src/guestfs-actions.pod:5117 ../src/guestfs-actions.pod:5128 ../src/guestfs-actions.pod:5163 ../src/guestfs-actions.pod:5173 ../src/guestfs-actions.pod:5188 ../src/guestfs-actions.pod:5214 ../src/guestfs-actions.pod:5242 ../src/guestfs-actions.pod:5346 ../src/guestfs-actions.pod:5361 ../src/guestfs-actions.pod:5372 ../src/guestfs-actions.pod:5418 ../src/guestfs-actions.pod:5428 ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:5492 ../src/guestfs-actions.pod:5534 ../src/guestfs-actions.pod:5557 ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:5630 ../src/guestfs-actions.pod:5656
3761 msgid "This function returns 0 on success or -1 on error."
3765 #: ../src/guestfs-actions.pod:31 ../src/guestfs-actions.pod:157 ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:117 ../fish/guestfish-actions.pod:131
3767 "This function is deprecated. In new code, use the C<add_drive_opts> call "
3772 #: ../src/guestfs-actions.pod:34 ../src/guestfs-actions.pod:160 ../src/guestfs-actions.pod:178 ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1649 ../src/guestfs-actions.pod:1667 ../src/guestfs-actions.pod:5565 ../src/guestfs-actions.pod:5710 ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:120 ../fish/guestfish-actions.pod:134 ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:1297 ../fish/guestfish-actions.pod:1311 ../fish/guestfish-actions.pod:4289 ../fish/guestfish-actions.pod:4386
3774 "Deprecated functions will not be removed from the API, but the fact that "
3775 "they are deprecated indicates that there are problems with correct use of "
3780 #: ../src/guestfs-actions.pod:38
3781 msgid "guestfs_add_drive"
3785 #: ../src/guestfs-actions.pod:40
3788 " int guestfs_add_drive (guestfs_h *g,\n"
3789 "\t\tconst char *filename);\n"
3794 #: ../src/guestfs-actions.pod:43
3796 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
3797 "optional parameters, so the disk is added writable, with the format being "
3798 "detected automatically."
3802 #: ../src/guestfs-actions.pod:47
3804 "Automatic detection of the format opens you up to a potential security hole "
3805 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3806 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
3807 "you should think about replacing calls to this function with calls to "
3808 "C<guestfs_add_drive_opts>, and specifying the format."
3812 #: ../src/guestfs-actions.pod:56
3813 msgid "guestfs_add_drive_opts"
3817 #: ../src/guestfs-actions.pod:58
3820 " int guestfs_add_drive_opts (guestfs_h *g,\n"
3821 "\t\tconst char *filename,\n"
3827 #: ../src/guestfs-actions.pod:62
3829 "You may supply a list of optional arguments to this call. Use zero or more "
3830 "of the following pairs of parameters, and terminate the list with C<-1> on "
3831 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
3835 #: ../src/guestfs-actions.pod:67
3838 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
3839 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
3840 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
3845 #: ../src/guestfs-actions.pod:71 ../fish/guestfish-actions.pod:56
3847 "This function adds a virtual machine disk image C<filename> to libguestfs. "
3848 "The first time you call this function, the disk appears as C</dev/sda>, the "
3849 "second time as C</dev/sdb>, and so on."
3853 #: ../src/guestfs-actions.pod:76 ../fish/guestfish-actions.pod:61
3855 "You don't necessarily need to be root when using libguestfs. However you "
3856 "obviously do need sufficient permissions to access the filename for whatever "
3857 "operations you want to perform (ie. read access if you just want to read the "
3858 "image or write access if you want to modify the image)."
3862 #: ../src/guestfs-actions.pod:82 ../fish/guestfish-actions.pod:67
3863 msgid "This call checks that C<filename> exists."
3867 #: ../src/guestfs-actions.pod:84 ../fish/guestfish-actions.pod:69
3868 msgid "The optional arguments are:"
3872 #: ../src/guestfs-actions.pod:88 ../fish/guestfish-actions.pod:73
3877 #: ../src/guestfs-actions.pod:90 ../fish/guestfish-actions.pod:75
3879 "If true then the image is treated as read-only. Writes are still allowed, "
3880 "but they are stored in a temporary snapshot overlay which is discarded at "
3881 "the end. The disk that you add is not modified."
3885 #: ../src/guestfs-actions.pod:94 ../fish/guestfish-actions.pod:79
3890 #: ../src/guestfs-actions.pod:96
3892 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
3893 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
3894 "Possible formats include C<raw> and C<qcow2>."
3898 #: ../src/guestfs-actions.pod:100 ../fish/guestfish-actions.pod:85
3900 "Automatic detection of the format opens you up to a potential security hole "
3901 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3902 "RHBZ#642934. Specifying the format closes this security hole."
3906 #: ../src/guestfs-actions.pod:105 ../fish/guestfish-actions.pod:90
3911 #: ../src/guestfs-actions.pod:107
3913 "This rarely-used option lets you emulate the behaviour of the deprecated "
3914 "C<guestfs_add_drive_with_if> call (q.v.)"
3918 #: ../src/guestfs-actions.pod:114
3919 msgid "guestfs_add_drive_opts_va"
3923 #: ../src/guestfs-actions.pod:116
3926 " int guestfs_add_drive_opts_va (guestfs_h *g,\n"
3927 "\t\tconst char *filename,\n"
3928 "\t\tva_list args);\n"
3933 #: ../src/guestfs-actions.pod:120
3934 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
3938 #: ../src/guestfs-actions.pod:122 ../src/guestfs-actions.pod:132
3939 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
3943 #: ../src/guestfs-actions.pod:124
3944 msgid "guestfs_add_drive_opts_argv"
3948 #: ../src/guestfs-actions.pod:126
3951 " int guestfs_add_drive_opts_argv (guestfs_h *g,\n"
3952 "\t\tconst char *filename,\n"
3953 "\t\tconst struct guestfs_add_drive_opts_argv *optargs);\n"
3958 #: ../src/guestfs-actions.pod:130
3959 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
3963 #: ../src/guestfs-actions.pod:134
3964 msgid "guestfs_add_drive_ro"
3968 #: ../src/guestfs-actions.pod:136
3971 " int guestfs_add_drive_ro (guestfs_h *g,\n"
3972 "\t\tconst char *filename);\n"
3977 #: ../src/guestfs-actions.pod:139
3979 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
3980 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
3981 "disk is added read-only, with the format being detected automatically."
3985 #: ../src/guestfs-actions.pod:146
3986 msgid "guestfs_add_drive_ro_with_if"
3990 #: ../src/guestfs-actions.pod:148
3993 " int guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
3994 "\t\tconst char *filename,\n"
3995 "\t\tconst char *iface);\n"
4000 #: ../src/guestfs-actions.pod:152
4002 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4003 "QEMU interface emulation to use at run time."
4007 #: ../src/guestfs-actions.pod:164
4008 msgid "guestfs_add_drive_with_if"
4012 #: ../src/guestfs-actions.pod:166
4015 " int guestfs_add_drive_with_if (guestfs_h *g,\n"
4016 "\t\tconst char *filename,\n"
4017 "\t\tconst char *iface);\n"
4022 #: ../src/guestfs-actions.pod:170
4024 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4025 "QEMU interface emulation to use at run time."
4029 #: ../src/guestfs-actions.pod:182
4030 msgid "guestfs_aug_clear"
4034 #: ../src/guestfs-actions.pod:184
4037 " int guestfs_aug_clear (guestfs_h *g,\n"
4038 "\t\tconst char *augpath);\n"
4043 #: ../src/guestfs-actions.pod:187 ../fish/guestfish-actions.pod:142
4045 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4046 "L<augtool(1)> C<clear> command."
4050 #: ../src/guestfs-actions.pod:192
4051 msgid "guestfs_aug_close"
4055 #: ../src/guestfs-actions.pod:194
4058 " int guestfs_aug_close (guestfs_h *g);\n"
4063 #: ../src/guestfs-actions.pod:196
4065 "Close the current Augeas handle and free up any resources used by it. After "
4066 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4067 "any other Augeas functions."
4071 #: ../src/guestfs-actions.pod:203
4072 msgid "guestfs_aug_defnode"
4076 #: ../src/guestfs-actions.pod:205
4079 " struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,\n"
4080 "\t\tconst char *name,\n"
4081 "\t\tconst char *expr,\n"
4082 "\t\tconst char *val);\n"
4087 #: ../src/guestfs-actions.pod:210 ../fish/guestfish-actions.pod:158
4088 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4092 #: ../src/guestfs-actions.pod:213
4094 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4095 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4096 "containing that single node."
4100 #: ../src/guestfs-actions.pod:217 ../fish/guestfish-actions.pod:165
4102 "On success this returns a pair containing the number of nodes in the "
4103 "nodeset, and a boolean flag if a node was created."
4107 #: ../src/guestfs-actions.pod:221
4109 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4110 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4114 #: ../src/guestfs-actions.pod:225
4115 msgid "guestfs_aug_defvar"
4119 #: ../src/guestfs-actions.pod:227
4122 " int guestfs_aug_defvar (guestfs_h *g,\n"
4123 "\t\tconst char *name,\n"
4124 "\t\tconst char *expr);\n"
4129 #: ../src/guestfs-actions.pod:231 ../fish/guestfish-actions.pod:173
4131 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4132 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4136 #: ../src/guestfs-actions.pod:235 ../fish/guestfish-actions.pod:177
4138 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4139 "evaluates to something which is not a nodeset."
4143 #: ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:379 ../src/guestfs-actions.pod:533 ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:573 ../src/guestfs-actions.pod:589 ../src/guestfs-actions.pod:1107 ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1604 ../src/guestfs-actions.pod:1685 ../src/guestfs-actions.pod:1716 ../src/guestfs-actions.pod:1759 ../src/guestfs-actions.pod:1776 ../src/guestfs-actions.pod:2001 ../src/guestfs-actions.pod:2213 ../src/guestfs-actions.pod:2231 ../src/guestfs-actions.pod:3569 ../src/guestfs-actions.pod:3676 ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4053 ../src/guestfs-actions.pod:5152 ../src/guestfs-actions.pod:5502 ../src/guestfs-actions.pod:5512 ../src/guestfs-actions.pod:5522
4144 msgid "On error this function returns -1."
4148 #: ../src/guestfs-actions.pod:240
4149 msgid "guestfs_aug_get"
4153 #: ../src/guestfs-actions.pod:242
4156 " char *guestfs_aug_get (guestfs_h *g,\n"
4157 "\t\tconst char *augpath);\n"
4162 #: ../src/guestfs-actions.pod:245 ../fish/guestfish-actions.pod:184
4164 "Look up the value associated with C<path>. If C<path> matches exactly one "
4165 "node, the C<value> is returned."
4169 #: ../src/guestfs-actions.pod:248 ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:691 ../src/guestfs-actions.pod:748 ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:852 ../src/guestfs-actions.pod:965 ../src/guestfs-actions.pod:994 ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:1135 ../src/guestfs-actions.pod:1299 ../src/guestfs-actions.pod:1408 ../src/guestfs-actions.pod:1553 ../src/guestfs-actions.pod:1567 ../src/guestfs-actions.pod:1643 ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1795 ../src/guestfs-actions.pod:1934 ../src/guestfs-actions.pod:2115 ../src/guestfs-actions.pod:2165 ../src/guestfs-actions.pod:2281 ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2631 ../src/guestfs-actions.pod:3052 ../src/guestfs-actions.pod:3148 ../src/guestfs-actions.pod:3691 ../src/guestfs-actions.pod:3867 ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4169 ../src/guestfs-actions.pod:4212 ../src/guestfs-actions.pod:4688 ../src/guestfs-actions.pod:4701 ../src/guestfs-actions.pod:4715 ../src/guestfs-actions.pod:4736 ../src/guestfs-actions.pod:5295 ../src/guestfs-actions.pod:5311 ../src/guestfs-actions.pod:5326 ../src/guestfs-actions.pod:5474 ../src/guestfs-actions.pod:5704
4171 "This function returns a string, or NULL on error. I<The caller must free "
4172 "the returned string after use>."
4176 #: ../src/guestfs-actions.pod:251
4177 msgid "guestfs_aug_init"
4181 #: ../src/guestfs-actions.pod:253
4184 " int guestfs_aug_init (guestfs_h *g,\n"
4185 "\t\tconst char *root,\n"
4191 #: ../src/guestfs-actions.pod:257 ../fish/guestfish-actions.pod:191
4193 "Create a new Augeas handle for editing configuration files. If there was "
4194 "any previous Augeas handle associated with this guestfs session, then it is "
4199 #: ../src/guestfs-actions.pod:261
4200 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4204 #: ../src/guestfs-actions.pod:264 ../fish/guestfish-actions.pod:198
4205 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4209 #: ../src/guestfs-actions.pod:267 ../fish/guestfish-actions.pod:201
4211 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4212 "logical I<or> of the following integers:"
4216 #: ../src/guestfs-actions.pod:273 ../fish/guestfish-actions.pod:207
4217 msgid "C<AUG_SAVE_BACKUP> = 1"
4221 #: ../src/guestfs-actions.pod:275 ../fish/guestfish-actions.pod:209
4222 msgid "Keep the original file with a C<.augsave> extension."
4226 #: ../src/guestfs-actions.pod:277 ../fish/guestfish-actions.pod:211
4227 msgid "C<AUG_SAVE_NEWFILE> = 2"
4231 #: ../src/guestfs-actions.pod:279 ../fish/guestfish-actions.pod:213
4233 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4234 "original. Overrides C<AUG_SAVE_BACKUP>."
4238 #: ../src/guestfs-actions.pod:282 ../fish/guestfish-actions.pod:216
4239 msgid "C<AUG_TYPE_CHECK> = 4"
4243 #: ../src/guestfs-actions.pod:284 ../fish/guestfish-actions.pod:218
4244 msgid "Typecheck lenses (can be expensive)."
4248 #: ../src/guestfs-actions.pod:286 ../fish/guestfish-actions.pod:220
4249 msgid "C<AUG_NO_STDINC> = 8"
4253 #: ../src/guestfs-actions.pod:288 ../fish/guestfish-actions.pod:222
4254 msgid "Do not use standard load path for modules."
4258 #: ../src/guestfs-actions.pod:290 ../fish/guestfish-actions.pod:224
4259 msgid "C<AUG_SAVE_NOOP> = 16"
4263 #: ../src/guestfs-actions.pod:292 ../fish/guestfish-actions.pod:226
4264 msgid "Make save a no-op, just record what would have been changed."
4268 #: ../src/guestfs-actions.pod:294 ../fish/guestfish-actions.pod:228
4269 msgid "C<AUG_NO_LOAD> = 32"
4273 #: ../src/guestfs-actions.pod:296
4274 msgid "Do not load the tree in C<guestfs_aug_init>."
4278 #: ../src/guestfs-actions.pod:300
4279 msgid "To close the handle, you can call C<guestfs_aug_close>."
4283 #: ../src/guestfs-actions.pod:302 ../fish/guestfish-actions.pod:236
4284 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4288 #: ../src/guestfs-actions.pod:306
4289 msgid "guestfs_aug_insert"
4293 #: ../src/guestfs-actions.pod:308
4296 " int guestfs_aug_insert (guestfs_h *g,\n"
4297 "\t\tconst char *augpath,\n"
4298 "\t\tconst char *label,\n"
4299 "\t\tint before);\n"
4304 #: ../src/guestfs-actions.pod:313 ../fish/guestfish-actions.pod:242
4306 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4307 "or after C<path> (depending on the boolean flag C<before>)."
4311 #: ../src/guestfs-actions.pod:317 ../fish/guestfish-actions.pod:246
4313 "C<path> must match exactly one existing node in the tree, and C<label> must "
4314 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4318 #: ../src/guestfs-actions.pod:323
4319 msgid "guestfs_aug_load"
4323 #: ../src/guestfs-actions.pod:325
4326 " int guestfs_aug_load (guestfs_h *g);\n"
4331 #: ../src/guestfs-actions.pod:327 ../fish/guestfish-actions.pod:254
4332 msgid "Load files into the tree."
4336 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:256
4337 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4341 #: ../src/guestfs-actions.pod:334
4342 msgid "guestfs_aug_ls"
4346 #: ../src/guestfs-actions.pod:336
4349 " char **guestfs_aug_ls (guestfs_h *g,\n"
4350 "\t\tconst char *augpath);\n"
4355 #: ../src/guestfs-actions.pod:339
4357 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
4358 "sorting the resulting nodes into alphabetical order."
4362 #: ../src/guestfs-actions.pod:342 ../src/guestfs-actions.pod:355 ../src/guestfs-actions.pod:483 ../src/guestfs-actions.pod:868 ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1163 ../src/guestfs-actions.pod:1251 ../src/guestfs-actions.pod:1267 ../src/guestfs-actions.pod:1498 ../src/guestfs-actions.pod:1832 ../src/guestfs-actions.pod:1845 ../src/guestfs-actions.pod:1861 ../src/guestfs-actions.pod:1898 ../src/guestfs-actions.pod:1919 ../src/guestfs-actions.pod:1981 ../src/guestfs-actions.pod:2021 ../src/guestfs-actions.pod:2187 ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:2560 ../src/guestfs-actions.pod:2616 ../src/guestfs-actions.pod:2700 ../src/guestfs-actions.pod:3029 ../src/guestfs-actions.pod:3536 ../src/guestfs-actions.pod:3985 ../src/guestfs-actions.pod:4094 ../src/guestfs-actions.pod:4200 ../src/guestfs-actions.pod:4749 ../src/guestfs-actions.pod:4798 ../src/guestfs-actions.pod:4850 ../src/guestfs-actions.pod:4966 ../src/guestfs-actions.pod:4987 ../src/guestfs-actions.pod:5387 ../src/guestfs-actions.pod:5404 ../src/guestfs-actions.pod:5442 ../src/guestfs-actions.pod:5578 ../src/guestfs-actions.pod:5594 ../src/guestfs-actions.pod:5667 ../src/guestfs-actions.pod:5683 ../src/guestfs-actions.pod:5723 ../src/guestfs-actions.pod:5739
4364 "This function returns a NULL-terminated array of strings (like "
4365 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
4366 "strings and the array after use>."
4370 #: ../src/guestfs-actions.pod:346
4371 msgid "guestfs_aug_match"
4375 #: ../src/guestfs-actions.pod:348
4378 " char **guestfs_aug_match (guestfs_h *g,\n"
4379 "\t\tconst char *augpath);\n"
4384 #: ../src/guestfs-actions.pod:351 ../fish/guestfish-actions.pod:270
4386 "Returns a list of paths which match the path expression C<path>. The "
4387 "returned paths are sufficiently qualified so that they match exactly one "
4388 "node in the current tree."
4392 #: ../src/guestfs-actions.pod:359
4393 msgid "guestfs_aug_mv"
4397 #: ../src/guestfs-actions.pod:361
4400 " int guestfs_aug_mv (guestfs_h *g,\n"
4401 "\t\tconst char *src,\n"
4402 "\t\tconst char *dest);\n"
4407 #: ../src/guestfs-actions.pod:365 ../fish/guestfish-actions.pod:278
4409 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4410 "C<dest> is overwritten if it exists."
4414 #: ../src/guestfs-actions.pod:370
4415 msgid "guestfs_aug_rm"
4419 #: ../src/guestfs-actions.pod:372
4422 " int guestfs_aug_rm (guestfs_h *g,\n"
4423 "\t\tconst char *augpath);\n"
4428 #: ../src/guestfs-actions.pod:375 ../fish/guestfish-actions.pod:285
4429 msgid "Remove C<path> and all of its children."
4433 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:287
4434 msgid "On success this returns the number of entries which were removed."
4438 #: ../src/guestfs-actions.pod:381
4439 msgid "guestfs_aug_save"
4443 #: ../src/guestfs-actions.pod:383
4446 " int guestfs_aug_save (guestfs_h *g);\n"
4451 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:293
4452 msgid "This writes all pending changes to disk."
4456 #: ../src/guestfs-actions.pod:387
4458 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4463 #: ../src/guestfs-actions.pod:392
4464 msgid "guestfs_aug_set"
4468 #: ../src/guestfs-actions.pod:394
4471 " int guestfs_aug_set (guestfs_h *g,\n"
4472 "\t\tconst char *augpath,\n"
4473 "\t\tconst char *val);\n"
4478 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:302
4479 msgid "Set the value associated with C<path> to C<val>."
4483 #: ../src/guestfs-actions.pod:400
4485 "In the Augeas API, it is possible to clear a node by setting the value to "
4486 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4487 "this call. Instead you must use the C<guestfs_aug_clear> call."
4491 #: ../src/guestfs-actions.pod:407
4492 msgid "guestfs_available"
4496 #: ../src/guestfs-actions.pod:409
4499 " int guestfs_available (guestfs_h *g,\n"
4500 "\t\tchar *const *groups);\n"
4505 #: ../src/guestfs-actions.pod:412 ../fish/guestfish-actions.pod:313
4507 "This command is used to check the availability of some groups of "
4508 "functionality in the appliance, which not all builds of the libguestfs "
4509 "appliance will be able to provide."
4513 #: ../src/guestfs-actions.pod:416
4515 "The libguestfs groups, and the functions that those groups correspond to, "
4516 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4517 "runtime by calling C<guestfs_available_all_groups>."
4521 #: ../src/guestfs-actions.pod:421 ../fish/guestfish-actions.pod:322
4523 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4524 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4525 "and Augeas (configuration file editing) functions."
4529 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:327
4530 msgid "The command returns no error if I<all> requested groups are available."
4534 #: ../src/guestfs-actions.pod:428 ../fish/guestfish-actions.pod:329
4536 "It fails with an error if one or more of the requested groups is unavailable "
4541 #: ../src/guestfs-actions.pod:431 ../fish/guestfish-actions.pod:332
4543 "If an unknown group name is included in the list of groups then an error is "
4548 #: ../src/guestfs-actions.pod:434 ../fish/guestfish-actions.pod:335
4553 #: ../src/guestfs-actions.pod:440
4554 msgid "You must call C<guestfs_launch> before calling this function."
4558 #: ../src/guestfs-actions.pod:442 ../fish/guestfish-actions.pod:343
4560 "The reason is because we don't know what groups are supported by the "
4561 "appliance/daemon until it is running and can be queried."
4565 #: ../src/guestfs-actions.pod:448 ../fish/guestfish-actions.pod:349
4567 "If a group of functions is available, this does not necessarily mean that "
4568 "they will work. You still have to check for errors when calling individual "
4569 "API functions even if they are available."
4573 #: ../src/guestfs-actions.pod:455 ../fish/guestfish-actions.pod:356
4575 "It is usually the job of distro packagers to build complete functionality "
4576 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4577 "with all requirements satisfied, will support everything."
4581 #: ../src/guestfs-actions.pod:462
4583 "This call was added in version C<1.0.80>. In previous versions of "
4584 "libguestfs all you could do would be to speculatively execute a command to "
4585 "find out if the daemon implemented it. See also C<guestfs_version>."
4589 #: ../src/guestfs-actions.pod:471
4590 msgid "guestfs_available_all_groups"
4594 #: ../src/guestfs-actions.pod:473
4597 " char **guestfs_available_all_groups (guestfs_h *g);\n"
4602 #: ../src/guestfs-actions.pod:475
4604 "This command returns a list of all optional groups that this daemon knows "
4605 "about. Note this returns both supported and unsupported groups. To find "
4606 "out which ones the daemon can actually support you have to call "
4607 "C<guestfs_available> on each member of the returned list."
4611 #: ../src/guestfs-actions.pod:481
4612 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4616 #: ../src/guestfs-actions.pod:487
4617 msgid "guestfs_base64_in"
4621 #: ../src/guestfs-actions.pod:489
4624 " int guestfs_base64_in (guestfs_h *g,\n"
4625 "\t\tconst char *base64file,\n"
4626 "\t\tconst char *filename);\n"
4631 #: ../src/guestfs-actions.pod:493 ../fish/guestfish-actions.pod:386
4632 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4636 #: ../src/guestfs-actions.pod:498
4637 msgid "guestfs_base64_out"
4641 #: ../src/guestfs-actions.pod:500
4644 " int guestfs_base64_out (guestfs_h *g,\n"
4645 "\t\tconst char *filename,\n"
4646 "\t\tconst char *base64file);\n"
4651 #: ../src/guestfs-actions.pod:504 ../fish/guestfish-actions.pod:395
4653 "This command downloads the contents of C<filename>, writing it out to local "
4654 "file C<base64file> encoded as base64."
4658 #: ../src/guestfs-actions.pod:509
4659 msgid "guestfs_blockdev_flushbufs"
4663 #: ../src/guestfs-actions.pod:511
4666 " int guestfs_blockdev_flushbufs (guestfs_h *g,\n"
4667 "\t\tconst char *device);\n"
4672 #: ../src/guestfs-actions.pod:514 ../fish/guestfish-actions.pod:404
4673 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4677 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:543 ../src/guestfs-actions.pod:556 ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:587 ../src/guestfs-actions.pod:598 ../src/guestfs-actions.pod:613 ../src/guestfs-actions.pod:624 ../src/guestfs-actions.pod:635 ../fish/guestfish-actions.pod:407 ../fish/guestfish-actions.pod:418 ../fish/guestfish-actions.pod:427 ../fish/guestfish-actions.pod:437 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:462 ../fish/guestfish-actions.pod:470 ../fish/guestfish-actions.pod:481 ../fish/guestfish-actions.pod:489 ../fish/guestfish-actions.pod:497
4678 msgid "This uses the L<blockdev(8)> command."
4682 #: ../src/guestfs-actions.pod:521
4683 msgid "guestfs_blockdev_getbsz"
4687 #: ../src/guestfs-actions.pod:523
4690 " int guestfs_blockdev_getbsz (guestfs_h *g,\n"
4691 "\t\tconst char *device);\n"
4696 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:413
4697 msgid "This returns the block size of a device."
4701 #: ../src/guestfs-actions.pod:528 ../src/guestfs-actions.pod:610 ../fish/guestfish-actions.pod:415 ../fish/guestfish-actions.pod:478
4703 "(Note this is different from both I<size in blocks> and I<filesystem block "
4708 #: ../src/guestfs-actions.pod:535
4709 msgid "guestfs_blockdev_getro"
4713 #: ../src/guestfs-actions.pod:537
4716 " int guestfs_blockdev_getro (guestfs_h *g,\n"
4717 "\t\tconst char *device);\n"
4722 #: ../src/guestfs-actions.pod:540 ../fish/guestfish-actions.pod:424
4724 "Returns a boolean indicating if the block device is read-only (true if "
4725 "read-only, false if not)."
4729 #: ../src/guestfs-actions.pod:545 ../src/guestfs-actions.pod:1181 ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1693 ../src/guestfs-actions.pod:1736 ../src/guestfs-actions.pod:1748 ../src/guestfs-actions.pod:1767 ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:2369 ../src/guestfs-actions.pod:2380 ../src/guestfs-actions.pod:2392 ../src/guestfs-actions.pod:2403 ../src/guestfs-actions.pod:2416 ../src/guestfs-actions.pod:2428 ../src/guestfs-actions.pod:2441 ../src/guestfs-actions.pod:2452 ../src/guestfs-actions.pod:2462 ../src/guestfs-actions.pod:2473 ../src/guestfs-actions.pod:2485 ../src/guestfs-actions.pod:2497 ../src/guestfs-actions.pod:3661
4730 msgid "This function returns a C truth value on success or -1 on error."
4734 #: ../src/guestfs-actions.pod:547
4735 msgid "guestfs_blockdev_getsize64"
4739 #: ../src/guestfs-actions.pod:549
4742 " int64_t guestfs_blockdev_getsize64 (guestfs_h *g,\n"
4743 "\t\tconst char *device);\n"
4748 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:433
4749 msgid "This returns the size of the device in bytes."
4753 #: ../src/guestfs-actions.pod:554
4754 msgid "See also C<guestfs_blockdev_getsz>."
4758 #: ../src/guestfs-actions.pod:560
4759 msgid "guestfs_blockdev_getss"
4763 #: ../src/guestfs-actions.pod:562
4766 " int guestfs_blockdev_getss (guestfs_h *g,\n"
4767 "\t\tconst char *device);\n"
4772 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:443
4774 "This returns the size of sectors on a block device. Usually 512, but can be "
4775 "larger for modern devices."
4779 #: ../src/guestfs-actions.pod:568
4781 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
4786 #: ../src/guestfs-actions.pod:575
4787 msgid "guestfs_blockdev_getsz"
4791 #: ../src/guestfs-actions.pod:577
4794 " int64_t guestfs_blockdev_getsz (guestfs_h *g,\n"
4795 "\t\tconst char *device);\n"
4800 #: ../src/guestfs-actions.pod:580 ../fish/guestfish-actions.pod:455
4802 "This returns the size of the device in units of 512-byte sectors (even if "
4803 "the sectorsize isn't 512 bytes ... weird)."
4807 #: ../src/guestfs-actions.pod:583
4809 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
4810 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
4814 #: ../src/guestfs-actions.pod:591
4815 msgid "guestfs_blockdev_rereadpt"
4819 #: ../src/guestfs-actions.pod:593
4822 " int guestfs_blockdev_rereadpt (guestfs_h *g,\n"
4823 "\t\tconst char *device);\n"
4828 #: ../src/guestfs-actions.pod:596 ../fish/guestfish-actions.pod:468
4829 msgid "Reread the partition table on C<device>."
4833 #: ../src/guestfs-actions.pod:602
4834 msgid "guestfs_blockdev_setbsz"
4838 #: ../src/guestfs-actions.pod:604
4841 " int guestfs_blockdev_setbsz (guestfs_h *g,\n"
4842 "\t\tconst char *device,\n"
4843 "\t\tint blocksize);\n"
4848 #: ../src/guestfs-actions.pod:608 ../fish/guestfish-actions.pod:476
4849 msgid "This sets the block size of a device."
4853 #: ../src/guestfs-actions.pod:617
4854 msgid "guestfs_blockdev_setro"
4858 #: ../src/guestfs-actions.pod:619
4861 " int guestfs_blockdev_setro (guestfs_h *g,\n"
4862 "\t\tconst char *device);\n"
4867 #: ../src/guestfs-actions.pod:622 ../fish/guestfish-actions.pod:487
4868 msgid "Sets the block device named C<device> to read-only."
4872 #: ../src/guestfs-actions.pod:628
4873 msgid "guestfs_blockdev_setrw"
4877 #: ../src/guestfs-actions.pod:630
4880 " int guestfs_blockdev_setrw (guestfs_h *g,\n"
4881 "\t\tconst char *device);\n"
4886 #: ../src/guestfs-actions.pod:633 ../fish/guestfish-actions.pod:495
4887 msgid "Sets the block device named C<device> to read-write."
4891 #: ../src/guestfs-actions.pod:639
4892 msgid "guestfs_case_sensitive_path"
4896 #: ../src/guestfs-actions.pod:641
4899 " char *guestfs_case_sensitive_path (guestfs_h *g,\n"
4900 "\t\tconst char *path);\n"
4905 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:503
4907 "This can be used to resolve case insensitive paths on a filesystem which is "
4908 "case sensitive. The use case is to resolve paths which you have read from "
4909 "Windows configuration files or the Windows Registry, to the true path."
4913 #: ../src/guestfs-actions.pod:649 ../fish/guestfish-actions.pod:508
4915 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4916 "(and probably others), which is that although the underlying filesystem is "
4917 "case-insensitive, the driver exports the filesystem to Linux as "
4922 #: ../src/guestfs-actions.pod:654 ../fish/guestfish-actions.pod:513
4924 "One consequence of this is that special directories such as C<c:\\windows> "
4925 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4926 "precise details of how they were created. In Windows itself this would not "
4931 #: ../src/guestfs-actions.pod:660 ../fish/guestfish-actions.pod:519
4933 "Bug or feature? You decide: "
4934 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
4938 #: ../src/guestfs-actions.pod:663 ../fish/guestfish-actions.pod:522
4940 "This function resolves the true case of each element in the path and returns "
4941 "the case-sensitive path."
4945 #: ../src/guestfs-actions.pod:666
4947 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
4948 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4949 "how the directories were originally created under Windows)."
4953 #: ../src/guestfs-actions.pod:671 ../fish/guestfish-actions.pod:530
4954 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4958 #: ../src/guestfs-actions.pod:674
4959 msgid "See also C<guestfs_realpath>."
4963 #: ../src/guestfs-actions.pod:679
4968 #: ../src/guestfs-actions.pod:681
4971 " char *guestfs_cat (guestfs_h *g,\n"
4972 "\t\tconst char *path);\n"
4977 #: ../src/guestfs-actions.pod:684 ../src/guestfs-actions.pod:4084 ../fish/guestfish-actions.pod:539 ../fish/guestfish-actions.pod:3133
4978 msgid "Return the contents of the file named C<path>."
4982 #: ../src/guestfs-actions.pod:686
4984 "Note that this function cannot correctly handle binary files (specifically, "
4985 "files containing C<\\0> character which is treated as end of string). For "
4986 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
4987 "functions which have a more complex interface."
4991 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:855 ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:1151 ../src/guestfs-actions.pod:1167 ../src/guestfs-actions.pod:1255 ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:1502 ../src/guestfs-actions.pod:1849 ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1923 ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:3901 ../src/guestfs-actions.pod:3924 ../src/guestfs-actions.pod:4032 ../src/guestfs-actions.pod:4055 ../src/guestfs-actions.pod:4076 ../src/guestfs-actions.pod:4802 ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:4970 ../src/guestfs-actions.pod:4991 ../src/guestfs-actions.pod:5536 ../src/guestfs-actions.pod:5559 ../src/guestfs-actions.pod:5582 ../src/guestfs-actions.pod:5598 ../src/guestfs-actions.pod:5671 ../src/guestfs-actions.pod:5687 ../src/guestfs-actions.pod:5727 ../src/guestfs-actions.pod:5743 ../fish/guestfish-actions.pod:546 ../fish/guestfish-actions.pod:681 ../fish/guestfish-actions.pod:693 ../fish/guestfish-actions.pod:894 ../fish/guestfish-actions.pod:904 ../fish/guestfish-actions.pod:971 ../fish/guestfish-actions.pod:981 ../fish/guestfish-actions.pod:1176 ../fish/guestfish-actions.pod:1451 ../fish/guestfish-actions.pod:1461 ../fish/guestfish-actions.pod:1489 ../fish/guestfish-actions.pod:1504 ../fish/guestfish-actions.pod:1514 ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:3003 ../fish/guestfish-actions.pod:3018 ../fish/guestfish-actions.pod:3094 ../fish/guestfish-actions.pod:3111 ../fish/guestfish-actions.pod:3126 ../fish/guestfish-actions.pod:3709 ../fish/guestfish-actions.pod:3755 ../fish/guestfish-actions.pod:3840 ../fish/guestfish-actions.pod:3855 ../fish/guestfish-actions.pod:4265 ../fish/guestfish-actions.pod:4283 ../fish/guestfish-actions.pod:4300 ../fish/guestfish-actions.pod:4310 ../fish/guestfish-actions.pod:4358 ../fish/guestfish-actions.pod:4368 ../fish/guestfish-actions.pod:4397 ../fish/guestfish-actions.pod:4407
4993 "Because of the message protocol, there is a transfer limit of somewhere "
4994 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4998 #: ../src/guestfs-actions.pod:697
4999 msgid "guestfs_checksum"
5003 #: ../src/guestfs-actions.pod:699
5006 " char *guestfs_checksum (guestfs_h *g,\n"
5007 "\t\tconst char *csumtype,\n"
5008 "\t\tconst char *path);\n"
5013 #: ../src/guestfs-actions.pod:703 ../fish/guestfish-actions.pod:553
5014 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5018 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:556
5020 "The type of checksum to compute is given by the C<csumtype> parameter which "
5021 "must have one of the following values:"
5025 #: ../src/guestfs-actions.pod:711 ../fish/guestfish-actions.pod:561
5030 #: ../src/guestfs-actions.pod:713 ../fish/guestfish-actions.pod:563
5032 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5037 #: ../src/guestfs-actions.pod:716 ../fish/guestfish-actions.pod:566
5042 #: ../src/guestfs-actions.pod:718 ../fish/guestfish-actions.pod:568
5043 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5047 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:570
5052 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:572
5053 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5057 #: ../src/guestfs-actions.pod:724 ../fish/guestfish-actions.pod:574
5062 #: ../src/guestfs-actions.pod:726 ../fish/guestfish-actions.pod:576
5063 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5067 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:578
5072 #: ../src/guestfs-actions.pod:730 ../fish/guestfish-actions.pod:580
5073 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5077 #: ../src/guestfs-actions.pod:732 ../fish/guestfish-actions.pod:582
5082 #: ../src/guestfs-actions.pod:734 ../fish/guestfish-actions.pod:584
5083 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5087 #: ../src/guestfs-actions.pod:736 ../fish/guestfish-actions.pod:586
5092 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:588
5093 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5097 #: ../src/guestfs-actions.pod:742 ../fish/guestfish-actions.pod:592
5098 msgid "The checksum is returned as a printable string."
5102 #: ../src/guestfs-actions.pod:744
5103 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
5107 #: ../src/guestfs-actions.pod:746
5108 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
5112 #: ../src/guestfs-actions.pod:751
5113 msgid "guestfs_checksum_device"
5117 #: ../src/guestfs-actions.pod:753
5120 " char *guestfs_checksum_device (guestfs_h *g,\n"
5121 "\t\tconst char *csumtype,\n"
5122 "\t\tconst char *device);\n"
5127 #: ../src/guestfs-actions.pod:757
5129 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5130 "device named C<device>. For the types of checksums supported see the "
5131 "C<guestfs_checksum> command."
5135 #: ../src/guestfs-actions.pod:764
5136 msgid "guestfs_checksums_out"
5140 #: ../src/guestfs-actions.pod:766
5143 " int guestfs_checksums_out (guestfs_h *g,\n"
5144 "\t\tconst char *csumtype,\n"
5145 "\t\tconst char *directory,\n"
5146 "\t\tconst char *sumsfile);\n"
5151 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:610
5153 "This command computes the checksums of all regular files in C<directory> and "
5154 "then emits a list of those checksums to the local output file C<sumsfile>."
5158 #: ../src/guestfs-actions.pod:775 ../fish/guestfish-actions.pod:614
5160 "This can be used for verifying the integrity of a virtual machine. However "
5161 "to be properly secure you should pay attention to the output of the checksum "
5162 "command (it uses the ones from GNU coreutils). In particular when the "
5163 "filename is not printable, coreutils uses a special backslash syntax. For "
5164 "more information, see the GNU coreutils info file."
5168 #: ../src/guestfs-actions.pod:785
5169 msgid "guestfs_chmod"
5173 #: ../src/guestfs-actions.pod:787
5176 " int guestfs_chmod (guestfs_h *g,\n"
5178 "\t\tconst char *path);\n"
5183 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:628
5185 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5190 #: ../src/guestfs-actions.pod:794 ../fish/guestfish-actions.pod:631
5192 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5193 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5198 #: ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:3244 ../src/guestfs-actions.pod:3332 ../src/guestfs-actions.pod:3348 ../src/guestfs-actions.pod:3364 ../fish/guestfish-actions.pod:635 ../fish/guestfish-actions.pod:2508 ../fish/guestfish-actions.pod:2578 ../fish/guestfish-actions.pod:2588 ../fish/guestfish-actions.pod:2598
5199 msgid "The mode actually set is affected by the umask."
5203 #: ../src/guestfs-actions.pod:802
5204 msgid "guestfs_chown"
5208 #: ../src/guestfs-actions.pod:804
5211 " int guestfs_chown (guestfs_h *g,\n"
5214 "\t\tconst char *path);\n"
5219 #: ../src/guestfs-actions.pod:809 ../fish/guestfish-actions.pod:641
5220 msgid "Change the file owner to C<owner> and group to C<group>."
5224 #: ../src/guestfs-actions.pod:811 ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:643 ../fish/guestfish-actions.pod:1999
5226 "Only numeric uid and gid are supported. If you want to use names, you will "
5227 "need to locate and parse the password file yourself (Augeas support makes "
5228 "this relatively easy)."
5232 #: ../src/guestfs-actions.pod:817
5233 msgid "guestfs_command"
5237 #: ../src/guestfs-actions.pod:819
5240 " char *guestfs_command (guestfs_h *g,\n"
5241 "\t\tchar *const *arguments);\n"
5246 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:651
5248 "This call runs a command from the guest filesystem. The filesystem must be "
5249 "mounted, and must contain a compatible operating system (ie. something "
5250 "Linux, with the same or compatible processor architecture)."
5254 #: ../src/guestfs-actions.pod:827
5256 "The single parameter is an argv-style list of arguments. The first element "
5257 "is the name of the program to run. Subsequent elements are parameters. The "
5258 "list must be non-empty (ie. must contain a program name). Note that the "
5259 "command runs directly, and is I<not> invoked via the shell (see "
5264 #: ../src/guestfs-actions.pod:834 ../fish/guestfish-actions.pod:663
5265 msgid "The return value is anything printed to I<stdout> by the command."
5269 #: ../src/guestfs-actions.pod:837 ../fish/guestfish-actions.pod:666
5271 "If the command returns a non-zero exit status, then this function returns an "
5272 "error message. The error message string is the content of I<stderr> from "
5277 #: ../src/guestfs-actions.pod:841 ../fish/guestfish-actions.pod:670
5279 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5280 "C</bin>. If you require a program from another location, you should provide "
5281 "the full path in the first parameter."
5285 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:675
5287 "Shared libraries and data files required by the program must be available on "
5288 "filesystems which are mounted in the correct places. It is the caller's "
5289 "responsibility to ensure all filesystems that are needed are mounted at the "
5294 #: ../src/guestfs-actions.pod:858
5295 msgid "guestfs_command_lines"
5299 #: ../src/guestfs-actions.pod:860
5302 " char **guestfs_command_lines (guestfs_h *g,\n"
5303 "\t\tchar *const *arguments);\n"
5308 #: ../src/guestfs-actions.pod:863
5310 "This is the same as C<guestfs_command>, but splits the result into a list of "
5315 #: ../src/guestfs-actions.pod:866
5316 msgid "See also: C<guestfs_sh_lines>"
5320 #: ../src/guestfs-actions.pod:875
5321 msgid "guestfs_config"
5325 #: ../src/guestfs-actions.pod:877
5328 " int guestfs_config (guestfs_h *g,\n"
5329 "\t\tconst char *qemuparam,\n"
5330 "\t\tconst char *qemuvalue);\n"
5335 #: ../src/guestfs-actions.pod:881 ../fish/guestfish-actions.pod:700
5337 "This can be used to add arbitrary qemu command line parameters of the form "
5338 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
5339 "setting some parameters which would interfere with parameters that we use."
5343 #: ../src/guestfs-actions.pod:886 ../fish/guestfish-actions.pod:705
5344 msgid "The first character of C<param> string must be a C<-> (dash)."
5348 #: ../src/guestfs-actions.pod:888 ../fish/guestfish-actions.pod:707
5349 msgid "C<value> can be NULL."
5353 #: ../src/guestfs-actions.pod:892
5354 msgid "guestfs_copy_size"
5358 #: ../src/guestfs-actions.pod:894
5361 " int guestfs_copy_size (guestfs_h *g,\n"
5362 "\t\tconst char *src,\n"
5363 "\t\tconst char *dest,\n"
5364 "\t\tint64_t size);\n"
5369 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:713
5371 "This command copies exactly C<size> bytes from one source device or file "
5372 "C<src> to another destination device or file C<dest>."
5376 #: ../src/guestfs-actions.pod:902 ../fish/guestfish-actions.pod:716
5378 "Note this will fail if the source is too short or if the destination is not "
5383 #: ../src/guestfs-actions.pod:907 ../src/guestfs-actions.pod:1042 ../src/guestfs-actions.pod:1070 ../src/guestfs-actions.pod:1442 ../src/guestfs-actions.pod:1461 ../src/guestfs-actions.pod:5616 ../src/guestfs-actions.pod:5632
5385 "This long-running command can generate progress notification messages so "
5386 "that the caller can display a progress bar or indicator. To receive these "
5387 "messages, the caller must register a progress callback. See "
5388 "L<guestfs(3)/guestfs_set_progress_callback>."
5392 #: ../src/guestfs-actions.pod:912
5397 #: ../src/guestfs-actions.pod:914
5400 " int guestfs_cp (guestfs_h *g,\n"
5401 "\t\tconst char *src,\n"
5402 "\t\tconst char *dest);\n"
5407 #: ../src/guestfs-actions.pod:918 ../fish/guestfish-actions.pod:723
5409 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5410 "destination filename or destination directory."
5414 #: ../src/guestfs-actions.pod:923
5415 msgid "guestfs_cp_a"
5419 #: ../src/guestfs-actions.pod:925
5422 " int guestfs_cp_a (guestfs_h *g,\n"
5423 "\t\tconst char *src,\n"
5424 "\t\tconst char *dest);\n"
5429 #: ../src/guestfs-actions.pod:929 ../fish/guestfish-actions.pod:730
5431 "This copies a file or directory from C<src> to C<dest> recursively using the "
5436 #: ../src/guestfs-actions.pod:934
5441 #: ../src/guestfs-actions.pod:936
5444 " int guestfs_dd (guestfs_h *g,\n"
5445 "\t\tconst char *src,\n"
5446 "\t\tconst char *dest);\n"
5451 #: ../src/guestfs-actions.pod:940 ../fish/guestfish-actions.pod:737
5453 "This command copies from one source device or file C<src> to another "
5454 "destination device or file C<dest>. Normally you would use this to copy to "
5455 "or from a device or partition, for example to duplicate a filesystem."
5459 #: ../src/guestfs-actions.pod:945
5461 "If the destination is a device, it must be as large or larger than the "
5462 "source file or device, otherwise the copy will fail. This command cannot do "
5463 "partial copies (see C<guestfs_copy_size>)."
5467 #: ../src/guestfs-actions.pod:951
5468 msgid "guestfs_debug"
5472 #: ../src/guestfs-actions.pod:953
5475 " char *guestfs_debug (guestfs_h *g,\n"
5476 "\t\tconst char *subcmd,\n"
5477 "\t\tchar *const *extraargs);\n"
5482 #: ../src/guestfs-actions.pod:957
5484 "The C<guestfs_debug> command exposes some internals of C<guestfsd> (the "
5485 "guestfs daemon) that runs inside the qemu subprocess."
5489 #: ../src/guestfs-actions.pod:961 ../fish/guestfish-actions.pod:754
5491 "There is no comprehensive help for this command. You have to look at the "
5492 "file C<daemon/debug.c> in the libguestfs source to find out what you can do."
5496 #: ../src/guestfs-actions.pod:968
5497 msgid "guestfs_debug_upload"
5501 #: ../src/guestfs-actions.pod:970
5504 " int guestfs_debug_upload (guestfs_h *g,\n"
5505 "\t\tconst char *filename,\n"
5506 "\t\tconst char *tmpname,\n"
5512 #: ../src/guestfs-actions.pod:975
5514 "The C<guestfs_debug_upload> command uploads a file to the libguestfs "
5519 #: ../src/guestfs-actions.pod:978 ../fish/guestfish-actions.pod:765
5521 "There is no comprehensive help for this command. You have to look at the "
5522 "file C<daemon/debug.c> in the libguestfs source to find out what it is for."
5526 #: ../src/guestfs-actions.pod:984
5531 #: ../src/guestfs-actions.pod:986
5534 " char *guestfs_df (guestfs_h *g);\n"
5539 #: ../src/guestfs-actions.pod:988 ../fish/guestfish-actions.pod:775
5540 msgid "This command runs the C<df> command to report disk space used."
5544 #: ../src/guestfs-actions.pod:990 ../src/guestfs-actions.pod:1004 ../fish/guestfish-actions.pod:777 ../fish/guestfish-actions.pod:788
5546 "This command is mostly useful for interactive sessions. It is I<not> "
5547 "intended that you try to parse the output string. Use C<statvfs> from "
5552 #: ../src/guestfs-actions.pod:997
5553 msgid "guestfs_df_h"
5557 #: ../src/guestfs-actions.pod:999
5560 " char *guestfs_df_h (guestfs_h *g);\n"
5565 #: ../src/guestfs-actions.pod:1001 ../fish/guestfish-actions.pod:785
5567 "This command runs the C<df -h> command to report disk space used in "
5568 "human-readable format."
5572 #: ../src/guestfs-actions.pod:1011
5573 msgid "guestfs_dmesg"
5577 #: ../src/guestfs-actions.pod:1013
5580 " char *guestfs_dmesg (guestfs_h *g);\n"
5585 #: ../src/guestfs-actions.pod:1015 ../fish/guestfish-actions.pod:796
5587 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5588 "This is sometimes useful for extended debugging of problems."
5592 #: ../src/guestfs-actions.pod:1019
5594 "Another way to get the same information is to enable verbose messages with "
5595 "C<guestfs_set_verbose> or by setting the environment variable "
5596 "C<LIBGUESTFS_DEBUG=1> before running the program."
5600 #: ../src/guestfs-actions.pod:1027
5601 msgid "guestfs_download"
5605 #: ../src/guestfs-actions.pod:1029
5608 " int guestfs_download (guestfs_h *g,\n"
5609 "\t\tconst char *remotefilename,\n"
5610 "\t\tconst char *filename);\n"
5615 #: ../src/guestfs-actions.pod:1033 ../src/guestfs-actions.pod:1055 ../fish/guestfish-actions.pod:809 ../fish/guestfish-actions.pod:822
5617 "Download file C<remotefilename> and save it as C<filename> on the local "
5622 #: ../src/guestfs-actions.pod:1036 ../src/guestfs-actions.pod:5184 ../fish/guestfish-actions.pod:812 ../fish/guestfish-actions.pod:4013
5623 msgid "C<filename> can also be a named pipe."
5627 #: ../src/guestfs-actions.pod:1038
5628 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5632 #: ../src/guestfs-actions.pod:1047
5633 msgid "guestfs_download_offset"
5637 #: ../src/guestfs-actions.pod:1049
5640 " int guestfs_download_offset (guestfs_h *g,\n"
5641 "\t\tconst char *remotefilename,\n"
5642 "\t\tconst char *filename,\n"
5643 "\t\tint64_t offset,\n"
5644 "\t\tint64_t size);\n"
5649 #: ../src/guestfs-actions.pod:1058 ../fish/guestfish-actions.pod:825
5651 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5652 "region must be within the file or device)."
5656 #: ../src/guestfs-actions.pod:1061
5658 "Note that there is no limit on the amount of data that can be downloaded "
5659 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
5660 "full amount unless an error occurs."
5664 #: ../src/guestfs-actions.pod:1066
5665 msgid "See also C<guestfs_download>, C<guestfs_pread>."
5669 #: ../src/guestfs-actions.pod:1075
5670 msgid "guestfs_drop_caches"
5674 #: ../src/guestfs-actions.pod:1077
5677 " int guestfs_drop_caches (guestfs_h *g,\n"
5678 "\t\tint whattodrop);\n"
5683 #: ../src/guestfs-actions.pod:1080 ../fish/guestfish-actions.pod:841
5685 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5686 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5687 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5691 #: ../src/guestfs-actions.pod:1085 ../fish/guestfish-actions.pod:846
5692 msgid "Setting C<whattodrop> to 3 should drop everything."
5696 #: ../src/guestfs-actions.pod:1087 ../fish/guestfish-actions.pod:848
5698 "This automatically calls L<sync(2)> before the operation, so that the "
5699 "maximum guest memory is freed."
5703 #: ../src/guestfs-actions.pod:1092
5708 #: ../src/guestfs-actions.pod:1094
5711 " int64_t guestfs_du (guestfs_h *g,\n"
5712 "\t\tconst char *path);\n"
5717 #: ../src/guestfs-actions.pod:1097 ../fish/guestfish-actions.pod:855
5719 "This command runs the C<du -s> command to estimate file space usage for "
5724 #: ../src/guestfs-actions.pod:1100 ../fish/guestfish-actions.pod:858
5726 "C<path> can be a file or a directory. If C<path> is a directory then the "
5727 "estimate includes the contents of the directory and all subdirectories "
5732 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:862
5733 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5737 #: ../src/guestfs-actions.pod:1109
5738 msgid "guestfs_e2fsck_f"
5742 #: ../src/guestfs-actions.pod:1111
5745 " int guestfs_e2fsck_f (guestfs_h *g,\n"
5746 "\t\tconst char *device);\n"
5751 #: ../src/guestfs-actions.pod:1114 ../fish/guestfish-actions.pod:869
5753 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5754 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
5759 #: ../src/guestfs-actions.pod:1118
5761 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
5762 "Normally you should use C<guestfs_fsck>."
5766 #: ../src/guestfs-actions.pod:1123
5767 msgid "guestfs_echo_daemon"
5771 #: ../src/guestfs-actions.pod:1125
5774 " char *guestfs_echo_daemon (guestfs_h *g,\n"
5775 "\t\tchar *const *words);\n"
5780 #: ../src/guestfs-actions.pod:1128 ../fish/guestfish-actions.pod:880
5782 "This command concatenates the list of C<words> passed with single spaces "
5783 "between them and returns the resulting string."
5787 #: ../src/guestfs-actions.pod:1131 ../fish/guestfish-actions.pod:883
5788 msgid "You can use this command to test the connection through to the daemon."
5792 #: ../src/guestfs-actions.pod:1133
5793 msgid "See also C<guestfs_ping_daemon>."
5797 #: ../src/guestfs-actions.pod:1138
5798 msgid "guestfs_egrep"
5802 #: ../src/guestfs-actions.pod:1140
5805 " char **guestfs_egrep (guestfs_h *g,\n"
5806 "\t\tconst char *regex,\n"
5807 "\t\tconst char *path);\n"
5812 #: ../src/guestfs-actions.pod:1144 ../fish/guestfish-actions.pod:891
5813 msgid "This calls the external C<egrep> program and returns the matching lines."
5817 #: ../src/guestfs-actions.pod:1154
5818 msgid "guestfs_egrepi"
5822 #: ../src/guestfs-actions.pod:1156
5825 " char **guestfs_egrepi (guestfs_h *g,\n"
5826 "\t\tconst char *regex,\n"
5827 "\t\tconst char *path);\n"
5832 #: ../src/guestfs-actions.pod:1160 ../fish/guestfish-actions.pod:901
5833 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5837 #: ../src/guestfs-actions.pod:1170
5838 msgid "guestfs_equal"
5842 #: ../src/guestfs-actions.pod:1172
5845 " int guestfs_equal (guestfs_h *g,\n"
5846 "\t\tconst char *file1,\n"
5847 "\t\tconst char *file2);\n"
5852 #: ../src/guestfs-actions.pod:1176 ../fish/guestfish-actions.pod:911
5854 "This compares the two files C<file1> and C<file2> and returns true if their "
5855 "content is exactly equal, or false otherwise."
5859 #: ../src/guestfs-actions.pod:1179 ../fish/guestfish-actions.pod:914
5860 msgid "The external L<cmp(1)> program is used for the comparison."
5864 #: ../src/guestfs-actions.pod:1183
5865 msgid "guestfs_exists"
5869 #: ../src/guestfs-actions.pod:1185
5872 " int guestfs_exists (guestfs_h *g,\n"
5873 "\t\tconst char *path);\n"
5878 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:920
5880 "This returns C<true> if and only if there is a file, directory (or anything) "
5881 "with the given C<path> name."
5885 #: ../src/guestfs-actions.pod:1191
5886 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
5890 #: ../src/guestfs-actions.pod:1195
5891 msgid "guestfs_fallocate"
5895 #: ../src/guestfs-actions.pod:1197
5898 " int guestfs_fallocate (guestfs_h *g,\n"
5899 "\t\tconst char *path,\n"
5905 #: ../src/guestfs-actions.pod:1201 ../src/guestfs-actions.pod:1224 ../fish/guestfish-actions.pod:929 ../fish/guestfish-actions.pod:948
5907 "This command preallocates a file (containing zero bytes) named C<path> of "
5908 "size C<len> bytes. If the file exists already, it is overwritten."
5912 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:933
5914 "Do not confuse this with the guestfish-specific C<alloc> command which "
5915 "allocates a file in the host and attaches it as a device."
5919 #: ../src/guestfs-actions.pod:1211 ../fish/guestfish-actions.pod:937
5921 "This function is deprecated. In new code, use the C<fallocate64> call "
5926 #: ../src/guestfs-actions.pod:1218
5927 msgid "guestfs_fallocate64"
5931 #: ../src/guestfs-actions.pod:1220
5934 " int guestfs_fallocate64 (guestfs_h *g,\n"
5935 "\t\tconst char *path,\n"
5936 "\t\tint64_t len);\n"
5941 #: ../src/guestfs-actions.pod:1228
5943 "Note that this call allocates disk blocks for the file. To create a sparse "
5944 "file use C<guestfs_truncate_size> instead."
5948 #: ../src/guestfs-actions.pod:1231
5950 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
5951 "oversight it only allowed 30 bit lengths to be specified, effectively "
5952 "limiting the maximum size of files created through that call to 1GB."
5956 #: ../src/guestfs-actions.pod:1236 ../fish/guestfish-actions.pod:960
5958 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5959 "commands which create a file in the host and attach it as a device."
5963 #: ../src/guestfs-actions.pod:1242
5964 msgid "guestfs_fgrep"
5968 #: ../src/guestfs-actions.pod:1244
5971 " char **guestfs_fgrep (guestfs_h *g,\n"
5972 "\t\tconst char *pattern,\n"
5973 "\t\tconst char *path);\n"
5978 #: ../src/guestfs-actions.pod:1248 ../fish/guestfish-actions.pod:968
5979 msgid "This calls the external C<fgrep> program and returns the matching lines."
5983 #: ../src/guestfs-actions.pod:1258
5984 msgid "guestfs_fgrepi"
5988 #: ../src/guestfs-actions.pod:1260
5991 " char **guestfs_fgrepi (guestfs_h *g,\n"
5992 "\t\tconst char *pattern,\n"
5993 "\t\tconst char *path);\n"
5998 #: ../src/guestfs-actions.pod:1264 ../fish/guestfish-actions.pod:978
5999 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
6003 #: ../src/guestfs-actions.pod:1274
6004 msgid "guestfs_file"
6008 #: ../src/guestfs-actions.pod:1276
6011 " char *guestfs_file (guestfs_h *g,\n"
6012 "\t\tconst char *path);\n"
6017 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:988
6019 "This call uses the standard L<file(1)> command to determine the type or "
6020 "contents of the file."
6024 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:991
6026 "This call will also transparently look inside various types of compressed "
6031 #: ../src/guestfs-actions.pod:1285 ../fish/guestfish-actions.pod:994
6033 "The exact command which runs is C<file -zb path>. Note in particular that "
6034 "the filename is not prepended to the output (the C<-b> option)."
6038 #: ../src/guestfs-actions.pod:1289
6040 "This command can also be used on C</dev/> devices (and partitions, LV "
6041 "names). You can for example use this to determine if a device contains a "
6042 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
6046 #: ../src/guestfs-actions.pod:1294 ../fish/guestfish-actions.pod:1003
6048 "If the C<path> does not begin with C</dev/> then this command only works for "
6049 "the content of regular files. For other file types (directory, symbolic "
6050 "link etc) it will just return the string C<directory> etc."
6054 #: ../src/guestfs-actions.pod:1302
6055 msgid "guestfs_file_architecture"
6059 #: ../src/guestfs-actions.pod:1304
6062 " char *guestfs_file_architecture (guestfs_h *g,\n"
6063 "\t\tconst char *filename);\n"
6068 #: ../src/guestfs-actions.pod:1307 ../fish/guestfish-actions.pod:1012
6070 "This detects the architecture of the binary C<filename>, and returns it if "
6075 #: ../src/guestfs-actions.pod:1310 ../fish/guestfish-actions.pod:1015
6076 msgid "Currently defined architectures are:"
6080 #: ../src/guestfs-actions.pod:1314 ../fish/guestfish-actions.pod:1019
6085 #: ../src/guestfs-actions.pod:1316 ../fish/guestfish-actions.pod:1021
6087 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6088 "irrespective of the precise processor requirements of the binary."
6092 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:1024
6097 #: ../src/guestfs-actions.pod:1321 ../fish/guestfish-actions.pod:1026
6098 msgid "64 bit x86-64."
6102 #: ../src/guestfs-actions.pod:1323 ../fish/guestfish-actions.pod:1028
6107 #: ../src/guestfs-actions.pod:1325 ../fish/guestfish-actions.pod:1030
6108 msgid "32 bit SPARC."
6112 #: ../src/guestfs-actions.pod:1327 ../fish/guestfish-actions.pod:1032
6117 #: ../src/guestfs-actions.pod:1329 ../fish/guestfish-actions.pod:1034
6118 msgid "64 bit SPARC V9 and above."
6122 #: ../src/guestfs-actions.pod:1331 ../fish/guestfish-actions.pod:1036
6127 #: ../src/guestfs-actions.pod:1333 ../fish/guestfish-actions.pod:1038
6128 msgid "Intel Itanium."
6132 #: ../src/guestfs-actions.pod:1335 ../fish/guestfish-actions.pod:1040
6137 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:1042
6138 msgid "32 bit Power PC."
6142 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:1044
6147 #: ../src/guestfs-actions.pod:1341 ../fish/guestfish-actions.pod:1046
6148 msgid "64 bit Power PC."
6152 #: ../src/guestfs-actions.pod:1345 ../fish/guestfish-actions.pod:1050
6153 msgid "Libguestfs may return other architecture strings in future."
6157 #: ../src/guestfs-actions.pod:1347 ../fish/guestfish-actions.pod:1052
6158 msgid "The function works on at least the following types of files:"
6162 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:1058
6163 msgid "many types of Un*x and Linux binary"
6167 #: ../src/guestfs-actions.pod:1357 ../fish/guestfish-actions.pod:1062
6168 msgid "many types of Un*x and Linux shared library"
6172 #: ../src/guestfs-actions.pod:1361 ../fish/guestfish-actions.pod:1066
6173 msgid "Windows Win32 and Win64 binaries"
6177 #: ../src/guestfs-actions.pod:1365 ../fish/guestfish-actions.pod:1070
6178 msgid "Windows Win32 and Win64 DLLs"
6182 #: ../src/guestfs-actions.pod:1367 ../fish/guestfish-actions.pod:1072
6183 msgid "Win32 binaries and DLLs return C<i386>."
6187 #: ../src/guestfs-actions.pod:1369 ../fish/guestfish-actions.pod:1074
6188 msgid "Win64 binaries and DLLs return C<x86_64>."
6192 #: ../src/guestfs-actions.pod:1373 ../fish/guestfish-actions.pod:1078
6193 msgid "Linux kernel modules"
6197 #: ../src/guestfs-actions.pod:1377 ../fish/guestfish-actions.pod:1082
6198 msgid "Linux new-style initrd images"
6202 #: ../src/guestfs-actions.pod:1381 ../fish/guestfish-actions.pod:1086
6203 msgid "some non-x86 Linux vmlinuz kernels"
6207 #: ../src/guestfs-actions.pod:1385 ../fish/guestfish-actions.pod:1090
6208 msgid "What it can't do currently:"
6212 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:1096
6213 msgid "static libraries (libfoo.a)"
6217 #: ../src/guestfs-actions.pod:1395 ../fish/guestfish-actions.pod:1100
6218 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6222 #: ../src/guestfs-actions.pod:1399 ../fish/guestfish-actions.pod:1104
6223 msgid "x86 Linux vmlinuz kernels"
6227 #: ../src/guestfs-actions.pod:1401 ../fish/guestfish-actions.pod:1106
6229 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6230 "compressed code, and are horribly hard to unpack. If you want to find the "
6231 "architecture of a kernel, use the architecture of the associated initrd or "
6232 "kernel module(s) instead."
6236 #: ../src/guestfs-actions.pod:1411
6237 msgid "guestfs_filesize"
6241 #: ../src/guestfs-actions.pod:1413
6244 " int64_t guestfs_filesize (guestfs_h *g,\n"
6245 "\t\tconst char *file);\n"
6250 #: ../src/guestfs-actions.pod:1416 ../fish/guestfish-actions.pod:1117
6251 msgid "This command returns the size of C<file> in bytes."
6255 #: ../src/guestfs-actions.pod:1418
6257 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
6258 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
6259 "devices, use C<guestfs_blockdev_getsize64>."
6263 #: ../src/guestfs-actions.pod:1424
6264 msgid "guestfs_fill"
6268 #: ../src/guestfs-actions.pod:1426
6271 " int guestfs_fill (guestfs_h *g,\n"
6274 "\t\tconst char *path);\n"
6279 #: ../src/guestfs-actions.pod:1431 ../fish/guestfish-actions.pod:1127
6281 "This command creates a new file called C<path>. The initial content of the "
6282 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6287 #: ../src/guestfs-actions.pod:1435
6289 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6290 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
6291 "bytes use C<guestfs_fill_pattern>."
6295 #: ../src/guestfs-actions.pod:1447
6296 msgid "guestfs_fill_pattern"
6300 #: ../src/guestfs-actions.pod:1449
6303 " int guestfs_fill_pattern (guestfs_h *g,\n"
6304 "\t\tconst char *pattern,\n"
6306 "\t\tconst char *path);\n"
6311 #: ../src/guestfs-actions.pod:1454
6313 "This function is like C<guestfs_fill> except that it creates a new file of "
6314 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
6315 "pattern is truncated if necessary to ensure the length of the file is "
6316 "exactly C<len> bytes."
6320 #: ../src/guestfs-actions.pod:1466
6321 msgid "guestfs_find"
6325 #: ../src/guestfs-actions.pod:1468
6328 " char **guestfs_find (guestfs_h *g,\n"
6329 "\t\tconst char *directory);\n"
6334 #: ../src/guestfs-actions.pod:1471 ../fish/guestfish-actions.pod:1149
6336 "This command lists out all files and directories, recursively, starting at "
6337 "C<directory>. It is essentially equivalent to running the shell command "
6338 "C<find directory -print> but some post-processing happens on the output, "
6343 #: ../src/guestfs-actions.pod:1476 ../fish/guestfish-actions.pod:1154
6345 "This returns a list of strings I<without any prefix>. Thus if the directory "
6350 #: ../src/guestfs-actions.pod:1479 ../fish/guestfish-actions.pod:1157
6360 #: ../src/guestfs-actions.pod:1483
6361 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
6365 #: ../src/guestfs-actions.pod:1486 ../fish/guestfish-actions.pod:1164
6376 #: ../src/guestfs-actions.pod:1491 ../fish/guestfish-actions.pod:1169
6377 msgid "If C<directory> is not a directory, then this command returns an error."
6381 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:1172
6382 msgid "The returned list is sorted."
6386 #: ../src/guestfs-actions.pod:1496
6387 msgid "See also C<guestfs_find0>."
6391 #: ../src/guestfs-actions.pod:1505
6392 msgid "guestfs_find0"
6396 #: ../src/guestfs-actions.pod:1507
6399 " int guestfs_find0 (guestfs_h *g,\n"
6400 "\t\tconst char *directory,\n"
6401 "\t\tconst char *files);\n"
6406 #: ../src/guestfs-actions.pod:1511 ../fish/guestfish-actions.pod:1183
6408 "This command lists out all files and directories, recursively, starting at "
6409 "C<directory>, placing the resulting list in the external file called "
6414 #: ../src/guestfs-actions.pod:1515
6416 "This command works the same way as C<guestfs_find> with the following "
6421 #: ../src/guestfs-actions.pod:1522 ../fish/guestfish-actions.pod:1194
6422 msgid "The resulting list is written to an external file."
6426 #: ../src/guestfs-actions.pod:1526 ../fish/guestfish-actions.pod:1198
6428 "Items (filenames) in the result are separated by C<\\0> characters. See "
6429 "L<find(1)> option I<-print0>."
6433 #: ../src/guestfs-actions.pod:1531 ../fish/guestfish-actions.pod:1203
6434 msgid "This command is not limited in the number of names that it can return."
6438 #: ../src/guestfs-actions.pod:1536 ../fish/guestfish-actions.pod:1208
6439 msgid "The result list is not sorted."
6443 #: ../src/guestfs-actions.pod:1542
6444 msgid "guestfs_findfs_label"
6448 #: ../src/guestfs-actions.pod:1544
6451 " char *guestfs_findfs_label (guestfs_h *g,\n"
6452 "\t\tconst char *label);\n"
6457 #: ../src/guestfs-actions.pod:1547 ../fish/guestfish-actions.pod:1218
6459 "This command searches the filesystems and returns the one which has the "
6460 "given label. An error is returned if no such filesystem can be found."
6464 #: ../src/guestfs-actions.pod:1551
6465 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6469 #: ../src/guestfs-actions.pod:1556
6470 msgid "guestfs_findfs_uuid"
6474 #: ../src/guestfs-actions.pod:1558
6477 " char *guestfs_findfs_uuid (guestfs_h *g,\n"
6478 "\t\tconst char *uuid);\n"
6483 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1228
6485 "This command searches the filesystems and returns the one which has the "
6486 "given UUID. An error is returned if no such filesystem can be found."
6490 #: ../src/guestfs-actions.pod:1565
6491 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6495 #: ../src/guestfs-actions.pod:1570
6496 msgid "guestfs_fsck"
6500 #: ../src/guestfs-actions.pod:1572
6503 " int guestfs_fsck (guestfs_h *g,\n"
6504 "\t\tconst char *fstype,\n"
6505 "\t\tconst char *device);\n"
6510 #: ../src/guestfs-actions.pod:1576 ../fish/guestfish-actions.pod:1238
6512 "This runs the filesystem checker (fsck) on C<device> which should have "
6513 "filesystem type C<fstype>."
6517 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1241
6519 "The returned integer is the status. See L<fsck(8)> for the list of status "
6520 "codes from C<fsck>."
6524 #: ../src/guestfs-actions.pod:1588 ../fish/guestfish-actions.pod:1250
6525 msgid "Multiple status codes can be summed together."
6529 #: ../src/guestfs-actions.pod:1592 ../fish/guestfish-actions.pod:1254
6531 "A non-zero return code can mean \"success\", for example if errors have been "
6532 "corrected on the filesystem."
6536 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1259
6537 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6541 #: ../src/guestfs-actions.pod:1602 ../fish/guestfish-actions.pod:1264
6542 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6546 #: ../src/guestfs-actions.pod:1606
6547 msgid "guestfs_get_append"
6551 #: ../src/guestfs-actions.pod:1608
6554 " const char *guestfs_get_append (guestfs_h *g);\n"
6559 #: ../src/guestfs-actions.pod:1610 ../fish/guestfish-actions.pod:1270
6561 "Return the additional kernel options which are added to the guest kernel "
6566 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1273
6567 msgid "If C<NULL> then no options are added."
6571 #: ../src/guestfs-actions.pod:1615
6573 "This function returns a string which may be NULL. There is no way to return "
6574 "an error from this function. The string is owned by the guest handle and "
6575 "must I<not> be freed."
6579 #: ../src/guestfs-actions.pod:1619
6580 msgid "guestfs_get_autosync"
6584 #: ../src/guestfs-actions.pod:1621
6587 " int guestfs_get_autosync (guestfs_h *g);\n"
6592 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1279
6593 msgid "Get the autosync flag."
6597 #: ../src/guestfs-actions.pod:1627
6598 msgid "guestfs_get_direct"
6602 #: ../src/guestfs-actions.pod:1629
6605 " int guestfs_get_direct (guestfs_h *g);\n"
6610 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1285
6611 msgid "Return the direct appliance mode flag."
6615 #: ../src/guestfs-actions.pod:1635
6616 msgid "guestfs_get_e2label"
6620 #: ../src/guestfs-actions.pod:1637
6623 " char *guestfs_get_e2label (guestfs_h *g,\n"
6624 "\t\tconst char *device);\n"
6629 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1291
6630 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6634 #: ../src/guestfs-actions.pod:1646 ../fish/guestfish-actions.pod:1294
6636 "This function is deprecated. In new code, use the C<vfs_label> call "
6641 #: ../src/guestfs-actions.pod:1653
6642 msgid "guestfs_get_e2uuid"
6646 #: ../src/guestfs-actions.pod:1655
6649 " char *guestfs_get_e2uuid (guestfs_h *g,\n"
6650 "\t\tconst char *device);\n"
6655 #: ../src/guestfs-actions.pod:1658 ../fish/guestfish-actions.pod:1305
6656 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6660 #: ../src/guestfs-actions.pod:1664 ../fish/guestfish-actions.pod:1308
6661 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
6665 #: ../src/guestfs-actions.pod:1671
6666 msgid "guestfs_get_memsize"
6670 #: ../src/guestfs-actions.pod:1673
6673 " int guestfs_get_memsize (guestfs_h *g);\n"
6678 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1319
6679 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6683 #: ../src/guestfs-actions.pod:1678
6685 "If C<guestfs_set_memsize> was not called on this handle, and if "
6686 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6687 "value for memsize."
6691 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1745 ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:4529 ../fish/guestfish-actions.pod:1326 ../fish/guestfish-actions.pod:1377 ../fish/guestfish-actions.pod:3420 ../fish/guestfish-actions.pod:3507
6692 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6696 #: ../src/guestfs-actions.pod:1687
6697 msgid "guestfs_get_network"
6701 #: ../src/guestfs-actions.pod:1689
6704 " int guestfs_get_network (guestfs_h *g);\n"
6709 #: ../src/guestfs-actions.pod:1691 ../fish/guestfish-actions.pod:1333
6710 msgid "This returns the enable network flag."
6714 #: ../src/guestfs-actions.pod:1695
6715 msgid "guestfs_get_path"
6719 #: ../src/guestfs-actions.pod:1697
6722 " const char *guestfs_get_path (guestfs_h *g);\n"
6727 #: ../src/guestfs-actions.pod:1699 ../fish/guestfish-actions.pod:1339
6728 msgid "Return the current search path."
6732 #: ../src/guestfs-actions.pod:1701 ../fish/guestfish-actions.pod:1341
6734 "This is always non-NULL. If it wasn't set already, then this will return "
6739 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:1727
6741 "This function returns a string, or NULL on error. The string is owned by "
6742 "the guest handle and must I<not> be freed."
6746 #: ../src/guestfs-actions.pod:1707
6747 msgid "guestfs_get_pid"
6751 #: ../src/guestfs-actions.pod:1709
6754 " int guestfs_get_pid (guestfs_h *g);\n"
6759 #: ../src/guestfs-actions.pod:1711 ../fish/guestfish-actions.pod:1350
6761 "Return the process ID of the qemu subprocess. If there is no qemu "
6762 "subprocess, then this will return an error."
6766 #: ../src/guestfs-actions.pod:1714 ../fish/guestfish-actions.pod:1353
6767 msgid "This is an internal call used for debugging and testing."
6771 #: ../src/guestfs-actions.pod:1718
6772 msgid "guestfs_get_qemu"
6776 #: ../src/guestfs-actions.pod:1720
6779 " const char *guestfs_get_qemu (guestfs_h *g);\n"
6784 #: ../src/guestfs-actions.pod:1722 ../fish/guestfish-actions.pod:1359
6785 msgid "Return the current qemu binary."
6789 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1361
6791 "This is always non-NULL. If it wasn't set already, then this will return "
6792 "the default qemu binary name."
6796 #: ../src/guestfs-actions.pod:1730
6797 msgid "guestfs_get_recovery_proc"
6801 #: ../src/guestfs-actions.pod:1732
6804 " int guestfs_get_recovery_proc (guestfs_h *g);\n"
6809 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1368
6810 msgid "Return the recovery process enabled flag."
6814 #: ../src/guestfs-actions.pod:1738
6815 msgid "guestfs_get_selinux"
6819 #: ../src/guestfs-actions.pod:1740
6822 " int guestfs_get_selinux (guestfs_h *g);\n"
6827 #: ../src/guestfs-actions.pod:1742
6829 "This returns the current setting of the selinux flag which is passed to the "
6830 "appliance at boot time. See C<guestfs_set_selinux>."
6834 #: ../src/guestfs-actions.pod:1750
6835 msgid "guestfs_get_state"
6839 #: ../src/guestfs-actions.pod:1752
6842 " int guestfs_get_state (guestfs_h *g);\n"
6847 #: ../src/guestfs-actions.pod:1754 ../fish/guestfish-actions.pod:1384
6849 "This returns the current state as an opaque integer. This is only useful "
6850 "for printing debug and internal error messages."
6854 #: ../src/guestfs-actions.pod:1757 ../src/guestfs-actions.pod:2378 ../src/guestfs-actions.pod:2401 ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:2471 ../fish/guestfish-actions.pod:1387 ../fish/guestfish-actions.pod:1881 ../fish/guestfish-actions.pod:1899 ../fish/guestfish-actions.pod:1937 ../fish/guestfish-actions.pod:1953
6855 msgid "For more information on states, see L<guestfs(3)>."
6859 #: ../src/guestfs-actions.pod:1761
6860 msgid "guestfs_get_trace"
6864 #: ../src/guestfs-actions.pod:1763
6867 " int guestfs_get_trace (guestfs_h *g);\n"
6872 #: ../src/guestfs-actions.pod:1765 ../fish/guestfish-actions.pod:1393
6873 msgid "Return the command trace flag."
6877 #: ../src/guestfs-actions.pod:1769
6878 msgid "guestfs_get_umask"
6882 #: ../src/guestfs-actions.pod:1771
6885 " int guestfs_get_umask (guestfs_h *g);\n"
6890 #: ../src/guestfs-actions.pod:1773
6892 "Return the current umask. By default the umask is C<022> unless it has been "
6893 "set by calling C<guestfs_umask>."
6897 #: ../src/guestfs-actions.pod:1778
6898 msgid "guestfs_get_verbose"
6902 #: ../src/guestfs-actions.pod:1780
6905 " int guestfs_get_verbose (guestfs_h *g);\n"
6910 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1406
6911 msgid "This returns the verbose messages flag."
6915 #: ../src/guestfs-actions.pod:1786
6916 msgid "guestfs_getcon"
6920 #: ../src/guestfs-actions.pod:1788
6923 " char *guestfs_getcon (guestfs_h *g);\n"
6928 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1412
6929 msgid "This gets the SELinux security context of the daemon."
6933 #: ../src/guestfs-actions.pod:1792
6934 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
6938 #: ../src/guestfs-actions.pod:1798
6939 msgid "guestfs_getxattrs"
6943 #: ../src/guestfs-actions.pod:1800
6946 " struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,\n"
6947 "\t\tconst char *path);\n"
6952 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1421
6953 msgid "This call lists the extended attributes of the file or directory C<path>."
6957 #: ../src/guestfs-actions.pod:1806 ../fish/guestfish-actions.pod:1424
6959 "At the system call level, this is a combination of the L<listxattr(2)> and "
6960 "L<getxattr(2)> calls."
6964 #: ../src/guestfs-actions.pod:1809
6965 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
6969 #: ../src/guestfs-actions.pod:1811 ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:3083
6971 "This function returns a C<struct guestfs_xattr_list *> (see "
6972 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
6973 "must call C<guestfs_free_xattr_list> after use>."
6977 #: ../src/guestfs-actions.pod:1816
6978 msgid "guestfs_glob_expand"
6982 #: ../src/guestfs-actions.pod:1818
6985 " char **guestfs_glob_expand (guestfs_h *g,\n"
6986 "\t\tconst char *pattern);\n"
6991 #: ../src/guestfs-actions.pod:1821 ../fish/guestfish-actions.pod:1433
6993 "This command searches for all the pathnames matching C<pattern> according to "
6994 "the wildcard expansion rules used by the shell."
6998 #: ../src/guestfs-actions.pod:1825 ../fish/guestfish-actions.pod:1437
6999 msgid "If no paths match, then this returns an empty list (note: not an error)."
7003 #: ../src/guestfs-actions.pod:1828 ../fish/guestfish-actions.pod:1440
7005 "It is just a wrapper around the C L<glob(3)> function with flags "
7006 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
7010 #: ../src/guestfs-actions.pod:1836
7011 msgid "guestfs_grep"
7015 #: ../src/guestfs-actions.pod:1838
7018 " char **guestfs_grep (guestfs_h *g,\n"
7019 "\t\tconst char *regex,\n"
7020 "\t\tconst char *path);\n"
7025 #: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:1448
7026 msgid "This calls the external C<grep> program and returns the matching lines."
7030 #: ../src/guestfs-actions.pod:1852
7031 msgid "guestfs_grepi"
7035 #: ../src/guestfs-actions.pod:1854
7038 " char **guestfs_grepi (guestfs_h *g,\n"
7039 "\t\tconst char *regex,\n"
7040 "\t\tconst char *path);\n"
7045 #: ../src/guestfs-actions.pod:1858 ../fish/guestfish-actions.pod:1458
7046 msgid "This calls the external C<grep -i> program and returns the matching lines."
7050 #: ../src/guestfs-actions.pod:1868
7051 msgid "guestfs_grub_install"
7055 #: ../src/guestfs-actions.pod:1870
7058 " int guestfs_grub_install (guestfs_h *g,\n"
7059 "\t\tconst char *root,\n"
7060 "\t\tconst char *device);\n"
7065 #: ../src/guestfs-actions.pod:1874 ../fish/guestfish-actions.pod:1468
7067 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
7068 "the root directory being C<root>."
7072 #: ../src/guestfs-actions.pod:1877 ../fish/guestfish-actions.pod:1471
7074 "Note: If grub-install reports the error \"No suitable drive was found in the "
7075 "generated device map.\" it may be that you need to create a "
7076 "C</boot/grub/device.map> file first that contains the mapping between grub "
7077 "device names and Linux device names. It is usually sufficient to create a "
7082 #: ../src/guestfs-actions.pod:1884 ../fish/guestfish-actions.pod:1478
7090 #: ../src/guestfs-actions.pod:1886 ../fish/guestfish-actions.pod:1480
7091 msgid "replacing C</dev/vda> with the name of the installation device."
7095 #: ../src/guestfs-actions.pod:1890
7096 msgid "guestfs_head"
7100 #: ../src/guestfs-actions.pod:1892
7103 " char **guestfs_head (guestfs_h *g,\n"
7104 "\t\tconst char *path);\n"
7109 #: ../src/guestfs-actions.pod:1895 ../fish/guestfish-actions.pod:1486
7111 "This command returns up to the first 10 lines of a file as a list of "
7116 #: ../src/guestfs-actions.pod:1905
7117 msgid "guestfs_head_n"
7121 #: ../src/guestfs-actions.pod:1907
7124 " char **guestfs_head_n (guestfs_h *g,\n"
7125 "\t\tint nrlines,\n"
7126 "\t\tconst char *path);\n"
7131 #: ../src/guestfs-actions.pod:1911 ../fish/guestfish-actions.pod:1496
7133 "If the parameter C<nrlines> is a positive number, this returns the first "
7134 "C<nrlines> lines of the file C<path>."
7138 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1499
7140 "If the parameter C<nrlines> is a negative number, this returns lines from "
7141 "the file C<path>, excluding the last C<nrlines> lines."
7145 #: ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:1502 ../fish/guestfish-actions.pod:3853
7146 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7150 #: ../src/guestfs-actions.pod:1926
7151 msgid "guestfs_hexdump"
7155 #: ../src/guestfs-actions.pod:1928
7158 " char *guestfs_hexdump (guestfs_h *g,\n"
7159 "\t\tconst char *path);\n"
7164 #: ../src/guestfs-actions.pod:1931 ../fish/guestfish-actions.pod:1511
7166 "This runs C<hexdump -C> on the given C<path>. The result is the "
7167 "human-readable, canonical hex dump of the file."
7171 #: ../src/guestfs-actions.pod:1940
7172 msgid "guestfs_initrd_cat"
7176 #: ../src/guestfs-actions.pod:1942
7179 " char *guestfs_initrd_cat (guestfs_h *g,\n"
7180 "\t\tconst char *initrdpath,\n"
7181 "\t\tconst char *filename,\n"
7182 "\t\tsize_t *size_r);\n"
7187 #: ../src/guestfs-actions.pod:1947 ../fish/guestfish-actions.pod:1521
7189 "This command unpacks the file C<filename> from the initrd file called "
7190 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7195 #: ../src/guestfs-actions.pod:1951 ../fish/guestfish-actions.pod:1525
7197 "For example, in guestfish you could use the following command to examine the "
7198 "boot script (usually called C</init>) contained in a Linux initrd or "
7203 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1529
7206 " initrd-cat /boot/initrd-<version>.img init\n"
7211 #: ../src/guestfs-actions.pod:1957
7212 msgid "See also C<guestfs_initrd_list>."
7216 #: ../src/guestfs-actions.pod:1959 ../src/guestfs-actions.pod:3897 ../src/guestfs-actions.pod:3920 ../src/guestfs-actions.pod:4072
7218 "This function returns a buffer, or NULL on error. The size of the returned "
7219 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
7224 #: ../src/guestfs-actions.pod:1966
7225 msgid "guestfs_initrd_list"
7229 #: ../src/guestfs-actions.pod:1968
7232 " char **guestfs_initrd_list (guestfs_h *g,\n"
7233 "\t\tconst char *path);\n"
7238 #: ../src/guestfs-actions.pod:1971 ../fish/guestfish-actions.pod:1540
7239 msgid "This command lists out files contained in an initrd."
7243 #: ../src/guestfs-actions.pod:1973 ../fish/guestfish-actions.pod:1542
7245 "The files are listed without any initial C</> character. The files are "
7246 "listed in the order they appear (not necessarily alphabetical). Directory "
7247 "names are listed as separate items."
7251 #: ../src/guestfs-actions.pod:1977 ../fish/guestfish-actions.pod:1546
7253 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7254 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7259 #: ../src/guestfs-actions.pod:1985
7260 msgid "guestfs_inotify_add_watch"
7264 #: ../src/guestfs-actions.pod:1987
7267 " int64_t guestfs_inotify_add_watch (guestfs_h *g,\n"
7268 "\t\tconst char *path,\n"
7274 #: ../src/guestfs-actions.pod:1991 ../fish/guestfish-actions.pod:1554
7275 msgid "Watch C<path> for the events listed in C<mask>."
7279 #: ../src/guestfs-actions.pod:1993 ../fish/guestfish-actions.pod:1556
7281 "Note that if C<path> is a directory then events within that directory are "
7282 "watched, but this does I<not> happen recursively (in subdirectories)."
7286 #: ../src/guestfs-actions.pod:1997 ../fish/guestfish-actions.pod:1560
7288 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7289 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7293 #: ../src/guestfs-actions.pod:2003
7294 msgid "guestfs_inotify_close"
7298 #: ../src/guestfs-actions.pod:2005
7301 " int guestfs_inotify_close (guestfs_h *g);\n"
7306 #: ../src/guestfs-actions.pod:2007 ../fish/guestfish-actions.pod:1568
7308 "This closes the inotify handle which was previously opened by inotify_init. "
7309 "It removes all watches, throws away any pending events, and deallocates all "
7314 #: ../src/guestfs-actions.pod:2013
7315 msgid "guestfs_inotify_files"
7319 #: ../src/guestfs-actions.pod:2015
7322 " char **guestfs_inotify_files (guestfs_h *g);\n"
7327 #: ../src/guestfs-actions.pod:2017
7329 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
7330 "returns a list of pathnames of objects that were touched. The returned "
7331 "pathnames are sorted and deduplicated."
7335 #: ../src/guestfs-actions.pod:2025
7336 msgid "guestfs_inotify_init"
7340 #: ../src/guestfs-actions.pod:2027
7343 " int guestfs_inotify_init (guestfs_h *g,\n"
7344 "\t\tint maxevents);\n"
7349 #: ../src/guestfs-actions.pod:2030 ../fish/guestfish-actions.pod:1584
7351 "This command creates a new inotify handle. The inotify subsystem can be "
7352 "used to notify events which happen to objects in the guest filesystem."
7356 #: ../src/guestfs-actions.pod:2034
7358 "C<maxevents> is the maximum number of events which will be queued up between "
7359 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
7360 "passed as C<0>, then the kernel (or previously set) default is used. For "
7361 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
7362 "throws away events, but records the fact that it threw them away by setting "
7363 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
7364 "C<guestfs_inotify_read>)."
7368 #: ../src/guestfs-actions.pod:2044
7370 "Before any events are generated, you have to add some watches to the "
7371 "internal watch list. See: C<guestfs_inotify_add_watch>, "
7372 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
7376 #: ../src/guestfs-actions.pod:2050
7378 "Queued up events should be read periodically by calling "
7379 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
7380 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
7381 "often enough then you risk the internal queue overflowing."
7385 #: ../src/guestfs-actions.pod:2057
7387 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
7388 "This also removes any watches automatically."
7392 #: ../src/guestfs-actions.pod:2061 ../fish/guestfish-actions.pod:1615
7394 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7395 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7396 "that there is one global inotify handle per libguestfs instance."
7400 #: ../src/guestfs-actions.pod:2068
7401 msgid "guestfs_inotify_read"
7405 #: ../src/guestfs-actions.pod:2070
7408 " struct guestfs_inotify_event_list *guestfs_inotify_read (guestfs_h *g);\n"
7413 #: ../src/guestfs-actions.pod:2072 ../fish/guestfish-actions.pod:1624
7415 "Return the complete queue of events that have happened since the previous "
7420 #: ../src/guestfs-actions.pod:2075 ../fish/guestfish-actions.pod:1627
7421 msgid "If no events have happened, this returns an empty list."
7425 #: ../src/guestfs-actions.pod:2077 ../fish/guestfish-actions.pod:1629
7427 "I<Note>: In order to make sure that all events have been read, you must call "
7428 "this function repeatedly until it returns an empty list. The reason is that "
7429 "the call will read events up to the maximum appliance-to-host message size "
7430 "and leave remaining events in the queue."
7434 #: ../src/guestfs-actions.pod:2083
7436 "This function returns a C<struct guestfs_inotify_event_list *> (see "
7437 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7438 "must call C<guestfs_free_inotify_event_list> after use>."
7442 #: ../src/guestfs-actions.pod:2088
7443 msgid "guestfs_inotify_rm_watch"
7447 #: ../src/guestfs-actions.pod:2090
7450 " int guestfs_inotify_rm_watch (guestfs_h *g,\n"
7456 #: ../src/guestfs-actions.pod:2093
7458 "Remove a previously defined inotify watch. See "
7459 "C<guestfs_inotify_add_watch>."
7463 #: ../src/guestfs-actions.pod:2098
7464 msgid "guestfs_inspect_get_arch"
7468 #: ../src/guestfs-actions.pod:2100
7471 " char *guestfs_inspect_get_arch (guestfs_h *g,\n"
7472 "\t\tconst char *root);\n"
7477 #: ../src/guestfs-actions.pod:2103 ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:2173 ../src/guestfs-actions.pod:2196 ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2268 ../src/guestfs-actions.pod:2289
7479 "This function should only be called with a root device string as returned by "
7480 "C<guestfs_inspect_os>."
7484 #: ../src/guestfs-actions.pod:2106
7486 "This returns the architecture of the inspected operating system. The "
7487 "possible return values are listed under C<guestfs_file_architecture>."
7491 #: ../src/guestfs-actions.pod:2110 ../fish/guestfish-actions.pod:1653
7493 "If the architecture could not be determined, then the string C<unknown> is "
7498 #: ../src/guestfs-actions.pod:2113 ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2211 ../src/guestfs-actions.pod:2279 ../src/guestfs-actions.pod:2314 ../src/guestfs-actions.pod:2351 ../fish/guestfish-actions.pod:1656 ../fish/guestfish-actions.pod:1702 ../fish/guestfish-actions.pod:1741 ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1827 ../fish/guestfish-actions.pod:1861
7499 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7503 #: ../src/guestfs-actions.pod:2118
7504 msgid "guestfs_inspect_get_distro"
7508 #: ../src/guestfs-actions.pod:2120
7511 " char *guestfs_inspect_get_distro (guestfs_h *g,\n"
7512 "\t\tconst char *root);\n"
7517 #: ../src/guestfs-actions.pod:2126 ../fish/guestfish-actions.pod:1665
7518 msgid "This returns the distro (distribution) of the inspected operating system."
7522 #: ../src/guestfs-actions.pod:2129 ../fish/guestfish-actions.pod:1668
7523 msgid "Currently defined distros are:"
7527 #: ../src/guestfs-actions.pod:2133 ../fish/guestfish-actions.pod:1672
7532 #: ../src/guestfs-actions.pod:2135 ../fish/guestfish-actions.pod:1674
7533 msgid "Debian or a Debian-derived distro such as Ubuntu."
7537 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1676
7542 #: ../src/guestfs-actions.pod:2139 ../fish/guestfish-actions.pod:1678
7547 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1680
7548 msgid "\"redhat-based\""
7552 #: ../src/guestfs-actions.pod:2143 ../fish/guestfish-actions.pod:1682
7553 msgid "Some Red Hat-derived distro."
7557 #: ../src/guestfs-actions.pod:2145 ../fish/guestfish-actions.pod:1684
7562 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1686
7563 msgid "Red Hat Enterprise Linux and some derivatives."
7567 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2301 ../fish/guestfish-actions.pod:1688 ../fish/guestfish-actions.pod:1814
7572 #: ../src/guestfs-actions.pod:2151 ../fish/guestfish-actions.pod:1690
7574 "Windows does not have distributions. This string is returned if the OS type "
7579 #: ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:2305 ../fish/guestfish-actions.pod:1693 ../fish/guestfish-actions.pod:1818
7584 #: ../src/guestfs-actions.pod:2156 ../fish/guestfish-actions.pod:1695
7585 msgid "The distro could not be determined."
7589 #: ../src/guestfs-actions.pod:2160 ../src/guestfs-actions.pod:2311 ../fish/guestfish-actions.pod:1699 ../fish/guestfish-actions.pod:1824
7591 "Future versions of libguestfs may return other strings here. The caller "
7592 "should be prepared to handle any string."
7596 #: ../src/guestfs-actions.pod:2168
7597 msgid "guestfs_inspect_get_filesystems"
7601 #: ../src/guestfs-actions.pod:2170
7604 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
7605 "\t\tconst char *root);\n"
7610 #: ../src/guestfs-actions.pod:2176 ../fish/guestfish-actions.pod:1711
7612 "This returns a list of all the filesystems that we think are associated with "
7613 "this operating system. This includes the root filesystem, other ordinary "
7614 "filesystems, and non-mounted devices like swap partitions."
7618 #: ../src/guestfs-actions.pod:2181 ../fish/guestfish-actions.pod:1716
7620 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7621 "to be shared between operating systems."
7625 #: ../src/guestfs-actions.pod:2184
7627 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7628 "C<guestfs_inspect_get_mountpoints>."
7632 #: ../src/guestfs-actions.pod:2191
7633 msgid "guestfs_inspect_get_major_version"
7637 #: ../src/guestfs-actions.pod:2193
7640 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
7641 "\t\tconst char *root);\n"
7646 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1729
7647 msgid "This returns the major version number of the inspected operating system."
7651 #: ../src/guestfs-actions.pod:2202 ../fish/guestfish-actions.pod:1732
7653 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7654 "popular public names used by the operating system. Notably the operating "
7655 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7656 "1). You can find out the real versions corresponding to releases of Windows "
7657 "by consulting Wikipedia or MSDN."
7661 #: ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2226 ../fish/guestfish-actions.pod:1739 ../fish/guestfish-actions.pod:1753
7662 msgid "If the version could not be determined, then C<0> is returned."
7666 #: ../src/guestfs-actions.pod:2215
7667 msgid "guestfs_inspect_get_minor_version"
7671 #: ../src/guestfs-actions.pod:2217
7674 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
7675 "\t\tconst char *root);\n"
7680 #: ../src/guestfs-actions.pod:2223 ../fish/guestfish-actions.pod:1750
7681 msgid "This returns the minor version number of the inspected operating system."
7685 #: ../src/guestfs-actions.pod:2228
7687 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7688 "C<guestfs_inspect_get_major_version>."
7692 #: ../src/guestfs-actions.pod:2233
7693 msgid "guestfs_inspect_get_mountpoints"
7697 #: ../src/guestfs-actions.pod:2235
7700 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
7701 "\t\tconst char *root);\n"
7706 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1765
7708 "This returns a hash of where we think the filesystems associated with this "
7709 "operating system should be mounted. Callers should note that this is at "
7710 "best an educated guess made by reading configuration files such as "
7715 #: ../src/guestfs-actions.pod:2246 ../fish/guestfish-actions.pod:1770
7717 "Each element in the returned hashtable has a key which is the path of the "
7718 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7719 "mounted there (eg. C</dev/sda1>)."
7723 #: ../src/guestfs-actions.pod:2251 ../fish/guestfish-actions.pod:1775
7724 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
7728 #: ../src/guestfs-actions.pod:2254
7730 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7731 "C<guestfs_inspect_get_filesystems>."
7735 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:3519 ../src/guestfs-actions.pod:5102
7737 "This function returns a NULL-terminated array of strings, or NULL if there "
7738 "was an error. The array of strings will always have length C<2n+1>, where "
7739 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
7740 "caller must free the strings and the array after use>."
7744 #: ../src/guestfs-actions.pod:2263
7745 msgid "guestfs_inspect_get_product_name"
7749 #: ../src/guestfs-actions.pod:2265
7752 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
7753 "\t\tconst char *root);\n"
7758 #: ../src/guestfs-actions.pod:2271 ../fish/guestfish-actions.pod:1788
7760 "This returns the product name of the inspected operating system. The "
7761 "product name is generally some freeform string which can be displayed to the "
7762 "user, but should not be parsed by programs."
7766 #: ../src/guestfs-actions.pod:2276 ../fish/guestfish-actions.pod:1793
7768 "If the product name could not be determined, then the string C<unknown> is "
7773 #: ../src/guestfs-actions.pod:2284
7774 msgid "guestfs_inspect_get_type"
7778 #: ../src/guestfs-actions.pod:2286
7781 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
7782 "\t\tconst char *root);\n"
7787 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1805
7789 "This returns the type of the inspected operating system. Currently defined "
7794 #: ../src/guestfs-actions.pod:2297 ../fish/guestfish-actions.pod:1810
7799 #: ../src/guestfs-actions.pod:2299 ../fish/guestfish-actions.pod:1812
7800 msgid "Any Linux-based operating system."
7804 #: ../src/guestfs-actions.pod:2303 ../fish/guestfish-actions.pod:1816
7805 msgid "Any Microsoft Windows operating system."
7809 #: ../src/guestfs-actions.pod:2307 ../fish/guestfish-actions.pod:1820
7810 msgid "The operating system type could not be determined."
7814 #: ../src/guestfs-actions.pod:2319
7815 msgid "guestfs_inspect_os"
7819 #: ../src/guestfs-actions.pod:2321
7822 " char **guestfs_inspect_os (guestfs_h *g);\n"
7827 #: ../src/guestfs-actions.pod:2323 ../fish/guestfish-actions.pod:1833
7829 "This function uses other libguestfs functions and certain heuristics to "
7830 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
7831 "for operating systems."
7835 #: ../src/guestfs-actions.pod:2327 ../fish/guestfish-actions.pod:1837
7836 msgid "The list returned is empty if no operating systems were found."
7840 #: ../src/guestfs-actions.pod:2329 ../fish/guestfish-actions.pod:1839
7842 "If one operating system was found, then this returns a list with a single "
7843 "element, which is the name of the root filesystem of this operating system. "
7844 "It is also possible for this function to return a list containing more than "
7845 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
7846 "element being the root filesystem of one of the operating systems."
7850 #: ../src/guestfs-actions.pod:2336
7852 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
7853 "functions in order to query further information about each operating system, "
7854 "such as the name and version."
7858 #: ../src/guestfs-actions.pod:2341
7860 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
7861 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
7862 "the contents. This should be called with no disks currently mounted. The "
7863 "function may also use Augeas, so any existing Augeas handle will be closed."
7867 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1857
7869 "This function cannot decrypt encrypted disks. The caller must do that first "
7870 "(supplying the necessary keys) if the disk is encrypted."
7874 #: ../src/guestfs-actions.pod:2353 ../src/guestfs-actions.pod:2558 ../src/guestfs-actions.pod:2614
7875 msgid "See also C<guestfs_list_filesystems>."
7879 #: ../src/guestfs-actions.pod:2359
7880 msgid "guestfs_is_blockdev"
7884 #: ../src/guestfs-actions.pod:2361
7887 " int guestfs_is_blockdev (guestfs_h *g,\n"
7888 "\t\tconst char *path);\n"
7893 #: ../src/guestfs-actions.pod:2364 ../fish/guestfish-actions.pod:1869
7895 "This returns C<true> if and only if there is a block device with the given "
7900 #: ../src/guestfs-actions.pod:2367 ../src/guestfs-actions.pod:2390 ../src/guestfs-actions.pod:2414 ../src/guestfs-actions.pod:2426 ../src/guestfs-actions.pod:2439 ../src/guestfs-actions.pod:2483 ../src/guestfs-actions.pod:2495
7901 msgid "See also C<guestfs_stat>."
7905 #: ../src/guestfs-actions.pod:2371
7906 msgid "guestfs_is_busy"
7910 #: ../src/guestfs-actions.pod:2373
7913 " int guestfs_is_busy (guestfs_h *g);\n"
7918 #: ../src/guestfs-actions.pod:2375 ../fish/guestfish-actions.pod:1878
7920 "This returns true iff this handle is busy processing a command (in the "
7925 #: ../src/guestfs-actions.pod:2382
7926 msgid "guestfs_is_chardev"
7930 #: ../src/guestfs-actions.pod:2384
7933 " int guestfs_is_chardev (guestfs_h *g,\n"
7934 "\t\tconst char *path);\n"
7939 #: ../src/guestfs-actions.pod:2387 ../fish/guestfish-actions.pod:1887
7941 "This returns C<true> if and only if there is a character device with the "
7942 "given C<path> name."
7946 #: ../src/guestfs-actions.pod:2394
7947 msgid "guestfs_is_config"
7951 #: ../src/guestfs-actions.pod:2396
7954 " int guestfs_is_config (guestfs_h *g);\n"
7959 #: ../src/guestfs-actions.pod:2398 ../fish/guestfish-actions.pod:1896
7961 "This returns true iff this handle is being configured (in the C<CONFIG> "
7966 #: ../src/guestfs-actions.pod:2405
7967 msgid "guestfs_is_dir"
7971 #: ../src/guestfs-actions.pod:2407
7974 " int guestfs_is_dir (guestfs_h *g,\n"
7975 "\t\tconst char *path);\n"
7980 #: ../src/guestfs-actions.pod:2410 ../fish/guestfish-actions.pod:1905
7982 "This returns C<true> if and only if there is a directory with the given "
7983 "C<path> name. Note that it returns false for other objects like files."
7987 #: ../src/guestfs-actions.pod:2418
7988 msgid "guestfs_is_fifo"
7992 #: ../src/guestfs-actions.pod:2420
7995 " int guestfs_is_fifo (guestfs_h *g,\n"
7996 "\t\tconst char *path);\n"
8001 #: ../src/guestfs-actions.pod:2423 ../fish/guestfish-actions.pod:1915
8003 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8004 "given C<path> name."
8008 #: ../src/guestfs-actions.pod:2430
8009 msgid "guestfs_is_file"
8013 #: ../src/guestfs-actions.pod:2432
8016 " int guestfs_is_file (guestfs_h *g,\n"
8017 "\t\tconst char *path);\n"
8022 #: ../src/guestfs-actions.pod:2435 ../fish/guestfish-actions.pod:1924
8024 "This returns C<true> if and only if there is a regular file with the given "
8025 "C<path> name. Note that it returns false for other objects like "
8030 #: ../src/guestfs-actions.pod:2443
8031 msgid "guestfs_is_launching"
8035 #: ../src/guestfs-actions.pod:2445
8038 " int guestfs_is_launching (guestfs_h *g);\n"
8043 #: ../src/guestfs-actions.pod:2447 ../fish/guestfish-actions.pod:1934
8045 "This returns true iff this handle is launching the subprocess (in the "
8046 "C<LAUNCHING> state)."
8050 #: ../src/guestfs-actions.pod:2454
8051 msgid "guestfs_is_lv"
8055 #: ../src/guestfs-actions.pod:2456
8058 " int guestfs_is_lv (guestfs_h *g,\n"
8059 "\t\tconst char *device);\n"
8064 #: ../src/guestfs-actions.pod:2459 ../fish/guestfish-actions.pod:1943
8066 "This command tests whether C<device> is a logical volume, and returns true "
8067 "iff this is the case."
8071 #: ../src/guestfs-actions.pod:2464
8072 msgid "guestfs_is_ready"
8076 #: ../src/guestfs-actions.pod:2466
8079 " int guestfs_is_ready (guestfs_h *g);\n"
8084 #: ../src/guestfs-actions.pod:2468 ../fish/guestfish-actions.pod:1950
8086 "This returns true iff this handle is ready to accept commands (in the "
8091 #: ../src/guestfs-actions.pod:2475
8092 msgid "guestfs_is_socket"
8096 #: ../src/guestfs-actions.pod:2477
8099 " int guestfs_is_socket (guestfs_h *g,\n"
8100 "\t\tconst char *path);\n"
8105 #: ../src/guestfs-actions.pod:2480 ../fish/guestfish-actions.pod:1959
8107 "This returns C<true> if and only if there is a Unix domain socket with the "
8108 "given C<path> name."
8112 #: ../src/guestfs-actions.pod:2487
8113 msgid "guestfs_is_symlink"
8117 #: ../src/guestfs-actions.pod:2489
8120 " int guestfs_is_symlink (guestfs_h *g,\n"
8121 "\t\tconst char *path);\n"
8126 #: ../src/guestfs-actions.pod:2492 ../fish/guestfish-actions.pod:1968
8128 "This returns C<true> if and only if there is a symbolic link with the given "
8133 #: ../src/guestfs-actions.pod:2499
8134 msgid "guestfs_kill_subprocess"
8138 #: ../src/guestfs-actions.pod:2501
8141 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8146 #: ../src/guestfs-actions.pod:2503 ../fish/guestfish-actions.pod:1977
8147 msgid "This kills the qemu subprocess. You should never need to call this."
8151 #: ../src/guestfs-actions.pod:2507
8152 msgid "guestfs_launch"
8156 #: ../src/guestfs-actions.pod:2509
8159 " int guestfs_launch (guestfs_h *g);\n"
8164 #: ../src/guestfs-actions.pod:2511 ../fish/guestfish-actions.pod:1985
8166 "Internally libguestfs is implemented by running a virtual machine using "
8171 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1988
8173 "You should call this after configuring the handle (eg. adding drives) but "
8174 "before performing any actions."
8178 #: ../src/guestfs-actions.pod:2519
8179 msgid "guestfs_lchown"
8183 #: ../src/guestfs-actions.pod:2521
8186 " int guestfs_lchown (guestfs_h *g,\n"
8189 "\t\tconst char *path);\n"
8194 #: ../src/guestfs-actions.pod:2526
8196 "Change the file owner to C<owner> and group to C<group>. This is like "
8197 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8198 "changed, not the target."
8202 #: ../src/guestfs-actions.pod:2536
8203 msgid "guestfs_lgetxattrs"
8207 #: ../src/guestfs-actions.pod:2538
8210 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8211 "\t\tconst char *path);\n"
8216 #: ../src/guestfs-actions.pod:2541
8218 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8219 "then it returns the extended attributes of the link itself."
8223 #: ../src/guestfs-actions.pod:2550
8224 msgid "guestfs_list_devices"
8228 #: ../src/guestfs-actions.pod:2552
8231 " char **guestfs_list_devices (guestfs_h *g);\n"
8236 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:2015
8237 msgid "List all the block devices."
8241 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:2017
8242 msgid "The full block device names are returned, eg. C</dev/sda>."
8246 #: ../src/guestfs-actions.pod:2564
8247 msgid "guestfs_list_filesystems"
8251 #: ../src/guestfs-actions.pod:2566
8254 " char **guestfs_list_filesystems (guestfs_h *g);\n"
8259 #: ../src/guestfs-actions.pod:2568 ../fish/guestfish-actions.pod:2025
8261 "This inspection command looks for filesystems on partitions, block devices "
8262 "and logical volumes, returning a list of devices containing filesystems and "
8267 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:2029
8269 "The return value is a hash, where the keys are the devices containing "
8270 "filesystems, and the values are the filesystem types. For example:"
8274 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:2033
8277 " \"/dev/sda1\" => \"ntfs\"\n"
8278 " \"/dev/sda2\" => \"ext2\"\n"
8279 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8280 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8285 #: ../src/guestfs-actions.pod:2581 ../fish/guestfish-actions.pod:2038
8287 "The value can have the special value \"unknown\", meaning the content of the "
8288 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8292 #: ../src/guestfs-actions.pod:2585
8294 "This command runs other libguestfs commands, which might include "
8295 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8296 "soon after launch and only when nothing is mounted."
8300 #: ../src/guestfs-actions.pod:2589
8302 "Not all of the filesystems returned will be mountable. In particular, swap "
8303 "partitions are returned in the list. Also this command does not check that "
8304 "each filesystem found is valid and mountable, and some filesystems might be "
8305 "mountable but require special options. Filesystems may not all belong to a "
8306 "single logical operating system (use C<guestfs_inspect_os> to look for "
8311 #: ../src/guestfs-actions.pod:2603
8312 msgid "guestfs_list_partitions"
8316 #: ../src/guestfs-actions.pod:2605
8319 " char **guestfs_list_partitions (guestfs_h *g);\n"
8324 #: ../src/guestfs-actions.pod:2607 ../fish/guestfish-actions.pod:2058
8325 msgid "List all the partitions detected on all block devices."
8329 #: ../src/guestfs-actions.pod:2609 ../fish/guestfish-actions.pod:2060
8330 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8334 #: ../src/guestfs-actions.pod:2611
8336 "This does not return logical volumes. For that you will need to call "
8341 #: ../src/guestfs-actions.pod:2620
8346 #: ../src/guestfs-actions.pod:2622
8349 " char *guestfs_ll (guestfs_h *g,\n"
8350 "\t\tconst char *directory);\n"
8355 #: ../src/guestfs-actions.pod:2625 ../fish/guestfish-actions.pod:2071
8357 "List the files in C<directory> (relative to the root directory, there is no "
8358 "cwd) in the format of 'ls -la'."
8362 #: ../src/guestfs-actions.pod:2628 ../fish/guestfish-actions.pod:2074
8364 "This command is mostly useful for interactive sessions. It is I<not> "
8365 "intended that you try to parse the output string."
8369 #: ../src/guestfs-actions.pod:2634
8374 #: ../src/guestfs-actions.pod:2636
8377 " int guestfs_ln (guestfs_h *g,\n"
8378 "\t\tconst char *target,\n"
8379 "\t\tconst char *linkname);\n"
8384 #: ../src/guestfs-actions.pod:2640 ../fish/guestfish-actions.pod:2081
8385 msgid "This command creates a hard link using the C<ln> command."
8389 #: ../src/guestfs-actions.pod:2644
8390 msgid "guestfs_ln_f"
8394 #: ../src/guestfs-actions.pod:2646
8397 " int guestfs_ln_f (guestfs_h *g,\n"
8398 "\t\tconst char *target,\n"
8399 "\t\tconst char *linkname);\n"
8404 #: ../src/guestfs-actions.pod:2650 ../fish/guestfish-actions.pod:2087
8406 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8407 "option removes the link (C<linkname>) if it exists already."
8411 #: ../src/guestfs-actions.pod:2655
8412 msgid "guestfs_ln_s"
8416 #: ../src/guestfs-actions.pod:2657
8419 " int guestfs_ln_s (guestfs_h *g,\n"
8420 "\t\tconst char *target,\n"
8421 "\t\tconst char *linkname);\n"
8426 #: ../src/guestfs-actions.pod:2661 ../fish/guestfish-actions.pod:2094
8427 msgid "This command creates a symbolic link using the C<ln -s> command."
8431 #: ../src/guestfs-actions.pod:2665
8432 msgid "guestfs_ln_sf"
8436 #: ../src/guestfs-actions.pod:2667
8439 " int guestfs_ln_sf (guestfs_h *g,\n"
8440 "\t\tconst char *target,\n"
8441 "\t\tconst char *linkname);\n"
8446 #: ../src/guestfs-actions.pod:2671 ../fish/guestfish-actions.pod:2100
8448 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8449 "option removes the link (C<linkname>) if it exists already."
8453 #: ../src/guestfs-actions.pod:2676
8454 msgid "guestfs_lremovexattr"
8458 #: ../src/guestfs-actions.pod:2678
8461 " int guestfs_lremovexattr (guestfs_h *g,\n"
8462 "\t\tconst char *xattr,\n"
8463 "\t\tconst char *path);\n"
8468 #: ../src/guestfs-actions.pod:2682
8470 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8471 "link, then it removes an extended attribute of the link itself."
8475 #: ../src/guestfs-actions.pod:2688
8480 #: ../src/guestfs-actions.pod:2690
8483 " char **guestfs_ls (guestfs_h *g,\n"
8484 "\t\tconst char *directory);\n"
8489 #: ../src/guestfs-actions.pod:2693 ../fish/guestfish-actions.pod:2115
8491 "List the files in C<directory> (relative to the root directory, there is no "
8492 "cwd). The '.' and '..' entries are not returned, but hidden files are "
8497 #: ../src/guestfs-actions.pod:2697
8499 "This command is mostly useful for interactive sessions. Programs should "
8500 "probably use C<guestfs_readdir> instead."
8504 #: ../src/guestfs-actions.pod:2704
8505 msgid "guestfs_lsetxattr"
8509 #: ../src/guestfs-actions.pod:2706
8512 " int guestfs_lsetxattr (guestfs_h *g,\n"
8513 "\t\tconst char *xattr,\n"
8514 "\t\tconst char *val,\n"
8516 "\t\tconst char *path);\n"
8521 #: ../src/guestfs-actions.pod:2712
8523 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8524 "then it sets an extended attribute of the link itself."
8528 #: ../src/guestfs-actions.pod:2718
8529 msgid "guestfs_lstat"
8533 #: ../src/guestfs-actions.pod:2720
8536 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8537 "\t\tconst char *path);\n"
8542 #: ../src/guestfs-actions.pod:2723 ../src/guestfs-actions.pod:4767 ../fish/guestfish-actions.pod:2134 ../fish/guestfish-actions.pod:3688
8543 msgid "Returns file information for the given C<path>."
8547 #: ../src/guestfs-actions.pod:2725
8549 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8550 "link, then the link is stat-ed, not the file it refers to."
8554 #: ../src/guestfs-actions.pod:2729 ../fish/guestfish-actions.pod:2140
8555 msgid "This is the same as the C<lstat(2)> system call."
8559 #: ../src/guestfs-actions.pod:2731 ../src/guestfs-actions.pod:4771
8561 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8562 "error. I<The caller must call C<guestfs_free_stat> after use>."
8566 #: ../src/guestfs-actions.pod:2735
8567 msgid "guestfs_lstatlist"
8571 #: ../src/guestfs-actions.pod:2737
8574 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8575 "\t\tconst char *path,\n"
8576 "\t\tchar *const *names);\n"
8581 #: ../src/guestfs-actions.pod:2741
8583 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8584 "files, where all files are in the directory C<path>. C<names> is the list "
8585 "of files from this directory."
8589 #: ../src/guestfs-actions.pod:2745 ../fish/guestfish-actions.pod:2150
8591 "On return you get a list of stat structs, with a one-to-one correspondence "
8592 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8593 "then the C<ino> field of that structure is set to C<-1>."
8597 #: ../src/guestfs-actions.pod:2750
8599 "This call is intended for programs that want to efficiently list a directory "
8600 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
8601 "for a similarly efficient call for getting extended attributes. Very long "
8602 "directory listings might cause the protocol message size to be exceeded, "
8603 "causing this call to fail. The caller must split up such requests into "
8604 "smaller groups of names."
8608 #: ../src/guestfs-actions.pod:2758
8610 "This function returns a C<struct guestfs_stat_list *> (see "
8611 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
8612 "must call C<guestfs_free_stat_list> after use>."
8616 #: ../src/guestfs-actions.pod:2763
8617 msgid "guestfs_luks_add_key"
8621 #: ../src/guestfs-actions.pod:2765
8624 " int guestfs_luks_add_key (guestfs_h *g,\n"
8625 "\t\tconst char *device,\n"
8626 "\t\tconst char *key,\n"
8627 "\t\tconst char *newkey,\n"
8628 "\t\tint keyslot);\n"
8633 #: ../src/guestfs-actions.pod:2771 ../fish/guestfish-actions.pod:2167
8635 "This command adds a new key on LUKS device C<device>. C<key> is any "
8636 "existing key, and is used to access the device. C<newkey> is the new key to "
8637 "add. C<keyslot> is the key slot that will be replaced."
8641 #: ../src/guestfs-actions.pod:2776
8643 "Note that if C<keyslot> already contains a key, then this command will "
8644 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
8648 #: ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:2836 ../src/guestfs-actions.pod:2853 ../src/guestfs-actions.pod:2882 ../src/guestfs-actions.pod:2898
8650 "This function takes a key or passphrase parameter which could contain "
8651 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
8656 #: ../src/guestfs-actions.pod:2786
8657 msgid "guestfs_luks_close"
8661 #: ../src/guestfs-actions.pod:2788
8664 " int guestfs_luks_close (guestfs_h *g,\n"
8665 "\t\tconst char *device);\n"
8670 #: ../src/guestfs-actions.pod:2791
8672 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
8673 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
8674 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
8675 "underlying block device."
8679 #: ../src/guestfs-actions.pod:2799
8680 msgid "guestfs_luks_format"
8684 #: ../src/guestfs-actions.pod:2801
8687 " int guestfs_luks_format (guestfs_h *g,\n"
8688 "\t\tconst char *device,\n"
8689 "\t\tconst char *key,\n"
8690 "\t\tint keyslot);\n"
8695 #: ../src/guestfs-actions.pod:2806 ../fish/guestfish-actions.pod:2193
8697 "This command erases existing data on C<device> and formats the device as a "
8698 "LUKS encrypted device. C<key> is the initial key, which is added to key "
8699 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
8703 #: ../src/guestfs-actions.pod:2813 ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2935 ../src/guestfs-actions.pod:3647 ../src/guestfs-actions.pod:4308 ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4649 ../src/guestfs-actions.pod:4672 ../src/guestfs-actions.pod:5637 ../fish/guestfish-actions.pod:2201 ../fish/guestfish-actions.pod:2214 ../fish/guestfish-actions.pod:2285 ../fish/guestfish-actions.pod:2800 ../fish/guestfish-actions.pod:3307 ../fish/guestfish-actions.pod:3587 ../fish/guestfish-actions.pod:3603 ../fish/guestfish-actions.pod:3618 ../fish/guestfish-actions.pod:4333
8705 "B<This command is dangerous. Without careful use you can easily destroy all "
8710 #: ../src/guestfs-actions.pod:2820
8711 msgid "guestfs_luks_format_cipher"
8715 #: ../src/guestfs-actions.pod:2822
8718 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
8719 "\t\tconst char *device,\n"
8720 "\t\tconst char *key,\n"
8721 "\t\tint keyslot,\n"
8722 "\t\tconst char *cipher);\n"
8727 #: ../src/guestfs-actions.pod:2828
8729 "This command is the same as C<guestfs_luks_format> but it also allows you to "
8730 "set the C<cipher> used."
8734 #: ../src/guestfs-actions.pod:2840
8735 msgid "guestfs_luks_kill_slot"
8739 #: ../src/guestfs-actions.pod:2842
8742 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
8743 "\t\tconst char *device,\n"
8744 "\t\tconst char *key,\n"
8745 "\t\tint keyslot);\n"
8750 #: ../src/guestfs-actions.pod:2847 ../fish/guestfish-actions.pod:2221
8752 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
8753 "device C<device>. C<key> must be one of the I<other> keys."
8757 #: ../src/guestfs-actions.pod:2857
8758 msgid "guestfs_luks_open"
8762 #: ../src/guestfs-actions.pod:2859
8765 " int guestfs_luks_open (guestfs_h *g,\n"
8766 "\t\tconst char *device,\n"
8767 "\t\tconst char *key,\n"
8768 "\t\tconst char *mapname);\n"
8773 #: ../src/guestfs-actions.pod:2864 ../fish/guestfish-actions.pod:2232
8775 "This command opens a block device which has been encrypted according to the "
8776 "Linux Unified Key Setup (LUKS) standard."
8780 #: ../src/guestfs-actions.pod:2867 ../fish/guestfish-actions.pod:2235
8781 msgid "C<device> is the encrypted block device or partition."
8785 #: ../src/guestfs-actions.pod:2869 ../fish/guestfish-actions.pod:2237
8787 "The caller must supply one of the keys associated with the LUKS block "
8788 "device, in the C<key> parameter."
8792 #: ../src/guestfs-actions.pod:2872 ../fish/guestfish-actions.pod:2240
8794 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
8795 "writes to this block device are decrypted from and encrypted to the "
8796 "underlying C<device> respectively."
8800 #: ../src/guestfs-actions.pod:2876
8802 "If this block device contains LVM volume groups, then calling "
8803 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
8808 #: ../src/guestfs-actions.pod:2886
8809 msgid "guestfs_luks_open_ro"
8813 #: ../src/guestfs-actions.pod:2888
8816 " int guestfs_luks_open_ro (guestfs_h *g,\n"
8817 "\t\tconst char *device,\n"
8818 "\t\tconst char *key,\n"
8819 "\t\tconst char *mapname);\n"
8824 #: ../src/guestfs-actions.pod:2893
8826 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
8831 #: ../src/guestfs-actions.pod:2902
8832 msgid "guestfs_lvcreate"
8836 #: ../src/guestfs-actions.pod:2904
8839 " int guestfs_lvcreate (guestfs_h *g,\n"
8840 "\t\tconst char *logvol,\n"
8841 "\t\tconst char *volgroup,\n"
8842 "\t\tint mbytes);\n"
8847 #: ../src/guestfs-actions.pod:2909 ../fish/guestfish-actions.pod:2265
8849 "This creates an LVM logical volume called C<logvol> on the volume group "
8850 "C<volgroup>, with C<size> megabytes."
8854 #: ../src/guestfs-actions.pod:2914
8855 msgid "guestfs_lvm_clear_filter"
8859 #: ../src/guestfs-actions.pod:2916
8862 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
8867 #: ../src/guestfs-actions.pod:2918
8869 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
8870 "see every block device."
8874 #: ../src/guestfs-actions.pod:2921 ../src/guestfs-actions.pod:2957 ../fish/guestfish-actions.pod:2275 ../fish/guestfish-actions.pod:2306
8875 msgid "This command also clears the LVM cache and performs a volume group scan."
8879 #: ../src/guestfs-actions.pod:2926
8880 msgid "guestfs_lvm_remove_all"
8884 #: ../src/guestfs-actions.pod:2928
8887 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
8892 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2282
8894 "This command removes all LVM logical volumes, volume groups and physical "
8899 #: ../src/guestfs-actions.pod:2938
8900 msgid "guestfs_lvm_set_filter"
8904 #: ../src/guestfs-actions.pod:2940
8907 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
8908 "\t\tchar *const *devices);\n"
8913 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2292
8915 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
8916 "block devices in the list C<devices>, and will ignore all other attached "
8921 #: ../src/guestfs-actions.pod:2947 ../fish/guestfish-actions.pod:2296
8923 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
8924 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
8925 "there are two types of duplication possible: either cloned PVs/VGs which "
8926 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
8927 "same name. In normal operation you cannot create this situation, but you "
8928 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
8929 "inside the LVM metadata."
8933 #: ../src/guestfs-actions.pod:2960 ../fish/guestfish-actions.pod:2309
8934 msgid "You can filter whole block devices or individual partitions."
8938 #: ../src/guestfs-actions.pod:2962 ../fish/guestfish-actions.pod:2311
8940 "You cannot use this if any VG is currently in use (eg. contains a mounted "
8941 "filesystem), even if you are not filtering out that VG."
8945 #: ../src/guestfs-actions.pod:2968
8946 msgid "guestfs_lvremove"
8950 #: ../src/guestfs-actions.pod:2970
8953 " int guestfs_lvremove (guestfs_h *g,\n"
8954 "\t\tconst char *device);\n"
8959 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2319
8961 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
8962 "LV, such as C</dev/VG/LV>."
8966 #: ../src/guestfs-actions.pod:2976 ../fish/guestfish-actions.pod:2322
8968 "You can also remove all LVs in a volume group by specifying the VG name, "
8973 #: ../src/guestfs-actions.pod:2981
8974 msgid "guestfs_lvrename"
8978 #: ../src/guestfs-actions.pod:2983
8981 " int guestfs_lvrename (guestfs_h *g,\n"
8982 "\t\tconst char *logvol,\n"
8983 "\t\tconst char *newlogvol);\n"
8988 #: ../src/guestfs-actions.pod:2987 ../fish/guestfish-actions.pod:2329
8989 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
8993 #: ../src/guestfs-actions.pod:2991
8994 msgid "guestfs_lvresize"
8998 #: ../src/guestfs-actions.pod:2993
9001 " int guestfs_lvresize (guestfs_h *g,\n"
9002 "\t\tconst char *device,\n"
9003 "\t\tint mbytes);\n"
9008 #: ../src/guestfs-actions.pod:2997 ../fish/guestfish-actions.pod:2335
9010 "This resizes (expands or shrinks) an existing LVM logical volume to "
9011 "C<mbytes>. When reducing, data in the reduced part is lost."
9015 #: ../src/guestfs-actions.pod:3003
9016 msgid "guestfs_lvresize_free"
9020 #: ../src/guestfs-actions.pod:3005
9023 " int guestfs_lvresize_free (guestfs_h *g,\n"
9024 "\t\tconst char *lv,\n"
9025 "\t\tint percent);\n"
9030 #: ../src/guestfs-actions.pod:3009 ../fish/guestfish-actions.pod:2343
9032 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9033 "remaining free space in the volume group. Commonly you would call this with "
9034 "pc = 100 which expands the logical volume as much as possible, using all "
9035 "remaining free space in the volume group."
9039 #: ../src/guestfs-actions.pod:3017
9044 #: ../src/guestfs-actions.pod:3019
9047 " char **guestfs_lvs (guestfs_h *g);\n"
9052 #: ../src/guestfs-actions.pod:3021 ../fish/guestfish-actions.pod:2353
9054 "List all the logical volumes detected. This is the equivalent of the "
9055 "L<lvs(8)> command."
9059 #: ../src/guestfs-actions.pod:3024 ../fish/guestfish-actions.pod:2356
9061 "This returns a list of the logical volume device names "
9062 "(eg. C</dev/VolGroup00/LogVol00>)."
9066 #: ../src/guestfs-actions.pod:3027
9067 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
9071 #: ../src/guestfs-actions.pod:3033
9072 msgid "guestfs_lvs_full"
9076 #: ../src/guestfs-actions.pod:3035
9079 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
9084 #: ../src/guestfs-actions.pod:3037 ../fish/guestfish-actions.pod:2365
9086 "List all the logical volumes detected. This is the equivalent of the "
9087 "L<lvs(8)> command. The \"full\" version includes all fields."
9091 #: ../src/guestfs-actions.pod:3040
9093 "This function returns a C<struct guestfs_lvm_lv_list *> (see "
9094 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
9095 "must call C<guestfs_free_lvm_lv_list> after use>."
9099 #: ../src/guestfs-actions.pod:3045
9100 msgid "guestfs_lvuuid"
9104 #: ../src/guestfs-actions.pod:3047
9107 " char *guestfs_lvuuid (guestfs_h *g,\n"
9108 "\t\tconst char *device);\n"
9113 #: ../src/guestfs-actions.pod:3050 ../fish/guestfish-actions.pod:2372
9114 msgid "This command returns the UUID of the LVM LV C<device>."
9118 #: ../src/guestfs-actions.pod:3055
9119 msgid "guestfs_lxattrlist"
9123 #: ../src/guestfs-actions.pod:3057
9126 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
9127 "\t\tconst char *path,\n"
9128 "\t\tchar *const *names);\n"
9133 #: ../src/guestfs-actions.pod:3061 ../fish/guestfish-actions.pod:2378
9135 "This call allows you to get the extended attributes of multiple files, where "
9136 "all files are in the directory C<path>. C<names> is the list of files from "
9141 #: ../src/guestfs-actions.pod:3065 ../fish/guestfish-actions.pod:2382
9143 "On return you get a flat list of xattr structs which must be interpreted "
9144 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9145 "C<attrval> in this struct is zero-length to indicate there was an error "
9146 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9147 "number (the number of following attributes for this file, which could be "
9148 "C<\"0\">). Then after the first xattr struct are the zero or more "
9149 "attributes for the first named file. This repeats for the second and "
9154 #: ../src/guestfs-actions.pod:3075
9156 "This call is intended for programs that want to efficiently list a directory "
9157 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9158 "a similarly efficient call for getting standard stats. Very long directory "
9159 "listings might cause the protocol message size to be exceeded, causing this "
9160 "call to fail. The caller must split up such requests into smaller groups of "
9165 #: ../src/guestfs-actions.pod:3088
9166 msgid "guestfs_mkdir"
9170 #: ../src/guestfs-actions.pod:3090
9173 " int guestfs_mkdir (guestfs_h *g,\n"
9174 "\t\tconst char *path);\n"
9179 #: ../src/guestfs-actions.pod:3093 ../fish/guestfish-actions.pod:2404
9180 msgid "Create a directory named C<path>."
9184 #: ../src/guestfs-actions.pod:3097
9185 msgid "guestfs_mkdir_mode"
9189 #: ../src/guestfs-actions.pod:3099
9192 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9193 "\t\tconst char *path,\n"
9199 #: ../src/guestfs-actions.pod:3103 ../fish/guestfish-actions.pod:2410
9201 "This command creates a directory, setting the initial permissions of the "
9202 "directory to C<mode>."
9206 #: ../src/guestfs-actions.pod:3106 ../fish/guestfish-actions.pod:2413
9208 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9209 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9214 #: ../src/guestfs-actions.pod:3110
9215 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9219 #: ../src/guestfs-actions.pod:3114
9220 msgid "guestfs_mkdir_p"
9224 #: ../src/guestfs-actions.pod:3116
9227 " int guestfs_mkdir_p (guestfs_h *g,\n"
9228 "\t\tconst char *path);\n"
9233 #: ../src/guestfs-actions.pod:3119 ../fish/guestfish-actions.pod:2423
9235 "Create a directory named C<path>, creating any parent directories as "
9236 "necessary. This is like the C<mkdir -p> shell command."
9240 #: ../src/guestfs-actions.pod:3124
9241 msgid "guestfs_mkdtemp"
9245 #: ../src/guestfs-actions.pod:3126
9248 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9249 "\t\tconst char *template);\n"
9254 #: ../src/guestfs-actions.pod:3129 ../fish/guestfish-actions.pod:2430
9256 "This command creates a temporary directory. The C<template> parameter "
9257 "should be a full pathname for the temporary directory name with the final "
9258 "six characters being \"XXXXXX\"."
9262 #: ../src/guestfs-actions.pod:3134 ../fish/guestfish-actions.pod:2435
9264 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9265 "being suitable for Windows filesystems."
9269 #: ../src/guestfs-actions.pod:3137 ../fish/guestfish-actions.pod:2438
9270 msgid "The name of the temporary directory that was created is returned."
9274 #: ../src/guestfs-actions.pod:3140 ../fish/guestfish-actions.pod:2441
9275 msgid "The temporary directory is created with mode 0700 and is owned by root."
9279 #: ../src/guestfs-actions.pod:3143 ../fish/guestfish-actions.pod:2444
9281 "The caller is responsible for deleting the temporary directory and its "
9282 "contents after use."
9286 #: ../src/guestfs-actions.pod:3146 ../fish/guestfish-actions.pod:2447
9287 msgid "See also: L<mkdtemp(3)>"
9291 #: ../src/guestfs-actions.pod:3151
9292 msgid "guestfs_mke2fs_J"
9296 #: ../src/guestfs-actions.pod:3153
9299 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9300 "\t\tconst char *fstype,\n"
9301 "\t\tint blocksize,\n"
9302 "\t\tconst char *device,\n"
9303 "\t\tconst char *journal);\n"
9308 #: ../src/guestfs-actions.pod:3159 ../fish/guestfish-actions.pod:2453
9310 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9311 "C<journal>. It is equivalent to the command:"
9315 #: ../src/guestfs-actions.pod:3163 ../fish/guestfish-actions.pod:2457
9318 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9323 #: ../src/guestfs-actions.pod:3165
9324 msgid "See also C<guestfs_mke2journal>."
9328 #: ../src/guestfs-actions.pod:3169
9329 msgid "guestfs_mke2fs_JL"
9333 #: ../src/guestfs-actions.pod:3171
9336 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9337 "\t\tconst char *fstype,\n"
9338 "\t\tint blocksize,\n"
9339 "\t\tconst char *device,\n"
9340 "\t\tconst char *label);\n"
9345 #: ../src/guestfs-actions.pod:3177 ../fish/guestfish-actions.pod:2465
9347 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9348 "the journal labeled C<label>."
9352 #: ../src/guestfs-actions.pod:3180
9353 msgid "See also C<guestfs_mke2journal_L>."
9357 #: ../src/guestfs-actions.pod:3184
9358 msgid "guestfs_mke2fs_JU"
9362 #: ../src/guestfs-actions.pod:3186
9365 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9366 "\t\tconst char *fstype,\n"
9367 "\t\tint blocksize,\n"
9368 "\t\tconst char *device,\n"
9369 "\t\tconst char *uuid);\n"
9374 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2474
9376 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9377 "the journal with UUID C<uuid>."
9381 #: ../src/guestfs-actions.pod:3195
9382 msgid "See also C<guestfs_mke2journal_U>."
9386 #: ../src/guestfs-actions.pod:3199
9387 msgid "guestfs_mke2journal"
9391 #: ../src/guestfs-actions.pod:3201
9394 " int guestfs_mke2journal (guestfs_h *g,\n"
9395 "\t\tint blocksize,\n"
9396 "\t\tconst char *device);\n"
9401 #: ../src/guestfs-actions.pod:3205 ../fish/guestfish-actions.pod:2483
9403 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9408 #: ../src/guestfs-actions.pod:3208 ../fish/guestfish-actions.pod:2486
9411 " mke2fs -O journal_dev -b blocksize device\n"
9416 #: ../src/guestfs-actions.pod:3212
9417 msgid "guestfs_mke2journal_L"
9421 #: ../src/guestfs-actions.pod:3214
9424 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9425 "\t\tint blocksize,\n"
9426 "\t\tconst char *label,\n"
9427 "\t\tconst char *device);\n"
9432 #: ../src/guestfs-actions.pod:3219 ../fish/guestfish-actions.pod:2492
9433 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9437 #: ../src/guestfs-actions.pod:3223
9438 msgid "guestfs_mke2journal_U"
9442 #: ../src/guestfs-actions.pod:3225
9445 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9446 "\t\tint blocksize,\n"
9447 "\t\tconst char *uuid,\n"
9448 "\t\tconst char *device);\n"
9453 #: ../src/guestfs-actions.pod:3230 ../fish/guestfish-actions.pod:2498
9454 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9458 #: ../src/guestfs-actions.pod:3234
9459 msgid "guestfs_mkfifo"
9463 #: ../src/guestfs-actions.pod:3236
9466 " int guestfs_mkfifo (guestfs_h *g,\n"
9468 "\t\tconst char *path);\n"
9473 #: ../src/guestfs-actions.pod:3240
9475 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9476 "is just a convenient wrapper around C<guestfs_mknod>."
9480 #: ../src/guestfs-actions.pod:3248
9481 msgid "guestfs_mkfs"
9485 #: ../src/guestfs-actions.pod:3250
9488 " int guestfs_mkfs (guestfs_h *g,\n"
9489 "\t\tconst char *fstype,\n"
9490 "\t\tconst char *device);\n"
9495 #: ../src/guestfs-actions.pod:3254 ../fish/guestfish-actions.pod:2514
9497 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9498 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9502 #: ../src/guestfs-actions.pod:3260
9503 msgid "guestfs_mkfs_b"
9507 #: ../src/guestfs-actions.pod:3262
9510 " int guestfs_mkfs_b (guestfs_h *g,\n"
9511 "\t\tconst char *fstype,\n"
9512 "\t\tint blocksize,\n"
9513 "\t\tconst char *device);\n"
9518 #: ../src/guestfs-actions.pod:3267
9520 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9521 "block size of the resulting filesystem. Supported block sizes depend on the "
9522 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9526 #: ../src/guestfs-actions.pod:3272 ../fish/guestfish-actions.pod:2527
9528 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9533 #: ../src/guestfs-actions.pod:3277
9534 msgid "guestfs_mkmountpoint"
9538 #: ../src/guestfs-actions.pod:3279
9541 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9542 "\t\tconst char *exemptpath);\n"
9547 #: ../src/guestfs-actions.pod:3282
9549 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9550 "that can be used to create extra mountpoints before mounting the first "
9555 #: ../src/guestfs-actions.pod:3286 ../fish/guestfish-actions.pod:2538
9557 "These calls are I<only> necessary in some very limited circumstances, mainly "
9558 "the case where you want to mount a mix of unrelated and/or read-only "
9559 "filesystems together."
9563 #: ../src/guestfs-actions.pod:3290 ../fish/guestfish-actions.pod:2542
9565 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
9566 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
9567 "inside that. You can unpack this as follows in guestfish:"
9571 #: ../src/guestfs-actions.pod:3295 ../fish/guestfish-actions.pod:2547
9574 " add-ro Fedora-11-i686-Live.iso\n"
9576 " mkmountpoint /cd\n"
9577 " mkmountpoint /squash\n"
9578 " mkmountpoint /ext3\n"
9579 " mount /dev/sda /cd\n"
9580 " mount-loop /cd/LiveOS/squashfs.img /squash\n"
9581 " mount-loop /squash/LiveOS/ext3fs.img /ext3\n"
9586 #: ../src/guestfs-actions.pod:3304 ../fish/guestfish-actions.pod:2556
9587 msgid "The inner filesystem is now unpacked under the /ext3 mountpoint."
9591 #: ../src/guestfs-actions.pod:3308
9592 msgid "guestfs_mknod"
9596 #: ../src/guestfs-actions.pod:3310
9599 " int guestfs_mknod (guestfs_h *g,\n"
9601 "\t\tint devmajor,\n"
9602 "\t\tint devminor,\n"
9603 "\t\tconst char *path);\n"
9608 #: ../src/guestfs-actions.pod:3316 ../fish/guestfish-actions.pod:2562
9610 "This call creates block or character special devices, or named pipes "
9615 #: ../src/guestfs-actions.pod:3319 ../fish/guestfish-actions.pod:2565
9617 "The C<mode> parameter should be the mode, using the standard constants. "
9618 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
9619 "used when creating block and character special devices."
9623 #: ../src/guestfs-actions.pod:3324
9625 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
9626 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
9627 "regular file). These constants are available in the standard Linux header "
9628 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
9629 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
9630 "the appropriate constant for you."
9634 #: ../src/guestfs-actions.pod:3336
9635 msgid "guestfs_mknod_b"
9639 #: ../src/guestfs-actions.pod:3338
9642 " int guestfs_mknod_b (guestfs_h *g,\n"
9644 "\t\tint devmajor,\n"
9645 "\t\tint devminor,\n"
9646 "\t\tconst char *path);\n"
9651 #: ../src/guestfs-actions.pod:3344
9653 "This call creates a block device node called C<path> with mode C<mode> and "
9654 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9655 "wrapper around C<guestfs_mknod>."
9659 #: ../src/guestfs-actions.pod:3352
9660 msgid "guestfs_mknod_c"
9664 #: ../src/guestfs-actions.pod:3354
9667 " int guestfs_mknod_c (guestfs_h *g,\n"
9669 "\t\tint devmajor,\n"
9670 "\t\tint devminor,\n"
9671 "\t\tconst char *path);\n"
9676 #: ../src/guestfs-actions.pod:3360
9678 "This call creates a char device node called C<path> with mode C<mode> and "
9679 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9680 "wrapper around C<guestfs_mknod>."
9684 #: ../src/guestfs-actions.pod:3368
9685 msgid "guestfs_mkswap"
9689 #: ../src/guestfs-actions.pod:3370
9692 " int guestfs_mkswap (guestfs_h *g,\n"
9693 "\t\tconst char *device);\n"
9698 #: ../src/guestfs-actions.pod:3373 ../fish/guestfish-actions.pod:2604
9699 msgid "Create a swap partition on C<device>."
9703 #: ../src/guestfs-actions.pod:3377
9704 msgid "guestfs_mkswap_L"
9708 #: ../src/guestfs-actions.pod:3379
9711 " int guestfs_mkswap_L (guestfs_h *g,\n"
9712 "\t\tconst char *label,\n"
9713 "\t\tconst char *device);\n"
9718 #: ../src/guestfs-actions.pod:3383 ../fish/guestfish-actions.pod:2610
9719 msgid "Create a swap partition on C<device> with label C<label>."
9723 #: ../src/guestfs-actions.pod:3385 ../fish/guestfish-actions.pod:2612
9725 "Note that you cannot attach a swap label to a block device "
9726 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
9727 "the kernel or swap tools."
9731 #: ../src/guestfs-actions.pod:3391
9732 msgid "guestfs_mkswap_U"
9736 #: ../src/guestfs-actions.pod:3393
9739 " int guestfs_mkswap_U (guestfs_h *g,\n"
9740 "\t\tconst char *uuid,\n"
9741 "\t\tconst char *device);\n"
9746 #: ../src/guestfs-actions.pod:3397 ../fish/guestfish-actions.pod:2620
9747 msgid "Create a swap partition on C<device> with UUID C<uuid>."
9751 #: ../src/guestfs-actions.pod:3401
9752 msgid "guestfs_mkswap_file"
9756 #: ../src/guestfs-actions.pod:3403
9759 " int guestfs_mkswap_file (guestfs_h *g,\n"
9760 "\t\tconst char *path);\n"
9765 #: ../src/guestfs-actions.pod:3406 ../fish/guestfish-actions.pod:2626
9766 msgid "Create a swap file."
9770 #: ../src/guestfs-actions.pod:3408
9772 "This command just writes a swap file signature to an existing file. To "
9773 "create the file itself, use something like C<guestfs_fallocate>."
9777 #: ../src/guestfs-actions.pod:3413
9778 msgid "guestfs_modprobe"
9782 #: ../src/guestfs-actions.pod:3415
9785 " int guestfs_modprobe (guestfs_h *g,\n"
9786 "\t\tconst char *modulename);\n"
9791 #: ../src/guestfs-actions.pod:3418 ../fish/guestfish-actions.pod:2635
9792 msgid "This loads a kernel module in the appliance."
9796 #: ../src/guestfs-actions.pod:3420 ../fish/guestfish-actions.pod:2637
9798 "The kernel module must have been whitelisted when libguestfs was built (see "
9799 "C<appliance/kmod.whitelist.in> in the source)."
9803 #: ../src/guestfs-actions.pod:3425
9804 msgid "guestfs_mount"
9808 #: ../src/guestfs-actions.pod:3427
9811 " int guestfs_mount (guestfs_h *g,\n"
9812 "\t\tconst char *device,\n"
9813 "\t\tconst char *mountpoint);\n"
9818 #: ../src/guestfs-actions.pod:3431 ../fish/guestfish-actions.pod:2644
9820 "Mount a guest disk at a position in the filesystem. Block devices are named "
9821 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
9822 "those block devices contain partitions, they will have the usual names "
9823 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
9827 #: ../src/guestfs-actions.pod:3437 ../fish/guestfish-actions.pod:2650
9829 "The rules are the same as for L<mount(2)>: A filesystem must first be "
9830 "mounted on C</> before others can be mounted. Other filesystems can only be "
9831 "mounted on directories which already exist."
9835 #: ../src/guestfs-actions.pod:3442 ../fish/guestfish-actions.pod:2655
9837 "The mounted filesystem is writable, if we have sufficient permissions on the "
9838 "underlying device."
9842 #: ../src/guestfs-actions.pod:3445
9844 "B<Important note:> When you use this call, the filesystem options C<sync> "
9845 "and C<noatime> are set implicitly. This was originally done because we "
9846 "thought it would improve reliability, but it turns out that I<-o sync> has a "
9847 "very large negative performance impact and negligible effect on "
9848 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
9849 "in any code that needs performance, and instead use C<guestfs_mount_options> "
9850 "(use an empty string for the first parameter if you don't want any options)."
9854 #: ../src/guestfs-actions.pod:3457
9855 msgid "guestfs_mount_loop"
9859 #: ../src/guestfs-actions.pod:3459
9862 " int guestfs_mount_loop (guestfs_h *g,\n"
9863 "\t\tconst char *file,\n"
9864 "\t\tconst char *mountpoint);\n"
9869 #: ../src/guestfs-actions.pod:3463 ../fish/guestfish-actions.pod:2672
9871 "This command lets you mount C<file> (a filesystem image in a file) on a "
9872 "mount point. It is entirely equivalent to the command C<mount -o loop file "
9877 #: ../src/guestfs-actions.pod:3469
9878 msgid "guestfs_mount_options"
9882 #: ../src/guestfs-actions.pod:3471
9885 " int guestfs_mount_options (guestfs_h *g,\n"
9886 "\t\tconst char *options,\n"
9887 "\t\tconst char *device,\n"
9888 "\t\tconst char *mountpoint);\n"
9893 #: ../src/guestfs-actions.pod:3476
9895 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9896 "the mount options as for the L<mount(8)> I<-o> flag."
9900 #: ../src/guestfs-actions.pod:3480 ../fish/guestfish-actions.pod:2684
9902 "If the C<options> parameter is an empty string, then no options are passed "
9903 "(all options default to whatever the filesystem uses)."
9907 #: ../src/guestfs-actions.pod:3486
9908 msgid "guestfs_mount_ro"
9912 #: ../src/guestfs-actions.pod:3488
9915 " int guestfs_mount_ro (guestfs_h *g,\n"
9916 "\t\tconst char *device,\n"
9917 "\t\tconst char *mountpoint);\n"
9922 #: ../src/guestfs-actions.pod:3492
9924 "This is the same as the C<guestfs_mount> command, but it mounts the "
9925 "filesystem with the read-only (I<-o ro>) flag."
9929 #: ../src/guestfs-actions.pod:3497
9930 msgid "guestfs_mount_vfs"
9934 #: ../src/guestfs-actions.pod:3499
9937 " int guestfs_mount_vfs (guestfs_h *g,\n"
9938 "\t\tconst char *options,\n"
9939 "\t\tconst char *vfstype,\n"
9940 "\t\tconst char *device,\n"
9941 "\t\tconst char *mountpoint);\n"
9946 #: ../src/guestfs-actions.pod:3505
9948 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9949 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
9954 #: ../src/guestfs-actions.pod:3511
9955 msgid "guestfs_mountpoints"
9959 #: ../src/guestfs-actions.pod:3513
9962 " char **guestfs_mountpoints (guestfs_h *g);\n"
9967 #: ../src/guestfs-actions.pod:3515
9969 "This call is similar to C<guestfs_mounts>. That call returns a list of "
9970 "devices. This one returns a hash table (map) of device name to directory "
9971 "where the device is mounted."
9975 #: ../src/guestfs-actions.pod:3525
9976 msgid "guestfs_mounts"
9980 #: ../src/guestfs-actions.pod:3527
9983 " char **guestfs_mounts (guestfs_h *g);\n"
9988 #: ../src/guestfs-actions.pod:3529 ../fish/guestfish-actions.pod:2715
9990 "This returns the list of currently mounted filesystems. It returns the list "
9991 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
9995 #: ../src/guestfs-actions.pod:3532 ../fish/guestfish-actions.pod:2718
9996 msgid "Some internal mounts are not shown."
10000 #: ../src/guestfs-actions.pod:3534
10001 msgid "See also: C<guestfs_mountpoints>"
10005 #: ../src/guestfs-actions.pod:3540
10010 #: ../src/guestfs-actions.pod:3542
10013 " int guestfs_mv (guestfs_h *g,\n"
10014 "\t\tconst char *src,\n"
10015 "\t\tconst char *dest);\n"
10020 #: ../src/guestfs-actions.pod:3546 ../fish/guestfish-actions.pod:2726
10022 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10023 "destination filename or destination directory."
10027 #: ../src/guestfs-actions.pod:3551
10028 msgid "guestfs_ntfs_3g_probe"
10032 #: ../src/guestfs-actions.pod:3553
10035 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
10037 "\t\tconst char *device);\n"
10042 #: ../src/guestfs-actions.pod:3557 ../fish/guestfish-actions.pod:2733
10044 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10045 "C<device> for mountability. (Not all NTFS volumes can be mounted "
10046 "read-write, and some cannot be mounted at all)."
10050 #: ../src/guestfs-actions.pod:3561 ../fish/guestfish-actions.pod:2737
10052 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10053 "can be mounted read-write. Set it to false if you want to test if the "
10054 "volume can be mounted read-only."
10058 #: ../src/guestfs-actions.pod:3565 ../fish/guestfish-actions.pod:2741
10060 "The return value is an integer which C<0> if the operation would succeed, or "
10061 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10065 #: ../src/guestfs-actions.pod:3571
10066 msgid "guestfs_ntfsresize"
10070 #: ../src/guestfs-actions.pod:3573
10073 " int guestfs_ntfsresize (guestfs_h *g,\n"
10074 "\t\tconst char *device);\n"
10079 #: ../src/guestfs-actions.pod:3576 ../fish/guestfish-actions.pod:2749
10081 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10082 "size of the underlying device. See also L<ntfsresize(8)>."
10086 #: ../src/guestfs-actions.pod:3582
10087 msgid "guestfs_ntfsresize_size"
10091 #: ../src/guestfs-actions.pod:3584
10094 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
10095 "\t\tconst char *device,\n"
10096 "\t\tint64_t size);\n"
10101 #: ../src/guestfs-actions.pod:3588
10103 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10104 "to specify the new size (in bytes) explicitly."
10108 #: ../src/guestfs-actions.pod:3593
10109 msgid "guestfs_part_add"
10113 #: ../src/guestfs-actions.pod:3595
10116 " int guestfs_part_add (guestfs_h *g,\n"
10117 "\t\tconst char *device,\n"
10118 "\t\tconst char *prlogex,\n"
10119 "\t\tint64_t startsect,\n"
10120 "\t\tint64_t endsect);\n"
10125 #: ../src/guestfs-actions.pod:3601
10127 "This command adds a partition to C<device>. If there is no partition table "
10128 "on the device, call C<guestfs_part_init> first."
10132 #: ../src/guestfs-actions.pod:3604 ../fish/guestfish-actions.pod:2767
10134 "The C<prlogex> parameter is the type of partition. Normally you should pass "
10135 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
10136 "C<logical>) and C<e> (or C<extended>) partition types."
10140 #: ../src/guestfs-actions.pod:3609 ../fish/guestfish-actions.pod:2772
10142 "C<startsect> and C<endsect> are the start and end of the partition in "
10143 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
10144 "from the end of the disk (C<-1> is the last sector)."
10148 #: ../src/guestfs-actions.pod:3613
10150 "Creating a partition which covers the whole disk is not so easy. Use "
10151 "C<guestfs_part_disk> to do that."
10155 #: ../src/guestfs-actions.pod:3618
10156 msgid "guestfs_part_del"
10160 #: ../src/guestfs-actions.pod:3620
10163 " int guestfs_part_del (guestfs_h *g,\n"
10164 "\t\tconst char *device,\n"
10165 "\t\tint partnum);\n"
10170 #: ../src/guestfs-actions.pod:3624 ../fish/guestfish-actions.pod:2783
10171 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10175 #: ../src/guestfs-actions.pod:3626 ../fish/guestfish-actions.pod:2785
10177 "Note that in the case of MBR partitioning, deleting an extended partition "
10178 "also deletes any logical partitions it contains."
10182 #: ../src/guestfs-actions.pod:3632
10183 msgid "guestfs_part_disk"
10187 #: ../src/guestfs-actions.pod:3634
10190 " int guestfs_part_disk (guestfs_h *g,\n"
10191 "\t\tconst char *device,\n"
10192 "\t\tconst char *parttype);\n"
10197 #: ../src/guestfs-actions.pod:3638
10199 "This command is simply a combination of C<guestfs_part_init> followed by "
10200 "C<guestfs_part_add> to create a single primary partition covering the whole "
10205 #: ../src/guestfs-actions.pod:3642
10207 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10208 "possible values are described in C<guestfs_part_init>."
10212 #: ../src/guestfs-actions.pod:3650
10213 msgid "guestfs_part_get_bootable"
10217 #: ../src/guestfs-actions.pod:3652
10220 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10221 "\t\tconst char *device,\n"
10222 "\t\tint partnum);\n"
10227 #: ../src/guestfs-actions.pod:3656 ../fish/guestfish-actions.pod:2807
10229 "This command returns true if the partition C<partnum> on C<device> has the "
10230 "bootable flag set."
10234 #: ../src/guestfs-actions.pod:3659
10235 msgid "See also C<guestfs_part_set_bootable>."
10239 #: ../src/guestfs-actions.pod:3663
10240 msgid "guestfs_part_get_mbr_id"
10244 #: ../src/guestfs-actions.pod:3665
10247 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10248 "\t\tconst char *device,\n"
10249 "\t\tint partnum);\n"
10254 #: ../src/guestfs-actions.pod:3669 ../fish/guestfish-actions.pod:2816
10256 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10257 "partition C<partnum>."
10261 #: ../src/guestfs-actions.pod:3672 ../src/guestfs-actions.pod:3834
10263 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10264 "undefined results for other partition table types (see "
10265 "C<guestfs_part_get_parttype>)."
10269 #: ../src/guestfs-actions.pod:3678
10270 msgid "guestfs_part_get_parttype"
10274 #: ../src/guestfs-actions.pod:3680
10277 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10278 "\t\tconst char *device);\n"
10283 #: ../src/guestfs-actions.pod:3683 ../fish/guestfish-actions.pod:2827
10285 "This command examines the partition table on C<device> and returns the "
10286 "partition table type (format) being used."
10290 #: ../src/guestfs-actions.pod:3686
10292 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10293 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10294 "possible, although unusual. See C<guestfs_part_init> for a full list."
10298 #: ../src/guestfs-actions.pod:3694
10299 msgid "guestfs_part_init"
10303 #: ../src/guestfs-actions.pod:3696
10306 " int guestfs_part_init (guestfs_h *g,\n"
10307 "\t\tconst char *device,\n"
10308 "\t\tconst char *parttype);\n"
10313 #: ../src/guestfs-actions.pod:3700 ../fish/guestfish-actions.pod:2839
10315 "This creates an empty partition table on C<device> of one of the partition "
10316 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10317 "(for large disks)."
10321 #: ../src/guestfs-actions.pod:3704
10323 "Initially there are no partitions. Following this, you should call "
10324 "C<guestfs_part_add> for each partition required."
10328 #: ../src/guestfs-actions.pod:3707 ../fish/guestfish-actions.pod:2846
10329 msgid "Possible values for C<parttype> are:"
10333 #: ../src/guestfs-actions.pod:3711 ../fish/guestfish-actions.pod:2850
10334 msgid "B<efi> | B<gpt>"
10338 #: ../src/guestfs-actions.pod:3713 ../fish/guestfish-actions.pod:2852
10339 msgid "Intel EFI / GPT partition table."
10343 #: ../src/guestfs-actions.pod:3715 ../fish/guestfish-actions.pod:2854
10345 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10346 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10347 "the C<mbr> format."
10351 #: ../src/guestfs-actions.pod:3719 ../fish/guestfish-actions.pod:2858
10352 msgid "B<mbr> | B<msdos>"
10356 #: ../src/guestfs-actions.pod:3721 ../fish/guestfish-actions.pod:2860
10358 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10359 "Windows. This partition type will B<only> work for device sizes up to 2 "
10360 "TB. For large disks we recommend using C<gpt>."
10364 #: ../src/guestfs-actions.pod:3728 ../fish/guestfish-actions.pod:2867
10365 msgid "Other partition table types that may work but are not supported include:"
10369 #: ../src/guestfs-actions.pod:3733 ../fish/guestfish-actions.pod:2872
10374 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2874
10375 msgid "AIX disk labels."
10379 #: ../src/guestfs-actions.pod:3737 ../fish/guestfish-actions.pod:2876
10380 msgid "B<amiga> | B<rdb>"
10384 #: ../src/guestfs-actions.pod:3739 ../fish/guestfish-actions.pod:2878
10385 msgid "Amiga \"Rigid Disk Block\" format."
10389 #: ../src/guestfs-actions.pod:3741 ../fish/guestfish-actions.pod:2880
10394 #: ../src/guestfs-actions.pod:3743 ../fish/guestfish-actions.pod:2882
10395 msgid "BSD disk labels."
10399 #: ../src/guestfs-actions.pod:3745 ../fish/guestfish-actions.pod:2884
10404 #: ../src/guestfs-actions.pod:3747 ../fish/guestfish-actions.pod:2886
10405 msgid "DASD, used on IBM mainframes."
10409 #: ../src/guestfs-actions.pod:3749 ../fish/guestfish-actions.pod:2888
10414 #: ../src/guestfs-actions.pod:3751 ../fish/guestfish-actions.pod:2890
10415 msgid "MIPS/SGI volumes."
10419 #: ../src/guestfs-actions.pod:3753 ../fish/guestfish-actions.pod:2892
10424 #: ../src/guestfs-actions.pod:3755 ../fish/guestfish-actions.pod:2894
10425 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10429 #: ../src/guestfs-actions.pod:3757 ../fish/guestfish-actions.pod:2896
10434 #: ../src/guestfs-actions.pod:3759 ../fish/guestfish-actions.pod:2898
10435 msgid "NEC PC-98 format, common in Japan apparently."
10439 #: ../src/guestfs-actions.pod:3761 ../fish/guestfish-actions.pod:2900
10444 #: ../src/guestfs-actions.pod:3763 ../fish/guestfish-actions.pod:2902
10445 msgid "Sun disk labels."
10449 #: ../src/guestfs-actions.pod:3769
10450 msgid "guestfs_part_list"
10454 #: ../src/guestfs-actions.pod:3771
10457 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10458 "\t\tconst char *device);\n"
10463 #: ../src/guestfs-actions.pod:3774 ../fish/guestfish-actions.pod:2910
10465 "This command parses the partition table on C<device> and returns the list of "
10466 "partitions found."
10470 #: ../src/guestfs-actions.pod:3777 ../fish/guestfish-actions.pod:2913
10471 msgid "The fields in the returned structure are:"
10475 #: ../src/guestfs-actions.pod:3781 ../fish/guestfish-actions.pod:2917
10476 msgid "B<part_num>"
10480 #: ../src/guestfs-actions.pod:3783 ../fish/guestfish-actions.pod:2919
10481 msgid "Partition number, counting from 1."
10485 #: ../src/guestfs-actions.pod:3785 ../fish/guestfish-actions.pod:2921
10486 msgid "B<part_start>"
10490 #: ../src/guestfs-actions.pod:3787
10492 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10493 "the device's sector size, see C<guestfs_blockdev_getss>."
10497 #: ../src/guestfs-actions.pod:3790 ../fish/guestfish-actions.pod:2926
10498 msgid "B<part_end>"
10502 #: ../src/guestfs-actions.pod:3792 ../fish/guestfish-actions.pod:2928
10503 msgid "End of the partition in bytes."
10507 #: ../src/guestfs-actions.pod:3794 ../fish/guestfish-actions.pod:2930
10508 msgid "B<part_size>"
10512 #: ../src/guestfs-actions.pod:3796 ../fish/guestfish-actions.pod:2932
10513 msgid "Size of the partition in bytes."
10517 #: ../src/guestfs-actions.pod:3800
10519 "This function returns a C<struct guestfs_partition_list *> (see "
10520 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10521 "must call C<guestfs_free_partition_list> after use>."
10525 #: ../src/guestfs-actions.pod:3805
10526 msgid "guestfs_part_set_bootable"
10530 #: ../src/guestfs-actions.pod:3807
10533 " int guestfs_part_set_bootable (guestfs_h *g,\n"
10534 "\t\tconst char *device,\n"
10535 "\t\tint partnum,\n"
10536 "\t\tint bootable);\n"
10541 #: ../src/guestfs-actions.pod:3812 ../fish/guestfish-actions.pod:2940
10543 "This sets the bootable flag on partition numbered C<partnum> on device "
10544 "C<device>. Note that partitions are numbered from 1."
10548 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2943
10550 "The bootable flag is used by some operating systems (notably Windows) to "
10551 "determine which partition to boot from. It is by no means universally "
10556 #: ../src/guestfs-actions.pod:3821
10557 msgid "guestfs_part_set_mbr_id"
10561 #: ../src/guestfs-actions.pod:3823
10564 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
10565 "\t\tconst char *device,\n"
10566 "\t\tint partnum,\n"
10567 "\t\tint idbyte);\n"
10572 #: ../src/guestfs-actions.pod:3828 ../fish/guestfish-actions.pod:2951
10574 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
10575 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
10576 "documentation are in fact hexadecimal numbers, but usually documented "
10577 "without any leading \"0x\" which might be confusing."
10581 #: ../src/guestfs-actions.pod:3840
10582 msgid "guestfs_part_set_name"
10586 #: ../src/guestfs-actions.pod:3842
10589 " int guestfs_part_set_name (guestfs_h *g,\n"
10590 "\t\tconst char *device,\n"
10591 "\t\tint partnum,\n"
10592 "\t\tconst char *name);\n"
10597 #: ../src/guestfs-actions.pod:3847 ../fish/guestfish-actions.pod:2965
10599 "This sets the partition name on partition numbered C<partnum> on device "
10600 "C<device>. Note that partitions are numbered from 1."
10604 #: ../src/guestfs-actions.pod:3850 ../fish/guestfish-actions.pod:2968
10606 "The partition name can only be set on certain types of partition table. "
10607 "This works on C<gpt> but not on C<mbr> partitions."
10611 #: ../src/guestfs-actions.pod:3855
10612 msgid "guestfs_part_to_dev"
10616 #: ../src/guestfs-actions.pod:3857
10619 " char *guestfs_part_to_dev (guestfs_h *g,\n"
10620 "\t\tconst char *partition);\n"
10625 #: ../src/guestfs-actions.pod:3860 ../fish/guestfish-actions.pod:2975
10627 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
10628 "partition number, returning the device name (eg. \"/dev/sdb\")."
10632 #: ../src/guestfs-actions.pod:3864
10634 "The named partition must exist, for example as a string returned from "
10635 "C<guestfs_list_partitions>."
10639 #: ../src/guestfs-actions.pod:3870
10640 msgid "guestfs_ping_daemon"
10644 #: ../src/guestfs-actions.pod:3872
10647 " int guestfs_ping_daemon (guestfs_h *g);\n"
10652 #: ../src/guestfs-actions.pod:3874 ../fish/guestfish-actions.pod:2986
10654 "This is a test probe into the guestfs daemon running inside the qemu "
10655 "subprocess. Calling this function checks that the daemon responds to the "
10656 "ping message, without affecting the daemon or attached block device(s) in "
10661 #: ../src/guestfs-actions.pod:3881
10662 msgid "guestfs_pread"
10666 #: ../src/guestfs-actions.pod:3883
10669 " char *guestfs_pread (guestfs_h *g,\n"
10670 "\t\tconst char *path,\n"
10672 "\t\tint64_t offset,\n"
10673 "\t\tsize_t *size_r);\n"
10678 #: ../src/guestfs-actions.pod:3889 ../fish/guestfish-actions.pod:2995
10680 "This command lets you read part of a file. It reads C<count> bytes of the "
10681 "file, starting at C<offset>, from file C<path>."
10685 #: ../src/guestfs-actions.pod:3892 ../src/guestfs-actions.pod:3915 ../fish/guestfish-actions.pod:2998 ../fish/guestfish-actions.pod:3013
10687 "This may read fewer bytes than requested. For further details see the "
10688 "L<pread(2)> system call."
10692 #: ../src/guestfs-actions.pod:3895
10693 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
10697 #: ../src/guestfs-actions.pod:3904
10698 msgid "guestfs_pread_device"
10702 #: ../src/guestfs-actions.pod:3906
10705 " char *guestfs_pread_device (guestfs_h *g,\n"
10706 "\t\tconst char *device,\n"
10708 "\t\tint64_t offset,\n"
10709 "\t\tsize_t *size_r);\n"
10714 #: ../src/guestfs-actions.pod:3912 ../fish/guestfish-actions.pod:3010
10716 "This command lets you read part of a file. It reads C<count> bytes of "
10717 "C<device>, starting at C<offset>."
10721 #: ../src/guestfs-actions.pod:3918
10722 msgid "See also C<guestfs_pread>."
10726 #: ../src/guestfs-actions.pod:3927
10727 msgid "guestfs_pvcreate"
10731 #: ../src/guestfs-actions.pod:3929
10734 " int guestfs_pvcreate (guestfs_h *g,\n"
10735 "\t\tconst char *device);\n"
10740 #: ../src/guestfs-actions.pod:3932 ../fish/guestfish-actions.pod:3025
10742 "This creates an LVM physical volume on the named C<device>, where C<device> "
10743 "should usually be a partition name such as C</dev/sda1>."
10747 #: ../src/guestfs-actions.pod:3938
10748 msgid "guestfs_pvremove"
10752 #: ../src/guestfs-actions.pod:3940
10755 " int guestfs_pvremove (guestfs_h *g,\n"
10756 "\t\tconst char *device);\n"
10761 #: ../src/guestfs-actions.pod:3943 ../fish/guestfish-actions.pod:3033
10763 "This wipes a physical volume C<device> so that LVM will no longer recognise "
10768 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:3036
10770 "The implementation uses the C<pvremove> command which refuses to wipe "
10771 "physical volumes that contain any volume groups, so you have to remove those "
10776 #: ../src/guestfs-actions.pod:3952
10777 msgid "guestfs_pvresize"
10781 #: ../src/guestfs-actions.pod:3954
10784 " int guestfs_pvresize (guestfs_h *g,\n"
10785 "\t\tconst char *device);\n"
10790 #: ../src/guestfs-actions.pod:3957 ../fish/guestfish-actions.pod:3044
10792 "This resizes (expands or shrinks) an existing LVM physical volume to match "
10793 "the new size of the underlying device."
10797 #: ../src/guestfs-actions.pod:3962
10798 msgid "guestfs_pvresize_size"
10802 #: ../src/guestfs-actions.pod:3964
10805 " int guestfs_pvresize_size (guestfs_h *g,\n"
10806 "\t\tconst char *device,\n"
10807 "\t\tint64_t size);\n"
10812 #: ../src/guestfs-actions.pod:3968
10814 "This command is the same as C<guestfs_pvresize> except that it allows you to "
10815 "specify the new size (in bytes) explicitly."
10819 #: ../src/guestfs-actions.pod:3973
10820 msgid "guestfs_pvs"
10824 #: ../src/guestfs-actions.pod:3975
10827 " char **guestfs_pvs (guestfs_h *g);\n"
10832 #: ../src/guestfs-actions.pod:3977 ../fish/guestfish-actions.pod:3058
10834 "List all the physical volumes detected. This is the equivalent of the "
10835 "L<pvs(8)> command."
10839 #: ../src/guestfs-actions.pod:3980 ../fish/guestfish-actions.pod:3061
10841 "This returns a list of just the device names that contain PVs "
10842 "(eg. C</dev/sda2>)."
10846 #: ../src/guestfs-actions.pod:3983
10847 msgid "See also C<guestfs_pvs_full>."
10851 #: ../src/guestfs-actions.pod:3989
10852 msgid "guestfs_pvs_full"
10856 #: ../src/guestfs-actions.pod:3991
10859 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
10864 #: ../src/guestfs-actions.pod:3993 ../fish/guestfish-actions.pod:3070
10866 "List all the physical volumes detected. This is the equivalent of the "
10867 "L<pvs(8)> command. The \"full\" version includes all fields."
10871 #: ../src/guestfs-actions.pod:3996
10873 "This function returns a C<struct guestfs_lvm_pv_list *> (see "
10874 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10875 "must call C<guestfs_free_lvm_pv_list> after use>."
10879 #: ../src/guestfs-actions.pod:4001
10880 msgid "guestfs_pvuuid"
10884 #: ../src/guestfs-actions.pod:4003
10887 " char *guestfs_pvuuid (guestfs_h *g,\n"
10888 "\t\tconst char *device);\n"
10893 #: ../src/guestfs-actions.pod:4006 ../fish/guestfish-actions.pod:3077
10894 msgid "This command returns the UUID of the LVM PV C<device>."
10898 #: ../src/guestfs-actions.pod:4011
10899 msgid "guestfs_pwrite"
10903 #: ../src/guestfs-actions.pod:4013
10906 " int guestfs_pwrite (guestfs_h *g,\n"
10907 "\t\tconst char *path,\n"
10908 "\t\tconst char *content,\n"
10909 "\t\tsize_t content_size,\n"
10910 "\t\tint64_t offset);\n"
10915 #: ../src/guestfs-actions.pod:4019 ../fish/guestfish-actions.pod:3083
10917 "This command writes to part of a file. It writes the data buffer C<content> "
10918 "to the file C<path> starting at offset C<offset>."
10922 #: ../src/guestfs-actions.pod:4022 ../fish/guestfish-actions.pod:3086
10924 "This command implements the L<pwrite(2)> system call, and like that system "
10925 "call it may not write the full data requested. The return value is the "
10926 "number of bytes that were actually written to the file. This could even be "
10927 "0, although short writes are unlikely for regular files in ordinary "
10932 #: ../src/guestfs-actions.pod:4028
10933 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
10937 #: ../src/guestfs-actions.pod:4035
10938 msgid "guestfs_pwrite_device"
10942 #: ../src/guestfs-actions.pod:4037
10945 " int guestfs_pwrite_device (guestfs_h *g,\n"
10946 "\t\tconst char *device,\n"
10947 "\t\tconst char *content,\n"
10948 "\t\tsize_t content_size,\n"
10949 "\t\tint64_t offset);\n"
10954 #: ../src/guestfs-actions.pod:4043 ../fish/guestfish-actions.pod:3101
10956 "This command writes to part of a device. It writes the data buffer "
10957 "C<content> to C<device> starting at offset C<offset>."
10961 #: ../src/guestfs-actions.pod:4046 ../fish/guestfish-actions.pod:3104
10963 "This command implements the L<pwrite(2)> system call, and like that system "
10964 "call it may not write the full data requested (although short writes to disk "
10965 "devices and partitions are probably impossible with standard Linux kernels)."
10969 #: ../src/guestfs-actions.pod:4051
10970 msgid "See also C<guestfs_pwrite>."
10974 #: ../src/guestfs-actions.pod:4058
10975 msgid "guestfs_read_file"
10979 #: ../src/guestfs-actions.pod:4060
10982 " char *guestfs_read_file (guestfs_h *g,\n"
10983 "\t\tconst char *path,\n"
10984 "\t\tsize_t *size_r);\n"
10989 #: ../src/guestfs-actions.pod:4064 ../fish/guestfish-actions.pod:3118
10990 msgid "This calls returns the contents of the file C<path> as a buffer."
10994 #: ../src/guestfs-actions.pod:4067
10996 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
10997 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
10998 "function is limited in the total size of file that can be handled."
11002 #: ../src/guestfs-actions.pod:4079
11003 msgid "guestfs_read_lines"
11007 #: ../src/guestfs-actions.pod:4081
11010 " char **guestfs_read_lines (guestfs_h *g,\n"
11011 "\t\tconst char *path);\n"
11016 #: ../src/guestfs-actions.pod:4086 ../fish/guestfish-actions.pod:3135
11018 "The file contents are returned as a list of lines. Trailing C<LF> and "
11019 "C<CRLF> character sequences are I<not> returned."
11023 #: ../src/guestfs-actions.pod:4089
11025 "Note that this function cannot correctly handle binary files (specifically, "
11026 "files containing C<\\0> character which is treated as end of line). For "
11027 "those you need to use the C<guestfs_read_file> function which has a more "
11028 "complex interface."
11032 #: ../src/guestfs-actions.pod:4098
11033 msgid "guestfs_readdir"
11037 #: ../src/guestfs-actions.pod:4100
11040 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
11041 "\t\tconst char *dir);\n"
11046 #: ../src/guestfs-actions.pod:4103 ../fish/guestfish-actions.pod:3147
11047 msgid "This returns the list of directory entries in directory C<dir>."
11051 #: ../src/guestfs-actions.pod:4105 ../fish/guestfish-actions.pod:3149
11053 "All entries in the directory are returned, including C<.> and C<..>. The "
11054 "entries are I<not> sorted, but returned in the same order as the underlying "
11059 #: ../src/guestfs-actions.pod:4109 ../fish/guestfish-actions.pod:3153
11061 "Also this call returns basic file type information about each file. The "
11062 "C<ftyp> field will contain one of the following characters:"
11066 #: ../src/guestfs-actions.pod:4114 ../fish/guestfish-actions.pod:3158
11071 #: ../src/guestfs-actions.pod:4116 ../fish/guestfish-actions.pod:3160
11072 msgid "Block special"
11076 #: ../src/guestfs-actions.pod:4118 ../fish/guestfish-actions.pod:3162
11081 #: ../src/guestfs-actions.pod:4120 ../fish/guestfish-actions.pod:3164
11082 msgid "Char special"
11086 #: ../src/guestfs-actions.pod:4122 ../fish/guestfish-actions.pod:3166
11091 #: ../src/guestfs-actions.pod:4124 ../fish/guestfish-actions.pod:3168
11096 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:3170
11101 #: ../src/guestfs-actions.pod:4128 ../fish/guestfish-actions.pod:3172
11102 msgid "FIFO (named pipe)"
11106 #: ../src/guestfs-actions.pod:4130 ../fish/guestfish-actions.pod:3174
11111 #: ../src/guestfs-actions.pod:4132 ../fish/guestfish-actions.pod:3176
11112 msgid "Symbolic link"
11116 #: ../src/guestfs-actions.pod:4134 ../fish/guestfish-actions.pod:3178
11121 #: ../src/guestfs-actions.pod:4136 ../fish/guestfish-actions.pod:3180
11122 msgid "Regular file"
11126 #: ../src/guestfs-actions.pod:4138 ../fish/guestfish-actions.pod:3182
11131 #: ../src/guestfs-actions.pod:4140 ../fish/guestfish-actions.pod:3184
11136 #: ../src/guestfs-actions.pod:4142 ../fish/guestfish-actions.pod:3186
11141 #: ../src/guestfs-actions.pod:4144 ../fish/guestfish-actions.pod:3188
11142 msgid "Unknown file type"
11146 #: ../src/guestfs-actions.pod:4146 ../fish/guestfish-actions.pod:3190
11151 #: ../src/guestfs-actions.pod:4148 ../fish/guestfish-actions.pod:3192
11152 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
11156 #: ../src/guestfs-actions.pod:4153
11158 "This function is primarily intended for use by programs. To get a simple "
11159 "list of names, use C<guestfs_ls>. To get a printable directory for human "
11160 "consumption, use C<guestfs_ll>."
11164 #: ../src/guestfs-actions.pod:4157
11166 "This function returns a C<struct guestfs_dirent_list *> (see "
11167 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
11168 "must call C<guestfs_free_dirent_list> after use>."
11172 #: ../src/guestfs-actions.pod:4162
11173 msgid "guestfs_readlink"
11177 #: ../src/guestfs-actions.pod:4164
11180 " char *guestfs_readlink (guestfs_h *g,\n"
11181 "\t\tconst char *path);\n"
11186 #: ../src/guestfs-actions.pod:4167 ../fish/guestfish-actions.pod:3205
11187 msgid "This command reads the target of a symbolic link."
11191 #: ../src/guestfs-actions.pod:4172
11192 msgid "guestfs_readlinklist"
11196 #: ../src/guestfs-actions.pod:4174
11199 " char **guestfs_readlinklist (guestfs_h *g,\n"
11200 "\t\tconst char *path,\n"
11201 "\t\tchar *const *names);\n"
11206 #: ../src/guestfs-actions.pod:4178 ../fish/guestfish-actions.pod:3211
11208 "This call allows you to do a C<readlink> operation on multiple files, where "
11209 "all files are in the directory C<path>. C<names> is the list of files from "
11214 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:3215
11216 "On return you get a list of strings, with a one-to-one correspondence to the "
11217 "C<names> list. Each string is the value of the symbolic link."
11221 #: ../src/guestfs-actions.pod:4186 ../fish/guestfish-actions.pod:3219
11223 "If the C<readlink(2)> operation fails on any name, then the corresponding "
11224 "result string is the empty string C<\"\">. However the whole operation is "
11225 "completed even if there were C<readlink(2)> errors, and so you can call this "
11226 "function with names where you don't know if they are symbolic links already "
11227 "(albeit slightly less efficient)."
11231 #: ../src/guestfs-actions.pod:4193 ../fish/guestfish-actions.pod:3226
11233 "This call is intended for programs that want to efficiently list a directory "
11234 "contents without making many round-trips. Very long directory listings "
11235 "might cause the protocol message size to be exceeded, causing this call to "
11236 "fail. The caller must split up such requests into smaller groups of names."
11240 #: ../src/guestfs-actions.pod:4204
11241 msgid "guestfs_realpath"
11245 #: ../src/guestfs-actions.pod:4206
11248 " char *guestfs_realpath (guestfs_h *g,\n"
11249 "\t\tconst char *path);\n"
11254 #: ../src/guestfs-actions.pod:4209 ../fish/guestfish-actions.pod:3237
11256 "Return the canonicalized absolute pathname of C<path>. The returned path "
11257 "has no C<.>, C<..> or symbolic link path elements."
11261 #: ../src/guestfs-actions.pod:4215
11262 msgid "guestfs_removexattr"
11266 #: ../src/guestfs-actions.pod:4217
11269 " int guestfs_removexattr (guestfs_h *g,\n"
11270 "\t\tconst char *xattr,\n"
11271 "\t\tconst char *path);\n"
11276 #: ../src/guestfs-actions.pod:4221 ../fish/guestfish-actions.pod:3244
11277 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
11281 #: ../src/guestfs-actions.pod:4224
11282 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11286 #: ../src/guestfs-actions.pod:4228
11287 msgid "guestfs_resize2fs"
11291 #: ../src/guestfs-actions.pod:4230
11294 " int guestfs_resize2fs (guestfs_h *g,\n"
11295 "\t\tconst char *device);\n"
11300 #: ../src/guestfs-actions.pod:4233 ../fish/guestfish-actions.pod:3253
11302 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11303 "underlying device."
11307 #: ../src/guestfs-actions.pod:4236
11309 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11310 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11311 "sometimes gives an error about this and sometimes not. In any case, it is "
11312 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11316 #: ../src/guestfs-actions.pod:4244
11317 msgid "guestfs_resize2fs_size"
11321 #: ../src/guestfs-actions.pod:4246
11324 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11325 "\t\tconst char *device,\n"
11326 "\t\tint64_t size);\n"
11331 #: ../src/guestfs-actions.pod:4250
11333 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11334 "to specify the new size (in bytes) explicitly."
11338 #: ../src/guestfs-actions.pod:4255
11343 #: ../src/guestfs-actions.pod:4257
11346 " int guestfs_rm (guestfs_h *g,\n"
11347 "\t\tconst char *path);\n"
11352 #: ../src/guestfs-actions.pod:4260 ../fish/guestfish-actions.pod:3273
11353 msgid "Remove the single file C<path>."
11357 #: ../src/guestfs-actions.pod:4264
11358 msgid "guestfs_rm_rf"
11362 #: ../src/guestfs-actions.pod:4266
11365 " int guestfs_rm_rf (guestfs_h *g,\n"
11366 "\t\tconst char *path);\n"
11371 #: ../src/guestfs-actions.pod:4269 ../fish/guestfish-actions.pod:3279
11373 "Remove the file or directory C<path>, recursively removing the contents if "
11374 "its a directory. This is like the C<rm -rf> shell command."
11378 #: ../src/guestfs-actions.pod:4275
11379 msgid "guestfs_rmdir"
11383 #: ../src/guestfs-actions.pod:4277
11386 " int guestfs_rmdir (guestfs_h *g,\n"
11387 "\t\tconst char *path);\n"
11392 #: ../src/guestfs-actions.pod:4280 ../fish/guestfish-actions.pod:3287
11393 msgid "Remove the single directory C<path>."
11397 #: ../src/guestfs-actions.pod:4284
11398 msgid "guestfs_rmmountpoint"
11402 #: ../src/guestfs-actions.pod:4286
11405 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11406 "\t\tconst char *exemptpath);\n"
11411 #: ../src/guestfs-actions.pod:4289
11413 "This calls removes a mountpoint that was previously created with "
11414 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11418 #: ../src/guestfs-actions.pod:4295
11419 msgid "guestfs_scrub_device"
11423 #: ../src/guestfs-actions.pod:4297
11426 " int guestfs_scrub_device (guestfs_h *g,\n"
11427 "\t\tconst char *device);\n"
11432 #: ../src/guestfs-actions.pod:4300 ../fish/guestfish-actions.pod:3301
11434 "This command writes patterns over C<device> to make data retrieval more "
11439 #: ../src/guestfs-actions.pod:4303 ../src/guestfs-actions.pod:4321 ../src/guestfs-actions.pod:4337 ../fish/guestfish-actions.pod:3304 ../fish/guestfish-actions.pod:3319 ../fish/guestfish-actions.pod:3332
11441 "It is an interface to the L<scrub(1)> program. See that manual page for "
11446 #: ../src/guestfs-actions.pod:4311
11447 msgid "guestfs_scrub_file"
11451 #: ../src/guestfs-actions.pod:4313
11454 " int guestfs_scrub_file (guestfs_h *g,\n"
11455 "\t\tconst char *file);\n"
11460 #: ../src/guestfs-actions.pod:4316 ../fish/guestfish-actions.pod:3314
11462 "This command writes patterns over a file to make data retrieval more "
11467 #: ../src/guestfs-actions.pod:4319 ../fish/guestfish-actions.pod:3317
11468 msgid "The file is I<removed> after scrubbing."
11472 #: ../src/guestfs-actions.pod:4326
11473 msgid "guestfs_scrub_freespace"
11477 #: ../src/guestfs-actions.pod:4328
11480 " int guestfs_scrub_freespace (guestfs_h *g,\n"
11481 "\t\tconst char *dir);\n"
11486 #: ../src/guestfs-actions.pod:4331
11488 "This command creates the directory C<dir> and then fills it with files until "
11489 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
11490 "and deletes them. The intention is to scrub any free space on the partition "
11491 "containing C<dir>."
11495 #: ../src/guestfs-actions.pod:4342
11496 msgid "guestfs_set_append"
11500 #: ../src/guestfs-actions.pod:4344
11503 " int guestfs_set_append (guestfs_h *g,\n"
11504 "\t\tconst char *append);\n"
11509 #: ../src/guestfs-actions.pod:4347 ../fish/guestfish-actions.pod:3341
11511 "This function is used to add additional options to the guest kernel command "
11516 #: ../src/guestfs-actions.pod:4350 ../fish/guestfish-actions.pod:3344
11518 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
11519 "environment variable."
11523 #: ../src/guestfs-actions.pod:4353 ../fish/guestfish-actions.pod:3347
11525 "Setting C<append> to C<NULL> means I<no> additional options are passed "
11526 "(libguestfs always adds a few of its own)."
11530 #: ../src/guestfs-actions.pod:4358
11531 msgid "guestfs_set_autosync"
11535 #: ../src/guestfs-actions.pod:4360
11538 " int guestfs_set_autosync (guestfs_h *g,\n"
11539 "\t\tint autosync);\n"
11544 #: ../src/guestfs-actions.pod:4363
11546 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
11547 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
11548 "the handle is closed (also if the program exits without closing handles)."
11552 #: ../src/guestfs-actions.pod:4368 ../fish/guestfish-actions.pod:3361
11554 "This is disabled by default (except in guestfish where it is enabled by "
11559 #: ../src/guestfs-actions.pod:4373
11560 msgid "guestfs_set_direct"
11564 #: ../src/guestfs-actions.pod:4375
11567 " int guestfs_set_direct (guestfs_h *g,\n"
11568 "\t\tint direct);\n"
11573 #: ../src/guestfs-actions.pod:4378 ../fish/guestfish-actions.pod:3370
11575 "If the direct appliance mode flag is enabled, then stdin and stdout are "
11576 "passed directly through to the appliance once it is launched."
11580 #: ../src/guestfs-actions.pod:4382
11582 "One consequence of this is that log messages aren't caught by the library "
11583 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
11588 #: ../src/guestfs-actions.pod:4386 ../fish/guestfish-actions.pod:3378
11589 msgid "You probably don't want to use this unless you know what you are doing."
11593 #: ../src/guestfs-actions.pod:4389 ../fish/guestfish-actions.pod:3381
11594 msgid "The default is disabled."
11598 #: ../src/guestfs-actions.pod:4393
11599 msgid "guestfs_set_e2label"
11603 #: ../src/guestfs-actions.pod:4395
11606 " int guestfs_set_e2label (guestfs_h *g,\n"
11607 "\t\tconst char *device,\n"
11608 "\t\tconst char *label);\n"
11613 #: ../src/guestfs-actions.pod:4399 ../fish/guestfish-actions.pod:3387
11615 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
11616 "C<label>. Filesystem labels are limited to 16 characters."
11620 #: ../src/guestfs-actions.pod:4403
11622 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
11623 "the existing label on a filesystem."
11627 #: ../src/guestfs-actions.pod:4408
11628 msgid "guestfs_set_e2uuid"
11632 #: ../src/guestfs-actions.pod:4410
11635 " int guestfs_set_e2uuid (guestfs_h *g,\n"
11636 "\t\tconst char *device,\n"
11637 "\t\tconst char *uuid);\n"
11642 #: ../src/guestfs-actions.pod:4414 ../fish/guestfish-actions.pod:3398
11644 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
11645 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
11646 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
11650 #: ../src/guestfs-actions.pod:4419
11652 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
11653 "the existing UUID of a filesystem."
11657 #: ../src/guestfs-actions.pod:4424
11658 msgid "guestfs_set_memsize"
11662 #: ../src/guestfs-actions.pod:4426
11665 " int guestfs_set_memsize (guestfs_h *g,\n"
11666 "\t\tint memsize);\n"
11671 #: ../src/guestfs-actions.pod:4429
11673 "This sets the memory size in megabytes allocated to the qemu subprocess. "
11674 "This only has any effect if called before C<guestfs_launch>."
11678 #: ../src/guestfs-actions.pod:4433 ../fish/guestfish-actions.pod:3416
11680 "You can also change this by setting the environment variable "
11681 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
11685 #: ../src/guestfs-actions.pod:4442
11686 msgid "guestfs_set_network"
11690 #: ../src/guestfs-actions.pod:4444
11693 " int guestfs_set_network (guestfs_h *g,\n"
11694 "\t\tint network);\n"
11699 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:3429
11701 "If C<network> is true, then the network is enabled in the libguestfs "
11702 "appliance. The default is false."
11706 #: ../src/guestfs-actions.pod:4450 ../fish/guestfish-actions.pod:3432
11708 "This affects whether commands are able to access the network (see "
11709 "L<guestfs(3)/RUNNING COMMANDS>)."
11713 #: ../src/guestfs-actions.pod:4453
11715 "You must call this before calling C<guestfs_launch>, otherwise it has no "
11720 #: ../src/guestfs-actions.pod:4458
11721 msgid "guestfs_set_path"
11725 #: ../src/guestfs-actions.pod:4460
11728 " int guestfs_set_path (guestfs_h *g,\n"
11729 "\t\tconst char *searchpath);\n"
11734 #: ../src/guestfs-actions.pod:4463 ../fish/guestfish-actions.pod:3444
11735 msgid "Set the path that libguestfs searches for kernel and initrd.img."
11739 #: ../src/guestfs-actions.pod:4465 ../fish/guestfish-actions.pod:3446
11741 "The default is C<$libdir/guestfs> unless overridden by setting "
11742 "C<LIBGUESTFS_PATH> environment variable."
11746 #: ../src/guestfs-actions.pod:4468 ../fish/guestfish-actions.pod:3449
11747 msgid "Setting C<path> to C<NULL> restores the default path."
11751 #: ../src/guestfs-actions.pod:4472
11752 msgid "guestfs_set_qemu"
11756 #: ../src/guestfs-actions.pod:4474
11759 " int guestfs_set_qemu (guestfs_h *g,\n"
11760 "\t\tconst char *qemu);\n"
11765 #: ../src/guestfs-actions.pod:4477 ../fish/guestfish-actions.pod:3457
11766 msgid "Set the qemu binary that we will use."
11770 #: ../src/guestfs-actions.pod:4479 ../fish/guestfish-actions.pod:3459
11771 msgid "The default is chosen when the library was compiled by the configure script."
11775 #: ../src/guestfs-actions.pod:4482 ../fish/guestfish-actions.pod:3462
11777 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
11782 #: ../src/guestfs-actions.pod:4485 ../fish/guestfish-actions.pod:3465
11783 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
11787 #: ../src/guestfs-actions.pod:4487 ../fish/guestfish-actions.pod:3467
11789 "Note that you should call this function as early as possible after creating "
11790 "the handle. This is because some pre-launch operations depend on testing "
11791 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
11792 "don't retest features, and so you might see inconsistent results. Using the "
11793 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
11794 "the qemu binary at the same time as the handle is created."
11798 #: ../src/guestfs-actions.pod:4497
11799 msgid "guestfs_set_recovery_proc"
11803 #: ../src/guestfs-actions.pod:4499
11806 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
11807 "\t\tint recoveryproc);\n"
11812 #: ../src/guestfs-actions.pod:4502
11814 "If this is called with the parameter C<false> then C<guestfs_launch> does "
11815 "not create a recovery process. The purpose of the recovery process is to "
11816 "stop runaway qemu processes in the case where the main program aborts "
11821 #: ../src/guestfs-actions.pod:4507
11823 "This only has any effect if called before C<guestfs_launch>, and the default "
11828 #: ../src/guestfs-actions.pod:4510 ../fish/guestfish-actions.pod:3489
11830 "About the only time when you would want to disable this is if the main "
11831 "process will fork itself into the background (\"daemonize\" itself). In "
11832 "this case the recovery process thinks that the main program has disappeared "
11833 "and so kills qemu, which is not very helpful."
11837 #: ../src/guestfs-actions.pod:4518
11838 msgid "guestfs_set_selinux"
11842 #: ../src/guestfs-actions.pod:4520
11845 " int guestfs_set_selinux (guestfs_h *g,\n"
11846 "\t\tint selinux);\n"
11851 #: ../src/guestfs-actions.pod:4523 ../fish/guestfish-actions.pod:3501
11853 "This sets the selinux flag that is passed to the appliance at boot time. "
11854 "The default is C<selinux=0> (disabled)."
11858 #: ../src/guestfs-actions.pod:4526 ../fish/guestfish-actions.pod:3504
11860 "Note that if SELinux is enabled, it is always in Permissive mode "
11861 "(C<enforcing=0>)."
11865 #: ../src/guestfs-actions.pod:4534
11866 msgid "guestfs_set_trace"
11870 #: ../src/guestfs-actions.pod:4536
11873 " int guestfs_set_trace (guestfs_h *g,\n"
11874 "\t\tint trace);\n"
11879 #: ../src/guestfs-actions.pod:4539 ../fish/guestfish-actions.pod:3516
11881 "If the command trace flag is set to 1, then commands are printed on stderr "
11882 "before they are executed in a format which is very similar to the one used "
11883 "by guestfish. In other words, you can run a program with this enabled, and "
11884 "you will get out a script which you can feed to guestfish to perform the "
11885 "same set of actions."
11889 #: ../src/guestfs-actions.pod:4546 ../fish/guestfish-actions.pod:3523
11891 "If you want to trace C API calls into libguestfs (and other libraries) then "
11892 "possibly a better way is to use the external ltrace(1) command."
11896 #: ../src/guestfs-actions.pod:4550 ../fish/guestfish-actions.pod:3527
11898 "Command traces are disabled unless the environment variable "
11899 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
11903 #: ../src/guestfs-actions.pod:4555
11904 msgid "guestfs_set_verbose"
11908 #: ../src/guestfs-actions.pod:4557
11911 " int guestfs_set_verbose (guestfs_h *g,\n"
11912 "\t\tint verbose);\n"
11917 #: ../src/guestfs-actions.pod:4560 ../fish/guestfish-actions.pod:3536
11918 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
11922 #: ../src/guestfs-actions.pod:4562 ../fish/guestfish-actions.pod:3538
11924 "Verbose messages are disabled unless the environment variable "
11925 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
11929 #: ../src/guestfs-actions.pod:4567
11930 msgid "guestfs_setcon"
11934 #: ../src/guestfs-actions.pod:4569
11937 " int guestfs_setcon (guestfs_h *g,\n"
11938 "\t\tconst char *context);\n"
11943 #: ../src/guestfs-actions.pod:4572 ../fish/guestfish-actions.pod:3545
11945 "This sets the SELinux security context of the daemon to the string "
11950 #: ../src/guestfs-actions.pod:4575 ../fish/guestfish-actions.pod:3548
11951 msgid "See the documentation about SELINUX in L<guestfs(3)>."
11955 #: ../src/guestfs-actions.pod:4579
11956 msgid "guestfs_setxattr"
11960 #: ../src/guestfs-actions.pod:4581
11963 " int guestfs_setxattr (guestfs_h *g,\n"
11964 "\t\tconst char *xattr,\n"
11965 "\t\tconst char *val,\n"
11966 "\t\tint vallen,\n"
11967 "\t\tconst char *path);\n"
11972 #: ../src/guestfs-actions.pod:4587 ../fish/guestfish-actions.pod:3554
11974 "This call sets the extended attribute named C<xattr> of the file C<path> to "
11975 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
11979 #: ../src/guestfs-actions.pod:4591
11980 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
11984 #: ../src/guestfs-actions.pod:4595
11985 msgid "guestfs_sfdisk"
11989 #: ../src/guestfs-actions.pod:4597
11992 " int guestfs_sfdisk (guestfs_h *g,\n"
11993 "\t\tconst char *device,\n"
11996 "\t\tint sectors,\n"
11997 "\t\tchar *const *lines);\n"
12002 #: ../src/guestfs-actions.pod:4604 ../fish/guestfish-actions.pod:3564
12004 "This is a direct interface to the L<sfdisk(8)> program for creating "
12005 "partitions on block devices."
12009 #: ../src/guestfs-actions.pod:4607 ../fish/guestfish-actions.pod:3567
12010 msgid "C<device> should be a block device, for example C</dev/sda>."
12014 #: ../src/guestfs-actions.pod:4609 ../fish/guestfish-actions.pod:3569
12016 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12017 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
12018 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12019 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12020 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12021 "the kernel) cannot work out the right geometry and you will need to tell it."
12025 #: ../src/guestfs-actions.pod:4617 ../fish/guestfish-actions.pod:3577
12027 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12028 "refer to the L<sfdisk(8)> manpage."
12032 #: ../src/guestfs-actions.pod:4620 ../fish/guestfish-actions.pod:3580
12034 "To create a single partition occupying the whole disk, you would pass "
12035 "C<lines> as a single element list, when the single element being the string "
12040 #: ../src/guestfs-actions.pod:4624
12041 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
12045 #: ../src/guestfs-actions.pod:4632
12046 msgid "guestfs_sfdiskM"
12050 #: ../src/guestfs-actions.pod:4634
12053 " int guestfs_sfdiskM (guestfs_h *g,\n"
12054 "\t\tconst char *device,\n"
12055 "\t\tchar *const *lines);\n"
12060 #: ../src/guestfs-actions.pod:4638
12062 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
12063 "partition sizes are specified in megabytes only (rounded to the nearest "
12064 "cylinder) and you don't need to specify the cyls, heads and sectors "
12065 "parameters which were rarely if ever used anyway."
12069 #: ../src/guestfs-actions.pod:4644
12071 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
12072 "C<guestfs_part_disk>"
12076 #: ../src/guestfs-actions.pod:4652
12077 msgid "guestfs_sfdisk_N"
12081 #: ../src/guestfs-actions.pod:4654
12084 " int guestfs_sfdisk_N (guestfs_h *g,\n"
12085 "\t\tconst char *device,\n"
12086 "\t\tint partnum,\n"
12089 "\t\tint sectors,\n"
12090 "\t\tconst char *line);\n"
12095 #: ../src/guestfs-actions.pod:4662 ../fish/guestfish-actions.pod:3610
12097 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
12098 "(note: C<n> counts from 1)."
12102 #: ../src/guestfs-actions.pod:4665
12104 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
12105 "for the cyls/heads/sectors parameters."
12109 #: ../src/guestfs-actions.pod:4668
12110 msgid "See also: C<guestfs_part_add>"
12114 #: ../src/guestfs-actions.pod:4675
12115 msgid "guestfs_sfdisk_disk_geometry"
12119 #: ../src/guestfs-actions.pod:4677
12122 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
12123 "\t\tconst char *device);\n"
12128 #: ../src/guestfs-actions.pod:4680
12130 "This displays the disk geometry of C<device> read from the partition table. "
12131 "Especially in the case where the underlying block device has been resized, "
12132 "this can be different from the kernel's idea of the geometry (see "
12133 "C<guestfs_sfdisk_kernel_geometry>)."
12137 #: ../src/guestfs-actions.pod:4685 ../src/guestfs-actions.pod:4698 ../fish/guestfish-actions.pod:3630 ../fish/guestfish-actions.pod:3639
12138 msgid "The result is in human-readable format, and not designed to be parsed."
12142 #: ../src/guestfs-actions.pod:4691
12143 msgid "guestfs_sfdisk_kernel_geometry"
12147 #: ../src/guestfs-actions.pod:4693
12150 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
12151 "\t\tconst char *device);\n"
12156 #: ../src/guestfs-actions.pod:4696 ../fish/guestfish-actions.pod:3637
12157 msgid "This displays the kernel's idea of the geometry of C<device>."
12161 #: ../src/guestfs-actions.pod:4704
12162 msgid "guestfs_sfdisk_l"
12166 #: ../src/guestfs-actions.pod:4706
12169 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
12170 "\t\tconst char *device);\n"
12175 #: ../src/guestfs-actions.pod:4709 ../fish/guestfish-actions.pod:3646
12177 "This displays the partition table on C<device>, in the human-readable output "
12178 "of the L<sfdisk(8)> command. It is not intended to be parsed."
12182 #: ../src/guestfs-actions.pod:4713
12183 msgid "See also: C<guestfs_part_list>"
12187 #: ../src/guestfs-actions.pod:4718
12192 #: ../src/guestfs-actions.pod:4720
12195 " char *guestfs_sh (guestfs_h *g,\n"
12196 "\t\tconst char *command);\n"
12201 #: ../src/guestfs-actions.pod:4723 ../fish/guestfish-actions.pod:3656
12203 "This call runs a command from the guest filesystem via the guest's "
12208 #: ../src/guestfs-actions.pod:4726
12209 msgid "This is like C<guestfs_command>, but passes the command to:"
12213 #: ../src/guestfs-actions.pod:4728 ../fish/guestfish-actions.pod:3661
12216 " /bin/sh -c \"command\"\n"
12221 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3663
12223 "Depending on the guest's shell, this usually results in wildcards being "
12224 "expanded, shell expressions being interpolated and so on."
12228 #: ../src/guestfs-actions.pod:4734
12229 msgid "All the provisos about C<guestfs_command> apply to this call."
12233 #: ../src/guestfs-actions.pod:4739
12234 msgid "guestfs_sh_lines"
12238 #: ../src/guestfs-actions.pod:4741
12241 " char **guestfs_sh_lines (guestfs_h *g,\n"
12242 "\t\tconst char *command);\n"
12247 #: ../src/guestfs-actions.pod:4744
12249 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12254 #: ../src/guestfs-actions.pod:4747
12255 msgid "See also: C<guestfs_command_lines>"
12259 #: ../src/guestfs-actions.pod:4753
12260 msgid "guestfs_sleep"
12264 #: ../src/guestfs-actions.pod:4755
12267 " int guestfs_sleep (guestfs_h *g,\n"
12273 #: ../src/guestfs-actions.pod:4758 ../fish/guestfish-actions.pod:3682
12274 msgid "Sleep for C<secs> seconds."
12278 #: ../src/guestfs-actions.pod:4762 ../src/guestfs-structs.pod:109
12279 msgid "guestfs_stat"
12283 #: ../src/guestfs-actions.pod:4764
12286 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12287 "\t\tconst char *path);\n"
12292 #: ../src/guestfs-actions.pod:4769 ../fish/guestfish-actions.pod:3690
12293 msgid "This is the same as the C<stat(2)> system call."
12297 #: ../src/guestfs-actions.pod:4775 ../src/guestfs-structs.pod:135
12298 msgid "guestfs_statvfs"
12302 #: ../src/guestfs-actions.pod:4777
12305 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12306 "\t\tconst char *path);\n"
12311 #: ../src/guestfs-actions.pod:4780 ../fish/guestfish-actions.pod:3696
12313 "Returns file system statistics for any mounted file system. C<path> should "
12314 "be a file or directory in the mounted file system (typically it is the mount "
12315 "point itself, but it doesn't need to be)."
12319 #: ../src/guestfs-actions.pod:4784 ../fish/guestfish-actions.pod:3700
12320 msgid "This is the same as the C<statvfs(2)> system call."
12324 #: ../src/guestfs-actions.pod:4786
12326 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12327 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12331 #: ../src/guestfs-actions.pod:4790
12332 msgid "guestfs_strings"
12336 #: ../src/guestfs-actions.pod:4792
12339 " char **guestfs_strings (guestfs_h *g,\n"
12340 "\t\tconst char *path);\n"
12345 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3706
12347 "This runs the L<strings(1)> command on a file and returns the list of "
12348 "printable strings found."
12352 #: ../src/guestfs-actions.pod:4805
12353 msgid "guestfs_strings_e"
12357 #: ../src/guestfs-actions.pod:4807
12360 " char **guestfs_strings_e (guestfs_h *g,\n"
12361 "\t\tconst char *encoding,\n"
12362 "\t\tconst char *path);\n"
12367 #: ../src/guestfs-actions.pod:4811
12369 "This is like the C<guestfs_strings> command, but allows you to specify the "
12370 "encoding of strings that are looked for in the source file C<path>."
12374 #: ../src/guestfs-actions.pod:4815 ../fish/guestfish-actions.pod:3720
12375 msgid "Allowed encodings are:"
12379 #: ../src/guestfs-actions.pod:4819 ../fish/guestfish-actions.pod:3724
12384 #: ../src/guestfs-actions.pod:4821
12386 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12387 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12391 #: ../src/guestfs-actions.pod:4824 ../fish/guestfish-actions.pod:3729
12396 #: ../src/guestfs-actions.pod:4826 ../fish/guestfish-actions.pod:3731
12397 msgid "Single 8-bit-byte characters."
12401 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3733
12406 #: ../src/guestfs-actions.pod:4830 ../fish/guestfish-actions.pod:3735
12407 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12411 #: ../src/guestfs-actions.pod:4833 ../fish/guestfish-actions.pod:3738
12412 msgid "l (lower case letter L)"
12416 #: ../src/guestfs-actions.pod:4835 ../fish/guestfish-actions.pod:3740
12418 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12419 "examining binaries in Windows guests."
12423 #: ../src/guestfs-actions.pod:4838 ../fish/guestfish-actions.pod:3743
12428 #: ../src/guestfs-actions.pod:4840 ../fish/guestfish-actions.pod:3745
12429 msgid "32-bit big endian such as UCS-4BE."
12433 #: ../src/guestfs-actions.pod:4842 ../fish/guestfish-actions.pod:3747
12438 #: ../src/guestfs-actions.pod:4844 ../fish/guestfish-actions.pod:3749
12439 msgid "32-bit little endian such as UCS-4LE."
12443 #: ../src/guestfs-actions.pod:4848 ../fish/guestfish-actions.pod:3753
12444 msgid "The returned strings are transcoded to UTF-8."
12448 #: ../src/guestfs-actions.pod:4857
12449 msgid "guestfs_swapoff_device"
12453 #: ../src/guestfs-actions.pod:4859
12456 " int guestfs_swapoff_device (guestfs_h *g,\n"
12457 "\t\tconst char *device);\n"
12462 #: ../src/guestfs-actions.pod:4862
12464 "This command disables the libguestfs appliance swap device or partition "
12465 "named C<device>. See C<guestfs_swapon_device>."
12469 #: ../src/guestfs-actions.pod:4868
12470 msgid "guestfs_swapoff_file"
12474 #: ../src/guestfs-actions.pod:4870
12477 " int guestfs_swapoff_file (guestfs_h *g,\n"
12478 "\t\tconst char *file);\n"
12483 #: ../src/guestfs-actions.pod:4873 ../fish/guestfish-actions.pod:3770
12484 msgid "This command disables the libguestfs appliance swap on file."
12488 #: ../src/guestfs-actions.pod:4877
12489 msgid "guestfs_swapoff_label"
12493 #: ../src/guestfs-actions.pod:4879
12496 " int guestfs_swapoff_label (guestfs_h *g,\n"
12497 "\t\tconst char *label);\n"
12502 #: ../src/guestfs-actions.pod:4882 ../fish/guestfish-actions.pod:3776
12504 "This command disables the libguestfs appliance swap on labeled swap "
12509 #: ../src/guestfs-actions.pod:4887
12510 msgid "guestfs_swapoff_uuid"
12514 #: ../src/guestfs-actions.pod:4889
12517 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
12518 "\t\tconst char *uuid);\n"
12523 #: ../src/guestfs-actions.pod:4892 ../fish/guestfish-actions.pod:3783
12525 "This command disables the libguestfs appliance swap partition with the given "
12530 #: ../src/guestfs-actions.pod:4897
12531 msgid "guestfs_swapon_device"
12535 #: ../src/guestfs-actions.pod:4899
12538 " int guestfs_swapon_device (guestfs_h *g,\n"
12539 "\t\tconst char *device);\n"
12544 #: ../src/guestfs-actions.pod:4902
12546 "This command enables the libguestfs appliance to use the swap device or "
12547 "partition named C<device>. The increased memory is made available for all "
12548 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
12552 #: ../src/guestfs-actions.pod:4907 ../fish/guestfish-actions.pod:3795
12554 "Note that you should not swap to existing guest swap partitions unless you "
12555 "know what you are doing. They may contain hibernation information, or other "
12556 "information that the guest doesn't want you to trash. You also risk leaking "
12557 "information about the host to the guest this way. Instead, attach a new "
12558 "host device to the guest and swap on that."
12562 #: ../src/guestfs-actions.pod:4916
12563 msgid "guestfs_swapon_file"
12567 #: ../src/guestfs-actions.pod:4918
12570 " int guestfs_swapon_file (guestfs_h *g,\n"
12571 "\t\tconst char *file);\n"
12576 #: ../src/guestfs-actions.pod:4921
12578 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
12583 #: ../src/guestfs-actions.pod:4926
12584 msgid "guestfs_swapon_label"
12588 #: ../src/guestfs-actions.pod:4928
12591 " int guestfs_swapon_label (guestfs_h *g,\n"
12592 "\t\tconst char *label);\n"
12597 #: ../src/guestfs-actions.pod:4931
12599 "This command enables swap to a labeled swap partition. See "
12600 "C<guestfs_swapon_device> for other notes."
12604 #: ../src/guestfs-actions.pod:4936
12605 msgid "guestfs_swapon_uuid"
12609 #: ../src/guestfs-actions.pod:4938
12612 " int guestfs_swapon_uuid (guestfs_h *g,\n"
12613 "\t\tconst char *uuid);\n"
12618 #: ../src/guestfs-actions.pod:4941
12620 "This command enables swap to a swap partition with the given UUID. See "
12621 "C<guestfs_swapon_device> for other notes."
12625 #: ../src/guestfs-actions.pod:4946
12626 msgid "guestfs_sync"
12630 #: ../src/guestfs-actions.pod:4948
12633 " int guestfs_sync (guestfs_h *g);\n"
12638 #: ../src/guestfs-actions.pod:4950 ../fish/guestfish-actions.pod:3827
12640 "This syncs the disk, so that any writes are flushed through to the "
12641 "underlying disk image."
12645 #: ../src/guestfs-actions.pod:4953 ../fish/guestfish-actions.pod:3830
12647 "You should always call this if you have modified a disk image, before "
12648 "closing the handle."
12652 #: ../src/guestfs-actions.pod:4958
12653 msgid "guestfs_tail"
12657 #: ../src/guestfs-actions.pod:4960
12660 " char **guestfs_tail (guestfs_h *g,\n"
12661 "\t\tconst char *path);\n"
12666 #: ../src/guestfs-actions.pod:4963 ../fish/guestfish-actions.pod:3837
12667 msgid "This command returns up to the last 10 lines of a file as a list of strings."
12671 #: ../src/guestfs-actions.pod:4973
12672 msgid "guestfs_tail_n"
12676 #: ../src/guestfs-actions.pod:4975
12679 " char **guestfs_tail_n (guestfs_h *g,\n"
12680 "\t\tint nrlines,\n"
12681 "\t\tconst char *path);\n"
12686 #: ../src/guestfs-actions.pod:4979 ../fish/guestfish-actions.pod:3847
12688 "If the parameter C<nrlines> is a positive number, this returns the last "
12689 "C<nrlines> lines of the file C<path>."
12693 #: ../src/guestfs-actions.pod:4982 ../fish/guestfish-actions.pod:3850
12695 "If the parameter C<nrlines> is a negative number, this returns lines from "
12696 "the file C<path>, starting with the C<-nrlines>th line."
12700 #: ../src/guestfs-actions.pod:4994
12701 msgid "guestfs_tar_in"
12705 #: ../src/guestfs-actions.pod:4996
12708 " int guestfs_tar_in (guestfs_h *g,\n"
12709 "\t\tconst char *tarfile,\n"
12710 "\t\tconst char *directory);\n"
12715 #: ../src/guestfs-actions.pod:5000 ../fish/guestfish-actions.pod:3862
12717 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
12718 "tar file) into C<directory>."
12722 #: ../src/guestfs-actions.pod:5003
12723 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
12727 #: ../src/guestfs-actions.pod:5008
12728 msgid "guestfs_tar_out"
12732 #: ../src/guestfs-actions.pod:5010
12735 " int guestfs_tar_out (guestfs_h *g,\n"
12736 "\t\tconst char *directory,\n"
12737 "\t\tconst char *tarfile);\n"
12742 #: ../src/guestfs-actions.pod:5014 ../fish/guestfish-actions.pod:3874
12744 "This command packs the contents of C<directory> and downloads it to local "
12749 #: ../src/guestfs-actions.pod:5017
12751 "To download a compressed tarball, use C<guestfs_tgz_out> or "
12752 "C<guestfs_txz_out>."
12756 #: ../src/guestfs-actions.pod:5022
12757 msgid "guestfs_tgz_in"
12761 #: ../src/guestfs-actions.pod:5024
12764 " int guestfs_tgz_in (guestfs_h *g,\n"
12765 "\t\tconst char *tarball,\n"
12766 "\t\tconst char *directory);\n"
12771 #: ../src/guestfs-actions.pod:5028 ../fish/guestfish-actions.pod:3886
12773 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
12774 "tar file) into C<directory>."
12778 #: ../src/guestfs-actions.pod:5031
12779 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
12783 #: ../src/guestfs-actions.pod:5035
12784 msgid "guestfs_tgz_out"
12788 #: ../src/guestfs-actions.pod:5037
12791 " int guestfs_tgz_out (guestfs_h *g,\n"
12792 "\t\tconst char *directory,\n"
12793 "\t\tconst char *tarball);\n"
12798 #: ../src/guestfs-actions.pod:5041 ../fish/guestfish-actions.pod:3897
12800 "This command packs the contents of C<directory> and downloads it to local "
12805 #: ../src/guestfs-actions.pod:5044
12806 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
12810 #: ../src/guestfs-actions.pod:5048
12811 msgid "guestfs_touch"
12815 #: ../src/guestfs-actions.pod:5050
12818 " int guestfs_touch (guestfs_h *g,\n"
12819 "\t\tconst char *path);\n"
12824 #: ../src/guestfs-actions.pod:5053 ../fish/guestfish-actions.pod:3908
12826 "Touch acts like the L<touch(1)> command. It can be used to update the "
12827 "timestamps on a file, or, if the file does not exist, to create a new "
12828 "zero-length file."
12832 #: ../src/guestfs-actions.pod:5057 ../fish/guestfish-actions.pod:3912
12834 "This command only works on regular files, and will fail on other file types "
12835 "such as directories, symbolic links, block special etc."
12839 #: ../src/guestfs-actions.pod:5062
12840 msgid "guestfs_truncate"
12844 #: ../src/guestfs-actions.pod:5064
12847 " int guestfs_truncate (guestfs_h *g,\n"
12848 "\t\tconst char *path);\n"
12853 #: ../src/guestfs-actions.pod:5067 ../fish/guestfish-actions.pod:3919
12855 "This command truncates C<path> to a zero-length file. The file must exist "
12860 #: ../src/guestfs-actions.pod:5072
12861 msgid "guestfs_truncate_size"
12865 #: ../src/guestfs-actions.pod:5074
12868 " int guestfs_truncate_size (guestfs_h *g,\n"
12869 "\t\tconst char *path,\n"
12870 "\t\tint64_t size);\n"
12875 #: ../src/guestfs-actions.pod:5078 ../fish/guestfish-actions.pod:3926
12877 "This command truncates C<path> to size C<size> bytes. The file must exist "
12882 #: ../src/guestfs-actions.pod:5081
12884 "If the current file size is less than C<size> then the file is extended to "
12885 "the required size with zero bytes. This creates a sparse file (ie. disk "
12886 "blocks are not allocated for the file until you write to it). To create a "
12887 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
12891 #: ../src/guestfs-actions.pod:5089
12892 msgid "guestfs_tune2fs_l"
12896 #: ../src/guestfs-actions.pod:5091
12899 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
12900 "\t\tconst char *device);\n"
12905 #: ../src/guestfs-actions.pod:5094 ../fish/guestfish-actions.pod:3939
12907 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
12912 #: ../src/guestfs-actions.pod:5097 ../fish/guestfish-actions.pod:3942
12914 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
12915 "for more details. The list of fields returned isn't clearly defined, and "
12916 "depends on both the version of C<tune2fs> that libguestfs was built against, "
12917 "and the filesystem itself."
12921 #: ../src/guestfs-actions.pod:5108
12922 msgid "guestfs_txz_in"
12926 #: ../src/guestfs-actions.pod:5110
12929 " int guestfs_txz_in (guestfs_h *g,\n"
12930 "\t\tconst char *tarball,\n"
12931 "\t\tconst char *directory);\n"
12936 #: ../src/guestfs-actions.pod:5114 ../fish/guestfish-actions.pod:3951
12938 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
12939 "tar file) into C<directory>."
12943 #: ../src/guestfs-actions.pod:5119
12944 msgid "guestfs_txz_out"
12948 #: ../src/guestfs-actions.pod:5121
12951 " int guestfs_txz_out (guestfs_h *g,\n"
12952 "\t\tconst char *directory,\n"
12953 "\t\tconst char *tarball);\n"
12958 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3960
12960 "This command packs the contents of C<directory> and downloads it to local "
12961 "file C<tarball> (as an xz compressed tar archive)."
12965 #: ../src/guestfs-actions.pod:5130
12966 msgid "guestfs_umask"
12970 #: ../src/guestfs-actions.pod:5132
12973 " int guestfs_umask (guestfs_h *g,\n"
12979 #: ../src/guestfs-actions.pod:5135 ../fish/guestfish-actions.pod:3969
12981 "This function sets the mask used for creating new files and device nodes to "
12986 #: ../src/guestfs-actions.pod:5138 ../fish/guestfish-actions.pod:3972
12988 "Typical umask values would be C<022> which creates new files with "
12989 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
12990 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
12994 #: ../src/guestfs-actions.pod:5143 ../fish/guestfish-actions.pod:3977
12996 "The default umask is C<022>. This is important because it means that "
12997 "directories and device nodes will be created with C<0644> or C<0755> mode "
12998 "even if you specify C<0777>."
13002 #: ../src/guestfs-actions.pod:5147
13004 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
13005 "C<guestfs_mkdir>."
13009 #: ../src/guestfs-actions.pod:5150 ../fish/guestfish-actions.pod:3984
13010 msgid "This call returns the previous umask."
13014 #: ../src/guestfs-actions.pod:5154
13015 msgid "guestfs_umount"
13019 #: ../src/guestfs-actions.pod:5156
13022 " int guestfs_umount (guestfs_h *g,\n"
13023 "\t\tconst char *pathordevice);\n"
13028 #: ../src/guestfs-actions.pod:5159 ../fish/guestfish-actions.pod:3992
13030 "This unmounts the given filesystem. The filesystem may be specified either "
13031 "by its mountpoint (path) or the device which contains the filesystem."
13035 #: ../src/guestfs-actions.pod:5165
13036 msgid "guestfs_umount_all"
13040 #: ../src/guestfs-actions.pod:5167
13043 " int guestfs_umount_all (guestfs_h *g);\n"
13048 #: ../src/guestfs-actions.pod:5169 ../fish/guestfish-actions.pod:4002
13049 msgid "This unmounts all mounted filesystems."
13053 #: ../src/guestfs-actions.pod:5171 ../fish/guestfish-actions.pod:4004
13054 msgid "Some internal mounts are not unmounted by this call."
13058 #: ../src/guestfs-actions.pod:5175
13059 msgid "guestfs_upload"
13063 #: ../src/guestfs-actions.pod:5177
13066 " int guestfs_upload (guestfs_h *g,\n"
13067 "\t\tconst char *filename,\n"
13068 "\t\tconst char *remotefilename);\n"
13073 #: ../src/guestfs-actions.pod:5181 ../src/guestfs-actions.pod:5197 ../fish/guestfish-actions.pod:4010 ../fish/guestfish-actions.pod:4023
13074 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
13078 #: ../src/guestfs-actions.pod:5186
13079 msgid "See also C<guestfs_download>."
13083 #: ../src/guestfs-actions.pod:5190
13084 msgid "guestfs_upload_offset"
13088 #: ../src/guestfs-actions.pod:5192
13091 " int guestfs_upload_offset (guestfs_h *g,\n"
13092 "\t\tconst char *filename,\n"
13093 "\t\tconst char *remotefilename,\n"
13094 "\t\tint64_t offset);\n"
13099 #: ../src/guestfs-actions.pod:5200 ../fish/guestfish-actions.pod:4026
13101 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
13102 "The intention is to overwrite parts of existing files or devices, although "
13103 "if a non-existant file is specified then it is created with a \"hole\" "
13104 "before C<offset>. The size of the data written is implicit in the size of "
13105 "the source C<filename>."
13109 #: ../src/guestfs-actions.pod:5207
13111 "Note that there is no limit on the amount of data that can be uploaded with "
13112 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
13113 "full amount unless an error occurs."
13117 #: ../src/guestfs-actions.pod:5212
13118 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
13122 #: ../src/guestfs-actions.pod:5216
13123 msgid "guestfs_utimens"
13127 #: ../src/guestfs-actions.pod:5218
13130 " int guestfs_utimens (guestfs_h *g,\n"
13131 "\t\tconst char *path,\n"
13132 "\t\tint64_t atsecs,\n"
13133 "\t\tint64_t atnsecs,\n"
13134 "\t\tint64_t mtsecs,\n"
13135 "\t\tint64_t mtnsecs);\n"
13140 #: ../src/guestfs-actions.pod:5225 ../fish/guestfish-actions.pod:4046
13141 msgid "This command sets the timestamps of a file with nanosecond precision."
13145 #: ../src/guestfs-actions.pod:5228 ../fish/guestfish-actions.pod:4049
13147 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
13152 #: ../src/guestfs-actions.pod:5231 ../fish/guestfish-actions.pod:4052
13154 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
13155 "nanoseconds from the epoch."
13159 #: ../src/guestfs-actions.pod:5234 ../fish/guestfish-actions.pod:4055
13161 "If the C<*nsecs> field contains the special value C<-1> then the "
13162 "corresponding timestamp is set to the current time. (The C<*secs> field is "
13163 "ignored in this case)."
13167 #: ../src/guestfs-actions.pod:5238 ../fish/guestfish-actions.pod:4059
13169 "If the C<*nsecs> field contains the special value C<-2> then the "
13170 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
13175 #: ../src/guestfs-actions.pod:5244 ../src/guestfs-structs.pod:175
13176 msgid "guestfs_version"
13180 #: ../src/guestfs-actions.pod:5246
13183 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
13188 #: ../src/guestfs-actions.pod:5248 ../fish/guestfish-actions.pod:4067
13189 msgid "Return the libguestfs version number that the program is linked against."
13193 #: ../src/guestfs-actions.pod:5251 ../fish/guestfish-actions.pod:4070
13195 "Note that because of dynamic linking this is not necessarily the version of "
13196 "libguestfs that you compiled against. You can compile the program, and then "
13197 "at runtime dynamically link against a completely different C<libguestfs.so> "
13202 #: ../src/guestfs-actions.pod:5256 ../fish/guestfish-actions.pod:4075
13204 "This call was added in version C<1.0.58>. In previous versions of "
13205 "libguestfs there was no way to get the version number. From C code you can "
13206 "use dynamic linker functions to find out if this symbol exists (if it "
13207 "doesn't, then it's an earlier version)."
13211 #: ../src/guestfs-actions.pod:5262 ../fish/guestfish-actions.pod:4081
13213 "The call returns a structure with four elements. The first three (C<major>, "
13214 "C<minor> and C<release>) are numbers and correspond to the usual version "
13215 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
13216 "but may be used for distro-specific information."
13220 #: ../src/guestfs-actions.pod:5268 ../fish/guestfish-actions.pod:4087
13221 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
13225 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:4090
13226 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
13230 #: ../src/guestfs-actions.pod:5273
13232 "I<Note:> Don't use this call to test for availability of features. In "
13233 "enterprise distributions we backport features from later versions into "
13234 "earlier versions, making this an unreliable way to test for features. Use "
13235 "C<guestfs_available> instead."
13239 #: ../src/guestfs-actions.pod:5279
13241 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
13242 "error. I<The caller must call C<guestfs_free_version> after use>."
13246 #: ../src/guestfs-actions.pod:5283
13247 msgid "guestfs_vfs_label"
13251 #: ../src/guestfs-actions.pod:5285
13254 " char *guestfs_vfs_label (guestfs_h *g,\n"
13255 "\t\tconst char *device);\n"
13260 #: ../src/guestfs-actions.pod:5288 ../fish/guestfish-actions.pod:4102
13261 msgid "This returns the filesystem label of the filesystem on C<device>."
13265 #: ../src/guestfs-actions.pod:5291 ../fish/guestfish-actions.pod:4105
13266 msgid "If the filesystem is unlabeled, this returns the empty string."
13270 #: ../src/guestfs-actions.pod:5293
13271 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
13275 #: ../src/guestfs-actions.pod:5298
13276 msgid "guestfs_vfs_type"
13280 #: ../src/guestfs-actions.pod:5300
13283 " char *guestfs_vfs_type (guestfs_h *g,\n"
13284 "\t\tconst char *device);\n"
13289 #: ../src/guestfs-actions.pod:5303 ../fish/guestfish-actions.pod:4113
13291 "This command gets the filesystem type corresponding to the filesystem on "
13296 #: ../src/guestfs-actions.pod:5306 ../fish/guestfish-actions.pod:4116
13298 "For most filesystems, the result is the name of the Linux VFS module which "
13299 "would be used to mount this filesystem if you mounted it without specifying "
13300 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13304 #: ../src/guestfs-actions.pod:5314
13305 msgid "guestfs_vfs_uuid"
13309 #: ../src/guestfs-actions.pod:5316
13312 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13313 "\t\tconst char *device);\n"
13318 #: ../src/guestfs-actions.pod:5319 ../fish/guestfish-actions.pod:4125
13319 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13323 #: ../src/guestfs-actions.pod:5322 ../fish/guestfish-actions.pod:4128
13324 msgid "If the filesystem does not have a UUID, this returns the empty string."
13328 #: ../src/guestfs-actions.pod:5324
13329 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13333 #: ../src/guestfs-actions.pod:5329
13334 msgid "guestfs_vg_activate"
13338 #: ../src/guestfs-actions.pod:5331
13341 " int guestfs_vg_activate (guestfs_h *g,\n"
13342 "\t\tint activate,\n"
13343 "\t\tchar *const *volgroups);\n"
13348 #: ../src/guestfs-actions.pod:5335 ../fish/guestfish-actions.pod:4136
13350 "This command activates or (if C<activate> is false) deactivates all logical "
13351 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13352 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13353 "deactivated, then those devices disappear."
13357 #: ../src/guestfs-actions.pod:5341 ../fish/guestfish-actions.pod:4142
13358 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13362 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:4144
13364 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13365 "activated or deactivated."
13369 #: ../src/guestfs-actions.pod:5348
13370 msgid "guestfs_vg_activate_all"
13374 #: ../src/guestfs-actions.pod:5350
13377 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13378 "\t\tint activate);\n"
13383 #: ../src/guestfs-actions.pod:5353 ../fish/guestfish-actions.pod:4151
13385 "This command activates or (if C<activate> is false) deactivates all logical "
13386 "volumes in all volume groups. If activated, then they are made known to the "
13387 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13388 "those devices disappear."
13392 #: ../src/guestfs-actions.pod:5359 ../fish/guestfish-actions.pod:4157
13393 msgid "This command is the same as running C<vgchange -a y|n>"
13397 #: ../src/guestfs-actions.pod:5363
13398 msgid "guestfs_vgcreate"
13402 #: ../src/guestfs-actions.pod:5365
13405 " int guestfs_vgcreate (guestfs_h *g,\n"
13406 "\t\tconst char *volgroup,\n"
13407 "\t\tchar *const *physvols);\n"
13412 #: ../src/guestfs-actions.pod:5369 ../fish/guestfish-actions.pod:4163
13414 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13415 "of physical volumes C<physvols>."
13419 #: ../src/guestfs-actions.pod:5374
13420 msgid "guestfs_vglvuuids"
13424 #: ../src/guestfs-actions.pod:5376
13427 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13428 "\t\tconst char *vgname);\n"
13433 #: ../src/guestfs-actions.pod:5379 ../fish/guestfish-actions.pod:4170
13435 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13436 "volumes created in this volume group."
13440 #: ../src/guestfs-actions.pod:5382
13442 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13443 "associate logical volumes and volume groups."
13447 #: ../src/guestfs-actions.pod:5385
13448 msgid "See also C<guestfs_vgpvuuids>."
13452 #: ../src/guestfs-actions.pod:5391
13453 msgid "guestfs_vgpvuuids"
13457 #: ../src/guestfs-actions.pod:5393
13460 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
13461 "\t\tconst char *vgname);\n"
13466 #: ../src/guestfs-actions.pod:5396 ../fish/guestfish-actions.pod:4182
13468 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13469 "volumes that this volume group resides on."
13473 #: ../src/guestfs-actions.pod:5399
13475 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
13476 "associate physical volumes and volume groups."
13480 #: ../src/guestfs-actions.pod:5402
13481 msgid "See also C<guestfs_vglvuuids>."
13485 #: ../src/guestfs-actions.pod:5408
13486 msgid "guestfs_vgremove"
13490 #: ../src/guestfs-actions.pod:5410
13493 " int guestfs_vgremove (guestfs_h *g,\n"
13494 "\t\tconst char *vgname);\n"
13499 #: ../src/guestfs-actions.pod:5413 ../fish/guestfish-actions.pod:4194
13500 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
13504 #: ../src/guestfs-actions.pod:5415 ../fish/guestfish-actions.pod:4196
13505 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
13509 #: ../src/guestfs-actions.pod:5420
13510 msgid "guestfs_vgrename"
13514 #: ../src/guestfs-actions.pod:5422
13517 " int guestfs_vgrename (guestfs_h *g,\n"
13518 "\t\tconst char *volgroup,\n"
13519 "\t\tconst char *newvolgroup);\n"
13524 #: ../src/guestfs-actions.pod:5426 ../fish/guestfish-actions.pod:4203
13525 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
13529 #: ../src/guestfs-actions.pod:5430
13530 msgid "guestfs_vgs"
13534 #: ../src/guestfs-actions.pod:5432
13537 " char **guestfs_vgs (guestfs_h *g);\n"
13542 #: ../src/guestfs-actions.pod:5434 ../fish/guestfish-actions.pod:4209
13544 "List all the volumes groups detected. This is the equivalent of the "
13545 "L<vgs(8)> command."
13549 #: ../src/guestfs-actions.pod:5437 ../fish/guestfish-actions.pod:4212
13551 "This returns a list of just the volume group names that were detected "
13552 "(eg. C<VolGroup00>)."
13556 #: ../src/guestfs-actions.pod:5440
13557 msgid "See also C<guestfs_vgs_full>."
13561 #: ../src/guestfs-actions.pod:5446
13562 msgid "guestfs_vgs_full"
13566 #: ../src/guestfs-actions.pod:5448
13569 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
13574 #: ../src/guestfs-actions.pod:5450 ../fish/guestfish-actions.pod:4221
13576 "List all the volumes groups detected. This is the equivalent of the "
13577 "L<vgs(8)> command. The \"full\" version includes all fields."
13581 #: ../src/guestfs-actions.pod:5453
13583 "This function returns a C<struct guestfs_lvm_vg_list *> (see "
13584 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
13585 "must call C<guestfs_free_lvm_vg_list> after use>."
13589 #: ../src/guestfs-actions.pod:5458
13590 msgid "guestfs_vgscan"
13594 #: ../src/guestfs-actions.pod:5460
13597 " int guestfs_vgscan (guestfs_h *g);\n"
13602 #: ../src/guestfs-actions.pod:5462 ../fish/guestfish-actions.pod:4228
13604 "This rescans all block devices and rebuilds the list of LVM physical "
13605 "volumes, volume groups and logical volumes."
13609 #: ../src/guestfs-actions.pod:5467
13610 msgid "guestfs_vguuid"
13614 #: ../src/guestfs-actions.pod:5469
13617 " char *guestfs_vguuid (guestfs_h *g,\n"
13618 "\t\tconst char *vgname);\n"
13623 #: ../src/guestfs-actions.pod:5472 ../fish/guestfish-actions.pod:4235
13624 msgid "This command returns the UUID of the LVM VG named C<vgname>."
13628 #: ../src/guestfs-actions.pod:5477
13629 msgid "guestfs_wait_ready"
13633 #: ../src/guestfs-actions.pod:5479
13636 " int guestfs_wait_ready (guestfs_h *g);\n"
13641 #: ../src/guestfs-actions.pod:5481
13642 msgid "This function is a no op."
13646 #: ../src/guestfs-actions.pod:5483
13648 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
13649 "calling C<guestfs_launch> to wait for the launch to complete. However this "
13650 "is no longer necessary because C<guestfs_launch> now does the waiting."
13654 #: ../src/guestfs-actions.pod:5488
13656 "If you see any calls to this function in code then you can just remove them, "
13657 "unless you want to retain compatibility with older versions of the API."
13661 #: ../src/guestfs-actions.pod:5494
13662 msgid "guestfs_wc_c"
13666 #: ../src/guestfs-actions.pod:5496
13669 " int guestfs_wc_c (guestfs_h *g,\n"
13670 "\t\tconst char *path);\n"
13675 #: ../src/guestfs-actions.pod:5499 ../fish/guestfish-actions.pod:4241
13677 "This command counts the characters in a file, using the C<wc -c> external "
13682 #: ../src/guestfs-actions.pod:5504
13683 msgid "guestfs_wc_l"
13687 #: ../src/guestfs-actions.pod:5506
13690 " int guestfs_wc_l (guestfs_h *g,\n"
13691 "\t\tconst char *path);\n"
13696 #: ../src/guestfs-actions.pod:5509 ../fish/guestfish-actions.pod:4248
13698 "This command counts the lines in a file, using the C<wc -l> external "
13703 #: ../src/guestfs-actions.pod:5514
13704 msgid "guestfs_wc_w"
13708 #: ../src/guestfs-actions.pod:5516
13711 " int guestfs_wc_w (guestfs_h *g,\n"
13712 "\t\tconst char *path);\n"
13717 #: ../src/guestfs-actions.pod:5519 ../fish/guestfish-actions.pod:4255
13719 "This command counts the words in a file, using the C<wc -w> external "
13724 #: ../src/guestfs-actions.pod:5524
13725 msgid "guestfs_write"
13729 #: ../src/guestfs-actions.pod:5526
13732 " int guestfs_write (guestfs_h *g,\n"
13733 "\t\tconst char *path,\n"
13734 "\t\tconst char *content,\n"
13735 "\t\tsize_t content_size);\n"
13740 #: ../src/guestfs-actions.pod:5531 ../fish/guestfish-actions.pod:4262
13742 "This call creates a file called C<path>. The content of the file is the "
13743 "string C<content> (which can contain any 8 bit data)."
13747 #: ../src/guestfs-actions.pod:5539
13748 msgid "guestfs_write_file"
13752 #: ../src/guestfs-actions.pod:5541
13755 " int guestfs_write_file (guestfs_h *g,\n"
13756 "\t\tconst char *path,\n"
13757 "\t\tconst char *content,\n"
13763 #: ../src/guestfs-actions.pod:5546 ../fish/guestfish-actions.pod:4272
13765 "This call creates a file called C<path>. The contents of the file is the "
13766 "string C<content> (which can contain any 8 bit data), with length C<size>."
13770 #: ../src/guestfs-actions.pod:5550 ../fish/guestfish-actions.pod:4276
13772 "As a special case, if C<size> is C<0> then the length is calculated using "
13773 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
13777 #: ../src/guestfs-actions.pod:5554 ../fish/guestfish-actions.pod:4280
13779 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
13780 "I<not> work, even if the length is specified."
13784 #: ../src/guestfs-actions.pod:5562 ../fish/guestfish-actions.pod:4286
13785 msgid "This function is deprecated. In new code, use the C<write> call instead."
13789 #: ../src/guestfs-actions.pod:5569
13790 msgid "guestfs_zegrep"
13794 #: ../src/guestfs-actions.pod:5571
13797 " char **guestfs_zegrep (guestfs_h *g,\n"
13798 "\t\tconst char *regex,\n"
13799 "\t\tconst char *path);\n"
13804 #: ../src/guestfs-actions.pod:5575 ../fish/guestfish-actions.pod:4297
13805 msgid "This calls the external C<zegrep> program and returns the matching lines."
13809 #: ../src/guestfs-actions.pod:5585
13810 msgid "guestfs_zegrepi"
13814 #: ../src/guestfs-actions.pod:5587
13817 " char **guestfs_zegrepi (guestfs_h *g,\n"
13818 "\t\tconst char *regex,\n"
13819 "\t\tconst char *path);\n"
13824 #: ../src/guestfs-actions.pod:5591 ../fish/guestfish-actions.pod:4307
13825 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
13829 #: ../src/guestfs-actions.pod:5601
13830 msgid "guestfs_zero"
13834 #: ../src/guestfs-actions.pod:5603
13837 " int guestfs_zero (guestfs_h *g,\n"
13838 "\t\tconst char *device);\n"
13843 #: ../src/guestfs-actions.pod:5606 ../fish/guestfish-actions.pod:4317
13844 msgid "This command writes zeroes over the first few blocks of C<device>."
13848 #: ../src/guestfs-actions.pod:5608 ../fish/guestfish-actions.pod:4319
13850 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
13851 "securely wipe the device). It should be sufficient to remove any partition "
13852 "tables, filesystem superblocks and so on."
13856 #: ../src/guestfs-actions.pod:5612
13857 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
13861 #: ../src/guestfs-actions.pod:5621
13862 msgid "guestfs_zero_device"
13866 #: ../src/guestfs-actions.pod:5623
13869 " int guestfs_zero_device (guestfs_h *g,\n"
13870 "\t\tconst char *device);\n"
13875 #: ../src/guestfs-actions.pod:5626
13877 "This command writes zeroes over the entire C<device>. Compare with "
13878 "C<guestfs_zero> which just zeroes the first few blocks of a device."
13882 #: ../src/guestfs-actions.pod:5640
13883 msgid "guestfs_zerofree"
13887 #: ../src/guestfs-actions.pod:5642
13890 " int guestfs_zerofree (guestfs_h *g,\n"
13891 "\t\tconst char *device);\n"
13896 #: ../src/guestfs-actions.pod:5645 ../fish/guestfish-actions.pod:4340
13898 "This runs the I<zerofree> program on C<device>. This program claims to zero "
13899 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
13900 "possible to compress the filesystem more effectively."
13904 #: ../src/guestfs-actions.pod:5650 ../fish/guestfish-actions.pod:4345
13905 msgid "You should B<not> run this program if the filesystem is mounted."
13909 #: ../src/guestfs-actions.pod:5653 ../fish/guestfish-actions.pod:4348
13911 "It is possible that using this program can damage the filesystem or data on "
13916 #: ../src/guestfs-actions.pod:5658
13917 msgid "guestfs_zfgrep"
13921 #: ../src/guestfs-actions.pod:5660
13924 " char **guestfs_zfgrep (guestfs_h *g,\n"
13925 "\t\tconst char *pattern,\n"
13926 "\t\tconst char *path);\n"
13931 #: ../src/guestfs-actions.pod:5664 ../fish/guestfish-actions.pod:4355
13932 msgid "This calls the external C<zfgrep> program and returns the matching lines."
13936 #: ../src/guestfs-actions.pod:5674
13937 msgid "guestfs_zfgrepi"
13941 #: ../src/guestfs-actions.pod:5676
13944 " char **guestfs_zfgrepi (guestfs_h *g,\n"
13945 "\t\tconst char *pattern,\n"
13946 "\t\tconst char *path);\n"
13951 #: ../src/guestfs-actions.pod:5680 ../fish/guestfish-actions.pod:4365
13952 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
13956 #: ../src/guestfs-actions.pod:5690
13957 msgid "guestfs_zfile"
13961 #: ../src/guestfs-actions.pod:5692
13964 " char *guestfs_zfile (guestfs_h *g,\n"
13965 "\t\tconst char *meth,\n"
13966 "\t\tconst char *path);\n"
13971 #: ../src/guestfs-actions.pod:5696 ../fish/guestfish-actions.pod:4375
13972 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
13976 #: ../src/guestfs-actions.pod:5699 ../fish/guestfish-actions.pod:4378
13977 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
13981 #: ../src/guestfs-actions.pod:5701
13983 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
13988 #: ../src/guestfs-actions.pod:5707 ../fish/guestfish-actions.pod:4383
13989 msgid "This function is deprecated. In new code, use the C<file> call instead."
13993 #: ../src/guestfs-actions.pod:5714
13994 msgid "guestfs_zgrep"
13998 #: ../src/guestfs-actions.pod:5716
14001 " char **guestfs_zgrep (guestfs_h *g,\n"
14002 "\t\tconst char *regex,\n"
14003 "\t\tconst char *path);\n"
14008 #: ../src/guestfs-actions.pod:5720 ../fish/guestfish-actions.pod:4394
14009 msgid "This calls the external C<zgrep> program and returns the matching lines."
14013 #: ../src/guestfs-actions.pod:5730
14014 msgid "guestfs_zgrepi"
14018 #: ../src/guestfs-actions.pod:5732
14021 " char **guestfs_zgrepi (guestfs_h *g,\n"
14022 "\t\tconst char *regex,\n"
14023 "\t\tconst char *path);\n"
14028 #: ../src/guestfs-actions.pod:5736 ../fish/guestfish-actions.pod:4404
14029 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
14033 #: ../src/guestfs-availability.pod:3
14038 #: ../src/guestfs-availability.pod:5
14040 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
14041 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
14042 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
14043 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
14044 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
14048 #: ../src/guestfs-availability.pod:21
14053 #: ../src/guestfs-availability.pod:23
14055 "The following functions: L</guestfs_inotify_add_watch> "
14056 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
14057 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
14061 #: ../src/guestfs-availability.pod:31
14062 msgid "B<linuxfsuuid>"
14066 #: ../src/guestfs-availability.pod:33
14068 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
14069 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
14073 #: ../src/guestfs-availability.pod:40
14074 msgid "B<linuxmodules>"
14078 #: ../src/guestfs-availability.pod:42
14079 msgid "The following functions: L</guestfs_modprobe>"
14083 #: ../src/guestfs-availability.pod:45
14084 msgid "B<linuxxattrs>"
14088 #: ../src/guestfs-availability.pod:47
14090 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> "
14091 "L</guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> "
14092 "L</guestfs_removexattr> L</guestfs_setxattr>"
14096 #: ../src/guestfs-availability.pod:56
14101 #: ../src/guestfs-availability.pod:58
14103 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
14104 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
14105 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
14109 #: ../src/guestfs-availability.pod:67
14114 #: ../src/guestfs-availability.pod:69
14116 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
14117 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
14118 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
14119 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
14120 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
14121 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
14122 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
14123 "L</guestfs_vgs_full>"
14127 #: ../src/guestfs-availability.pod:92
14132 #: ../src/guestfs-availability.pod:94
14134 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
14135 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
14139 #: ../src/guestfs-availability.pod:100
14144 #: ../src/guestfs-availability.pod:102
14145 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
14149 #: ../src/guestfs-availability.pod:105
14150 msgid "B<ntfsprogs>"
14154 #: ../src/guestfs-availability.pod:107
14155 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
14159 #: ../src/guestfs-availability.pod:111
14160 msgid "B<realpath>"
14164 #: ../src/guestfs-availability.pod:113
14165 msgid "The following functions: L</guestfs_realpath>"
14169 #: ../src/guestfs-availability.pod:116
14174 #: ../src/guestfs-availability.pod:118
14176 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
14177 "L</guestfs_scrub_freespace>"
14181 #: ../src/guestfs-availability.pod:123
14186 #: ../src/guestfs-availability.pod:125
14187 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
14191 #: ../src/guestfs-availability.pod:129
14196 #: ../src/guestfs-availability.pod:131
14197 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
14201 #: ../src/guestfs-availability.pod:135
14202 msgid "B<zerofree>"
14206 #: ../src/guestfs-availability.pod:137
14207 msgid "The following functions: L</guestfs_zerofree>"
14211 #: ../src/guestfs-structs.pod:1
14212 msgid "guestfs_int_bool"
14216 #: ../src/guestfs-structs.pod:3
14219 " struct guestfs_int_bool {\n"
14227 #: ../src/guestfs-structs.pod:8
14230 " struct guestfs_int_bool_list {\n"
14231 " uint32_t len; /* Number of elements in list. */\n"
14232 " struct guestfs_int_bool *val; /* Elements. */\n"
14238 #: ../src/guestfs-structs.pod:13
14241 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
14242 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
14247 #: ../src/guestfs-structs.pod:16
14248 msgid "guestfs_lvm_pv"
14252 #: ../src/guestfs-structs.pod:18
14255 " struct guestfs_lvm_pv {\n"
14256 " char *pv_name;\n"
14257 " /* The next field is NOT nul-terminated, be careful when printing it: "
14259 " char pv_uuid[32];\n"
14261 " uint64_t pv_size;\n"
14262 " uint64_t dev_size;\n"
14263 " uint64_t pv_free;\n"
14264 " uint64_t pv_used;\n"
14265 " char *pv_attr;\n"
14266 " int64_t pv_pe_count;\n"
14267 " int64_t pv_pe_alloc_count;\n"
14268 " char *pv_tags;\n"
14269 " uint64_t pe_start;\n"
14270 " int64_t pv_mda_count;\n"
14271 " uint64_t pv_mda_free;\n"
14277 #: ../src/guestfs-structs.pod:36
14280 " struct guestfs_lvm_pv_list {\n"
14281 " uint32_t len; /* Number of elements in list. */\n"
14282 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14288 #: ../src/guestfs-structs.pod:41
14291 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14292 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14297 #: ../src/guestfs-structs.pod:44
14298 msgid "guestfs_lvm_vg"
14302 #: ../src/guestfs-structs.pod:46
14305 " struct guestfs_lvm_vg {\n"
14306 " char *vg_name;\n"
14307 " /* The next field is NOT nul-terminated, be careful when printing it: "
14309 " char vg_uuid[32];\n"
14311 " char *vg_attr;\n"
14312 " uint64_t vg_size;\n"
14313 " uint64_t vg_free;\n"
14314 " char *vg_sysid;\n"
14315 " uint64_t vg_extent_size;\n"
14316 " int64_t vg_extent_count;\n"
14317 " int64_t vg_free_count;\n"
14318 " int64_t max_lv;\n"
14319 " int64_t max_pv;\n"
14320 " int64_t pv_count;\n"
14321 " int64_t lv_count;\n"
14322 " int64_t snap_count;\n"
14323 " int64_t vg_seqno;\n"
14324 " char *vg_tags;\n"
14325 " int64_t vg_mda_count;\n"
14326 " uint64_t vg_mda_free;\n"
14332 #: ../src/guestfs-structs.pod:69
14335 " struct guestfs_lvm_vg_list {\n"
14336 " uint32_t len; /* Number of elements in list. */\n"
14337 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14343 #: ../src/guestfs-structs.pod:74
14346 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14347 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14352 #: ../src/guestfs-structs.pod:77
14353 msgid "guestfs_lvm_lv"
14357 #: ../src/guestfs-structs.pod:79
14360 " struct guestfs_lvm_lv {\n"
14361 " char *lv_name;\n"
14362 " /* The next field is NOT nul-terminated, be careful when printing it: "
14364 " char lv_uuid[32];\n"
14365 " char *lv_attr;\n"
14366 " int64_t lv_major;\n"
14367 " int64_t lv_minor;\n"
14368 " int64_t lv_kernel_major;\n"
14369 " int64_t lv_kernel_minor;\n"
14370 " uint64_t lv_size;\n"
14371 " int64_t seg_count;\n"
14373 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14374 " float snap_percent;\n"
14375 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14376 " float copy_percent;\n"
14377 " char *move_pv;\n"
14378 " char *lv_tags;\n"
14379 " char *mirror_log;\n"
14380 " char *modules;\n"
14386 #: ../src/guestfs-structs.pod:101
14389 " struct guestfs_lvm_lv_list {\n"
14390 " uint32_t len; /* Number of elements in list. */\n"
14391 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14397 #: ../src/guestfs-structs.pod:106
14400 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14401 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14406 #: ../src/guestfs-structs.pod:111
14409 " struct guestfs_stat {\n"
14413 " int64_t nlink;\n"
14418 " int64_t blksize;\n"
14419 " int64_t blocks;\n"
14420 " int64_t atime;\n"
14421 " int64_t mtime;\n"
14422 " int64_t ctime;\n"
14428 #: ../src/guestfs-structs.pod:127
14431 " struct guestfs_stat_list {\n"
14432 " uint32_t len; /* Number of elements in list. */\n"
14433 " struct guestfs_stat *val; /* Elements. */\n"
14439 #: ../src/guestfs-structs.pod:132
14442 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14443 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14448 #: ../src/guestfs-structs.pod:137
14451 " struct guestfs_statvfs {\n"
14452 " int64_t bsize;\n"
14453 " int64_t frsize;\n"
14454 " int64_t blocks;\n"
14455 " int64_t bfree;\n"
14456 " int64_t bavail;\n"
14457 " int64_t files;\n"
14458 " int64_t ffree;\n"
14459 " int64_t favail;\n"
14462 " int64_t namemax;\n"
14468 #: ../src/guestfs-structs.pod:151
14471 " struct guestfs_statvfs_list {\n"
14472 " uint32_t len; /* Number of elements in list. */\n"
14473 " struct guestfs_statvfs *val; /* Elements. */\n"
14479 #: ../src/guestfs-structs.pod:156
14482 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
14483 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
14488 #: ../src/guestfs-structs.pod:159
14489 msgid "guestfs_dirent"
14493 #: ../src/guestfs-structs.pod:161
14496 " struct guestfs_dirent {\n"
14505 #: ../src/guestfs-structs.pod:167
14508 " struct guestfs_dirent_list {\n"
14509 " uint32_t len; /* Number of elements in list. */\n"
14510 " struct guestfs_dirent *val; /* Elements. */\n"
14516 #: ../src/guestfs-structs.pod:172
14519 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
14520 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
14525 #: ../src/guestfs-structs.pod:177
14528 " struct guestfs_version {\n"
14529 " int64_t major;\n"
14530 " int64_t minor;\n"
14531 " int64_t release;\n"
14538 #: ../src/guestfs-structs.pod:184
14541 " struct guestfs_version_list {\n"
14542 " uint32_t len; /* Number of elements in list. */\n"
14543 " struct guestfs_version *val; /* Elements. */\n"
14549 #: ../src/guestfs-structs.pod:189
14552 " void guestfs_free_version (struct guestfs_free_version *);\n"
14553 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
14558 #: ../src/guestfs-structs.pod:192
14559 msgid "guestfs_xattr"
14563 #: ../src/guestfs-structs.pod:194
14566 " struct guestfs_xattr {\n"
14567 " char *attrname;\n"
14568 " /* The next two fields describe a byte array. */\n"
14569 " uint32_t attrval_len;\n"
14570 " char *attrval;\n"
14576 #: ../src/guestfs-structs.pod:201
14579 " struct guestfs_xattr_list {\n"
14580 " uint32_t len; /* Number of elements in list. */\n"
14581 " struct guestfs_xattr *val; /* Elements. */\n"
14587 #: ../src/guestfs-structs.pod:206
14590 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
14591 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
14596 #: ../src/guestfs-structs.pod:209
14597 msgid "guestfs_inotify_event"
14601 #: ../src/guestfs-structs.pod:211
14604 " struct guestfs_inotify_event {\n"
14605 " int64_t in_wd;\n"
14606 " uint32_t in_mask;\n"
14607 " uint32_t in_cookie;\n"
14608 " char *in_name;\n"
14614 #: ../src/guestfs-structs.pod:218
14617 " struct guestfs_inotify_event_list {\n"
14618 " uint32_t len; /* Number of elements in list. */\n"
14619 " struct guestfs_inotify_event *val; /* Elements. */\n"
14625 #: ../src/guestfs-structs.pod:223
14628 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
14629 " void guestfs_free_inotify_event_list (struct "
14630 "guestfs_free_inotify_event_list *);\n"
14635 #: ../src/guestfs-structs.pod:226
14636 msgid "guestfs_partition"
14640 #: ../src/guestfs-structs.pod:228
14643 " struct guestfs_partition {\n"
14644 " int32_t part_num;\n"
14645 " uint64_t part_start;\n"
14646 " uint64_t part_end;\n"
14647 " uint64_t part_size;\n"
14653 #: ../src/guestfs-structs.pod:235
14656 " struct guestfs_partition_list {\n"
14657 " uint32_t len; /* Number of elements in list. */\n"
14658 " struct guestfs_partition *val; /* Elements. */\n"
14664 #: ../src/guestfs-structs.pod:240
14667 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
14668 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
14673 #: ../fish/guestfish.pod:5
14674 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
14678 #: ../fish/guestfish.pod:9
14681 " guestfish [--options] [commands]\n"
14686 #: ../fish/guestfish.pod:11
14694 #: ../fish/guestfish.pod:13
14697 " guestfish -a disk.img\n"
14702 #: ../fish/guestfish.pod:15
14705 " guestfish -a disk.img -m dev[:mountpoint]\n"
14710 #: ../fish/guestfish.pod:17
14713 " guestfish -d libvirt-domain\n"
14718 #: ../fish/guestfish.pod:19
14721 " guestfish -a disk.img -i\n"
14726 #: ../fish/guestfish.pod:21
14729 " guestfish -d libvirt-domain -i\n"
14734 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:11 ../tools/virt-edit.pl:45 ../tools/virt-win-reg.pl:52 ../tools/virt-tar.pl:60 ../tools/virt-rescue.pl:41
14739 #: ../fish/guestfish.pod:25
14741 "Using guestfish in read/write mode on live virtual machines can be "
14742 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
14743 "option to use guestfish safely if the disk image or virtual machine might be "
14748 #: ../fish/guestfish.pod:32
14750 "Guestfish is a shell and command-line tool for examining and modifying "
14751 "virtual machine filesystems. It uses libguestfs and exposes all of the "
14752 "functionality of the guestfs API, see L<guestfs(3)>."
14756 #: ../fish/guestfish.pod:36
14758 "Guestfish gives you structured access to the libguestfs API, from shell "
14759 "scripts or the command line or interactively. If you want to rescue a "
14760 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
14765 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:800 ../fuse/guestmount.pod:35 ../tools/virt-edit.pl:59 ../tools/virt-resize.pl:66 ../tools/virt-cat.pl:51 ../tools/virt-tar.pl:46
14770 #: ../fish/guestfish.pod:43
14771 msgid "As an interactive shell"
14775 #: ../fish/guestfish.pod:45
14783 #: ../fish/guestfish.pod:47
14786 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
14787 " editing virtual machine filesystems.\n"
14792 #: ../fish/guestfish.pod:50
14795 " Type: 'help' for a list of commands\n"
14796 " 'man' to read the manual\n"
14797 " 'quit' to quit the shell\n"
14802 #: ../fish/guestfish.pod:54
14805 " ><fs> add-ro disk.img\n"
14807 " ><fs> list-filesystems\n"
14808 " /dev/sda1: ext4\n"
14809 " /dev/vg_guest/lv_root: ext4\n"
14810 " /dev/vg_guest/lv_swap: swap\n"
14811 " ><fs> mount /dev/vg_guest/lv_root /\n"
14812 " ><fs> cat /etc/fstab\n"
14814 " # Created by anaconda\n"
14821 #: ../fish/guestfish.pod:67
14822 msgid "From shell scripts"
14826 #: ../fish/guestfish.pod:69
14827 msgid "Create a new C</etc/motd> file in a guest or disk image:"
14831 #: ../fish/guestfish.pod:71
14834 " guestfish <<_EOF_\n"
14837 " mount /dev/vg_guest/lv_root /\n"
14838 " write /etc/motd \"Welcome, new users\"\n"
14844 #: ../fish/guestfish.pod:78
14845 msgid "List the LVM logical volumes in a disk image:"
14849 #: ../fish/guestfish.pod:80
14852 " guestfish -a disk.img --ro <<_EOF_\n"
14860 #: ../fish/guestfish.pod:85
14861 msgid "List all the filesystems in a disk image:"
14865 #: ../fish/guestfish.pod:87
14868 " guestfish -a disk.img --ro <<_EOF_\n"
14870 " list-filesystems\n"
14876 #: ../fish/guestfish.pod:92
14877 msgid "On one command line"
14881 #: ../fish/guestfish.pod:94
14882 msgid "Update C</etc/resolv.conf> in a guest:"
14886 #: ../fish/guestfish.pod:96
14890 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
14891 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
14896 #: ../fish/guestfish.pod:100
14897 msgid "Edit C</boot/grub/grub.conf> interactively:"
14901 #: ../fish/guestfish.pod:102
14904 " guestfish --add disk.img \\\n"
14905 " --mount /dev/vg_guest/lv_root \\\n"
14906 " --mount /dev/sda1:/boot \\\n"
14907 " edit /boot/grub/grub.conf\n"
14912 #: ../fish/guestfish.pod:107
14913 msgid "Mount disks automatically"
14917 #: ../fish/guestfish.pod:109
14919 "Use the I<-i> option to automatically mount the disks from a virtual "
14924 #: ../fish/guestfish.pod:112
14927 " guestfish --ro -a disk.img -i cat /etc/group\n"
14932 #: ../fish/guestfish.pod:114
14935 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
14940 #: ../fish/guestfish.pod:116
14941 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
14945 #: ../fish/guestfish.pod:118
14948 " guestfish -a disk.img -i edit /boot/grub/grub.conf\n"
14953 #: ../fish/guestfish.pod:120
14954 msgid "As a script interpreter"
14958 #: ../fish/guestfish.pod:122
14959 msgid "Create a 100MB disk containing an ext2-formatted partition:"
14963 #: ../fish/guestfish.pod:124
14966 " #!/usr/bin/guestfish -f\n"
14967 " sparse test1.img 100M\n"
14969 " part-disk /dev/sda mbr\n"
14970 " mkfs ext2 /dev/sda1\n"
14975 #: ../fish/guestfish.pod:130
14976 msgid "Start with a prepared disk"
14980 #: ../fish/guestfish.pod:132
14982 "An alternate way to create a 100MB disk called C<test1.img> containing a "
14983 "single ext2-formatted partition:"
14987 #: ../fish/guestfish.pod:135
14990 " guestfish -N fs\n"
14995 #: ../fish/guestfish.pod:137
14996 msgid "To list what is available do:"
15000 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:791
15003 " guestfish -N help | less\n"
15008 #: ../fish/guestfish.pod:141
15009 msgid "Remote control"
15013 #: ../fish/guestfish.pod:143
15016 " eval `guestfish --listen`\n"
15017 " guestfish --remote add-ro disk.img\n"
15018 " guestfish --remote run\n"
15019 " guestfish --remote lvs\n"
15024 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:70 ../inspector/virt-inspector.pl:75 ../tools/virt-edit.pl:73 ../tools/virt-win-reg.pl:172 ../tools/virt-df.pl:71 ../tools/virt-ls.pl:79 ../tools/virt-resize.pl:257 ../tools/virt-list-filesystems.pl:50 ../tools/virt-cat.pl:80 ../tools/virt-tar.pl:99 ../tools/virt-rescue.pl:103 ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:51
15029 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:94 ../inspector/virt-inspector.pl:83 ../tools/virt-edit.pl:81 ../tools/virt-win-reg.pl:180 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:87 ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58 ../tools/virt-cat.pl:88 ../tools/virt-tar.pl:107 ../tools/virt-rescue.pl:111 ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:59
15034 #: ../fish/guestfish.pod:154
15035 msgid "Displays general help on options."
15039 #: ../fish/guestfish.pod:156
15040 msgid "B<-h> | B<--cmd-help>"
15044 #: ../fish/guestfish.pod:158
15045 msgid "Lists all available guestfish commands."
15049 #: ../fish/guestfish.pod:160
15050 msgid "B<-h cmd> | B<--cmd-help cmd>"
15054 #: ../fish/guestfish.pod:162
15055 msgid "Displays detailed help on a single command C<cmd>."
15059 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:74
15060 msgid "B<-a image> | B<--add image>"
15064 #: ../fish/guestfish.pod:166
15065 msgid "Add a block device or virtual machine image to the shell."
15069 #: ../fish/guestfish.pod:168
15071 "The format of the disk image is auto-detected. To override this and force a "
15072 "particular format use the I<--format=..> option."
15076 #: ../fish/guestfish.pod:171
15077 msgid "B<-c URI> | B<--connect URI>"
15081 #: ../fish/guestfish.pod:173
15083 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15084 "URI to use. The default is to use the default libvirt connection."
15088 #: ../fish/guestfish.pod:177
15089 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
15093 #: ../fish/guestfish.pod:179
15095 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15096 "used, then any libvirt domain can be used. However in write mode, only "
15097 "libvirt domains which are shut down can be named here."
15101 #: ../fish/guestfish.pod:183
15102 msgid "B<-D> | B<--no-dest-paths>"
15106 #: ../fish/guestfish.pod:185
15108 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15109 "to hit the tab key to complete paths on the guest filesystem, but this "
15110 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15111 "allow this feature to be disabled."
15115 #: ../fish/guestfish.pod:190
15116 msgid "B<--echo-keys>"
15120 #: ../fish/guestfish.pod:192
15122 "When prompting for keys and passphrases, guestfish normally turns echoing "
15123 "off so you cannot see what you are typing. If you are not worried about "
15124 "Tempest attacks and there is no one else in the room you can specify this "
15125 "flag to see what you are typing."
15129 #: ../fish/guestfish.pod:197
15130 msgid "B<-f file> | B<--file file>"
15134 #: ../fish/guestfish.pod:199
15135 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15139 #: ../fish/guestfish.pod:202
15142 " #!/usr/bin/guestfish -f\n"
15147 #: ../fish/guestfish.pod:204
15148 msgid "B<--format=raw|qcow2|..> | B<--format>"
15152 #: ../fish/guestfish.pod:206
15154 "The default for the I<-a> option is to auto-detect the format of the disk "
15155 "image. Using this forces the disk format for I<-a> options which follow on "
15156 "the command line. Using I<--format> with no argument switches back to "
15157 "auto-detection for subsequent I<-a> options."
15161 #: ../fish/guestfish.pod:211 ../fish/guestfish.pod:504
15162 msgid "For example:"
15166 #: ../fish/guestfish.pod:213
15169 " guestfish --format=raw -a disk.img\n"
15174 #: ../fish/guestfish.pod:215
15175 msgid "forces raw format (no auto-detection) for C<disk.img>."
15179 #: ../fish/guestfish.pod:217
15182 " guestfish --format=raw -a disk.img --format -a another.img\n"
15187 #: ../fish/guestfish.pod:219
15189 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
15190 "auto-detection for C<another.img>."
15194 #: ../fish/guestfish.pod:222
15196 "If you have untrusted raw-format guest disk images, you should use this "
15197 "option to specify the disk format. This avoids a possible security problem "
15198 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15202 #: ../fish/guestfish.pod:227
15203 msgid "B<-i> | B<--inspector>"
15207 #: ../fish/guestfish.pod:229
15209 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15210 "system and mount filesystems as they would be mounted on the real virtual "
15215 #: ../fish/guestfish.pod:233
15216 msgid "Typical usage is either:"
15220 #: ../fish/guestfish.pod:235
15223 " guestfish -d myguest -i\n"
15228 #: ../fish/guestfish.pod:237
15229 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15233 #: ../fish/guestfish.pod:239
15236 " guestfish --ro -d myguest -i\n"
15241 #: ../fish/guestfish.pod:241
15242 msgid "(for active domains, readonly), or specify the block device directly:"
15246 #: ../fish/guestfish.pod:243
15249 " guestfish -a /dev/Guests/MyGuest -i\n"
15254 #: ../fish/guestfish.pod:245
15256 "Note that the command line syntax changed slightly over older versions of "
15257 "guestfish. You can still use the old syntax:"
15261 #: ../fish/guestfish.pod:248
15264 " guestfish [--ro] -i disk.img\n"
15269 #: ../fish/guestfish.pod:250
15272 " guestfish [--ro] -i libvirt-domain\n"
15277 #: ../fish/guestfish.pod:252
15278 msgid "B<--keys-from-stdin>"
15282 #: ../fish/guestfish.pod:254
15284 "Read key or passphrase parameters from stdin. The default is to try to read "
15285 "passphrases from the user by opening C</dev/tty>."
15289 #: ../fish/guestfish.pod:257
15290 msgid "B<--listen>"
15294 #: ../fish/guestfish.pod:259
15296 "Fork into the background and listen for remote commands. See section "
15297 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15301 #: ../fish/guestfish.pod:262
15302 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
15306 #: ../fish/guestfish.pod:264
15307 msgid "Mount the named partition or logical volume on the given mountpoint."
15311 #: ../fish/guestfish.pod:266
15312 msgid "If the mountpoint is omitted, it defaults to C</>."
15316 #: ../fish/guestfish.pod:268
15317 msgid "You have to mount something on C</> before most commands will work."
15321 #: ../fish/guestfish.pod:270
15323 "If any I<-m> or I<--mount> options are given, the guest is automatically "
15328 #: ../fish/guestfish.pod:273
15330 "If you don't know what filesystems a disk image contains, you can either run "
15331 "guestfish without this option, then list the partitions and LVs available "
15332 "(see L</list-partitions> and L</lvs> commands), or you can use the "
15333 "L<virt-list-filesystems(1)> program."
15337 #: ../fish/guestfish.pod:278 ../fuse/guestmount.pod:106
15338 msgid "B<-n> | B<--no-sync>"
15342 #: ../fish/guestfish.pod:280
15344 "Disable autosync. This is enabled by default. See the discussion of "
15345 "autosync in the L<guestfs(3)> manpage."
15349 #: ../fish/guestfish.pod:283
15350 msgid "B<-N type> | B<--new type> | B<-N help>"
15354 #: ../fish/guestfish.pod:285
15356 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
15357 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
15358 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
15363 #: ../fish/guestfish.pod:290
15364 msgid "B<--progress-bars>"
15368 #: ../fish/guestfish.pod:292
15369 msgid "Enable progress bars, even when guestfish is used non-interactively."
15373 #: ../fish/guestfish.pod:294
15375 "Progress bars are enabled by default when guestfish is used as an "
15376 "interactive shell."
15380 #: ../fish/guestfish.pod:297
15381 msgid "B<--no-progress-bars>"
15385 #: ../fish/guestfish.pod:299
15386 msgid "Disable progress bars."
15390 #: ../fish/guestfish.pod:301
15391 msgid "B<--remote[=pid]>"
15395 #: ../fish/guestfish.pod:303
15397 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15398 "CONTROL GUESTFISH OVER A SOCKET> below."
15402 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:148
15403 msgid "B<-r> | B<--ro>"
15407 #: ../fish/guestfish.pod:308
15409 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15410 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15414 #: ../fish/guestfish.pod:311 ../tools/virt-rescue.pl:179
15416 "The option must always be used if the disk image or virtual machine might be "
15417 "running, and is generally recommended in cases where you don't need write "
15418 "access to the disk."
15422 #: ../fish/guestfish.pod:315
15424 "Note that prepared disk images created with I<-N> are not affected by the "
15429 #: ../fish/guestfish.pod:318 ../fuse/guestmount.pod:158 ../tools/virt-rescue.pl:187
15430 msgid "B<--selinux>"
15434 #: ../fish/guestfish.pod:320
15435 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
15439 #: ../fish/guestfish.pod:322 ../fuse/guestmount.pod:168
15440 msgid "B<-v> | B<--verbose>"
15444 #: ../fish/guestfish.pod:324
15446 "Enable very verbose messages. This is particularly useful if you find a "
15451 #: ../fish/guestfish.pod:327 ../fuse/guestmount.pod:172
15452 msgid "B<-V> | B<--version>"
15456 #: ../fish/guestfish.pod:329
15457 msgid "Display the guestfish / libguestfs version number and exit."
15461 #: ../fish/guestfish.pod:331
15466 #: ../fish/guestfish.pod:333
15467 msgid "Echo each command before executing it."
15471 #: ../fish/guestfish.pod:337
15472 msgid "COMMANDS ON COMMAND LINE"
15476 #: ../fish/guestfish.pod:339
15477 msgid "Any additional (non-option) arguments are treated as commands to execute."
15481 #: ../fish/guestfish.pod:342
15483 "Commands to execute should be separated by a colon (C<:>), where the colon "
15484 "is a separate parameter. Thus:"
15488 #: ../fish/guestfish.pod:345
15491 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
15496 #: ../fish/guestfish.pod:347
15498 "If there are no additional arguments, then we enter a shell, either an "
15499 "interactive shell with a prompt (if the input is a terminal) or a "
15500 "non-interactive shell."
15504 #: ../fish/guestfish.pod:351
15506 "In either command line mode or non-interactive shell, the first command that "
15507 "gives an error causes the whole shell to exit. In interactive mode (with a "
15508 "prompt) if a command fails, you can continue to enter commands."
15512 #: ../fish/guestfish.pod:356
15513 msgid "USING launch (OR run)"
15517 #: ../fish/guestfish.pod:358
15519 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
15520 "then launch it, then mount any disks you need, and finally issue "
15521 "actions/commands. So the general order of the day is:"
15525 #: ../fish/guestfish.pod:366
15526 msgid "add or -a/--add"
15530 #: ../fish/guestfish.pod:370
15531 msgid "launch (aka run)"
15535 #: ../fish/guestfish.pod:374
15536 msgid "mount or -m/--mount"
15540 #: ../fish/guestfish.pod:378
15541 msgid "any other commands"
15545 #: ../fish/guestfish.pod:382
15547 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
15548 "guest before mounting or performing any other commands."
15552 #: ../fish/guestfish.pod:385
15554 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
15555 "I<--new> options were given then C<run> is done automatically, simply "
15556 "because guestfish can't perform the action you asked for without doing this."
15560 #: ../fish/guestfish.pod:390
15565 #: ../fish/guestfish.pod:392
15567 "You can quote ordinary parameters using either single or double quotes. For "
15572 #: ../fish/guestfish.pod:395
15575 " add \"file with a space.img\"\n"
15580 #: ../fish/guestfish.pod:397
15583 " rm '/file name'\n"
15588 #: ../fish/guestfish.pod:399
15596 #: ../fish/guestfish.pod:401
15598 "A few commands require a list of strings to be passed. For these, use a "
15599 "whitespace-separated list, enclosed in quotes. Strings containing "
15600 "whitespace to be passed through must be enclosed in single quotes. A "
15601 "literal single quote must be escaped with a backslash."
15605 #: ../fish/guestfish.pod:406
15608 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
15609 " command \"/bin/echo 'foo bar'\"\n"
15610 " command \"/bin/echo \\'foo\\'\"\n"
15615 #: ../fish/guestfish.pod:410
15616 msgid "OPTIONAL ARGUMENTS"
15620 #: ../fish/guestfish.pod:412
15622 "Some commands take optional arguments. These arguments appear in this "
15623 "documentation as C<[argname:..]>. You can use them as in these examples:"
15627 #: ../fish/guestfish.pod:416
15630 " add-drive-opts filename\n"
15635 #: ../fish/guestfish.pod:418
15638 " add-drive-opts filename readonly:true\n"
15643 #: ../fish/guestfish.pod:420
15646 " add-drive-opts filename format:qcow2 readonly:false\n"
15651 #: ../fish/guestfish.pod:422
15653 "Each optional argument can appear at most once. All optional arguments must "
15654 "appear after the required ones."
15658 #: ../fish/guestfish.pod:425
15663 #: ../fish/guestfish.pod:427
15664 msgid "This section applies to all commands which can take integers as parameters."
15668 #: ../fish/guestfish.pod:430
15669 msgid "SIZE SUFFIX"
15673 #: ../fish/guestfish.pod:432
15675 "When the command takes a parameter measured in bytes, you can use one of the "
15676 "following suffixes to specify kilobytes, megabytes and larger sizes:"
15680 #: ../fish/guestfish.pod:438
15681 msgid "B<k> or B<K> or B<KiB>"
15685 #: ../fish/guestfish.pod:440
15686 msgid "The size in kilobytes (multiplied by 1024)."
15690 #: ../fish/guestfish.pod:442
15695 #: ../fish/guestfish.pod:444
15696 msgid "The size in SI 1000 byte units."
15700 #: ../fish/guestfish.pod:446
15701 msgid "B<M> or B<MiB>"
15705 #: ../fish/guestfish.pod:448
15706 msgid "The size in megabytes (multiplied by 1048576)."
15710 #: ../fish/guestfish.pod:450
15715 #: ../fish/guestfish.pod:452
15716 msgid "The size in SI 1000000 byte units."
15720 #: ../fish/guestfish.pod:454
15721 msgid "B<G> or B<GiB>"
15725 #: ../fish/guestfish.pod:456
15726 msgid "The size in gigabytes (multiplied by 2**30)."
15730 #: ../fish/guestfish.pod:458
15735 #: ../fish/guestfish.pod:460
15736 msgid "The size in SI 10**9 byte units."
15740 #: ../fish/guestfish.pod:462
15741 msgid "B<T> or B<TiB>"
15745 #: ../fish/guestfish.pod:464
15746 msgid "The size in terabytes (multiplied by 2**40)."
15750 #: ../fish/guestfish.pod:466
15755 #: ../fish/guestfish.pod:468
15756 msgid "The size in SI 10**12 byte units."
15760 #: ../fish/guestfish.pod:470
15761 msgid "B<P> or B<PiB>"
15765 #: ../fish/guestfish.pod:472
15766 msgid "The size in petabytes (multiplied by 2**50)."
15770 #: ../fish/guestfish.pod:474
15775 #: ../fish/guestfish.pod:476
15776 msgid "The size in SI 10**15 byte units."
15780 #: ../fish/guestfish.pod:478
15781 msgid "B<E> or B<EiB>"
15785 #: ../fish/guestfish.pod:480
15786 msgid "The size in exabytes (multiplied by 2**60)."
15790 #: ../fish/guestfish.pod:482
15795 #: ../fish/guestfish.pod:484
15796 msgid "The size in SI 10**18 byte units."
15800 #: ../fish/guestfish.pod:486
15801 msgid "B<Z> or B<ZiB>"
15805 #: ../fish/guestfish.pod:488
15806 msgid "The size in zettabytes (multiplied by 2**70)."
15810 #: ../fish/guestfish.pod:490
15815 #: ../fish/guestfish.pod:492
15816 msgid "The size in SI 10**21 byte units."
15820 #: ../fish/guestfish.pod:494
15821 msgid "B<Y> or B<YiB>"
15825 #: ../fish/guestfish.pod:496
15826 msgid "The size in yottabytes (multiplied by 2**80)."
15830 #: ../fish/guestfish.pod:498
15835 #: ../fish/guestfish.pod:500
15836 msgid "The size in SI 10**24 byte units."
15840 #: ../fish/guestfish.pod:506
15843 " truncate-size /file 1G\n"
15848 #: ../fish/guestfish.pod:508
15849 msgid "would truncate the file to 1 gigabyte."
15853 #: ../fish/guestfish.pod:510
15855 "Be careful because a few commands take sizes in kilobytes or megabytes "
15856 "(eg. the parameter to L</memsize> is specified in megabytes already). "
15857 "Adding a suffix will probably not do what you expect."
15861 #: ../fish/guestfish.pod:514
15862 msgid "OCTAL AND HEXADECIMAL NUMBERS"
15866 #: ../fish/guestfish.pod:516
15868 "For specifying the radix (base) use the C convention: C<0> to prefix an "
15869 "octal number or C<0x> to prefix a hexadecimal number. For example:"
15873 #: ../fish/guestfish.pod:519
15876 " 1234 decimal number 1234\n"
15877 " 02322 octal number, equivalent to decimal 1234\n"
15878 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
15883 #: ../fish/guestfish.pod:523
15885 "When using the C<chmod> command, you almost always want to specify an octal "
15886 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
15887 "L<chmod(1)> program):"
15891 #: ../fish/guestfish.pod:527
15894 " chmod 0777 /public # OK\n"
15895 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
15900 #: ../fish/guestfish.pod:530
15902 "Commands that return numbers usually print them in decimal, but some "
15903 "commands print numbers in other radices (eg. C<umask> prints the mode in "
15904 "octal, preceeded by C<0>)."
15908 #: ../fish/guestfish.pod:534
15909 msgid "WILDCARDS AND GLOBBING"
15913 #: ../fish/guestfish.pod:536
15915 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
15916 "(globbing) by default. So for example the following will not do what you "
15921 #: ../fish/guestfish.pod:540
15929 #: ../fish/guestfish.pod:542
15931 "Assuming you don't have a directory called literally C</home/*> then the "
15932 "above command will return an error."
15936 #: ../fish/guestfish.pod:545
15937 msgid "To perform wildcard expansion, use the C<glob> command."
15941 #: ../fish/guestfish.pod:547
15944 " glob rm-rf /home/*\n"
15949 #: ../fish/guestfish.pod:549
15951 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
15952 "many times), equivalent to:"
15956 #: ../fish/guestfish.pod:552
15959 " rm-rf /home/jim\n"
15960 " rm-rf /home/joe\n"
15961 " rm-rf /home/mary\n"
15966 #: ../fish/guestfish.pod:556
15967 msgid "C<glob> only works on simple guest paths and not on device names."
15971 #: ../fish/guestfish.pod:558
15973 "If you have several parameters, each containing a wildcard, then glob will "
15974 "perform a Cartesian product."
15978 #: ../fish/guestfish.pod:561
15983 #: ../fish/guestfish.pod:563
15985 "Any line which starts with a I<#> character is treated as a comment and "
15986 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
15987 "a command. For example:"
15991 #: ../fish/guestfish.pod:567
15994 " # this is a comment\n"
15995 " # this is a comment\n"
15996 " foo # NOT a comment\n"
16001 #: ../fish/guestfish.pod:571
16002 msgid "Blank lines are also ignored."
16006 #: ../fish/guestfish.pod:573
16007 msgid "RUNNING COMMANDS LOCALLY"
16011 #: ../fish/guestfish.pod:575
16013 "Any line which starts with a I<!> character is treated as a command sent to "
16014 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
16018 #: ../fish/guestfish.pod:579
16022 " tgz-out /remote local/remote-data.tar.gz\n"
16027 #: ../fish/guestfish.pod:582
16029 "will create a directory C<local> on the host, and then export the contents "
16030 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
16031 "(See C<tgz-out>)."
16035 #: ../fish/guestfish.pod:586
16037 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
16038 "effect, due to the way that subprocesses work in Unix."
16042 #: ../fish/guestfish.pod:589
16047 #: ../fish/guestfish.pod:591
16049 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
16050 "command (a guestfish command) to the second command (any host command). For "
16055 #: ../fish/guestfish.pod:595
16058 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
16063 #: ../fish/guestfish.pod:597
16065 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
16066 "program). The above command would list all accounts in the guest filesystem "
16067 "which have UID 0, ie. root accounts including backdoors. Other examples:"
16071 #: ../fish/guestfish.pod:602
16074 " hexdump /bin/ls | head\n"
16075 " list-devices | tail -1\n"
16076 " tgz-out / - | tar ztf -\n"
16081 #: ../fish/guestfish.pod:606
16083 "The space before the pipe symbol is required, any space after the pipe "
16084 "symbol is optional. Everything after the pipe symbol is just passed "
16085 "straight to the host shell, so it can contain redirections, globs and "
16086 "anything else that makes sense on the host side."
16090 #: ../fish/guestfish.pod:611
16092 "To use a literal argument which begins with a pipe symbol, you have to quote "
16097 #: ../fish/guestfish.pod:614
16105 #: ../fish/guestfish.pod:616
16106 msgid "HOME DIRECTORIES"
16110 #: ../fish/guestfish.pod:618
16112 "If a parameter starts with the character C<~> then the tilde may be expanded "
16113 "as a home directory path (either C<~> for the current user's home directory, "
16114 "or C<~user> for another user)."
16118 #: ../fish/guestfish.pod:622
16120 "Note that home directory expansion happens for users known I<on the host>, "
16121 "not in the guest filesystem."
16125 #: ../fish/guestfish.pod:625
16127 "To use a literal argument which begins with a tilde, you have to quote it, "
16132 #: ../fish/guestfish.pod:628
16140 #: ../fish/guestfish.pod:632
16142 "Libguestfs has some support for Linux guests encrypted according to the "
16143 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
16144 "disk encryption systems used by modern Linux guests. Currently only "
16145 "LVM-on-LUKS is supported."
16149 #: ../fish/guestfish.pod:637
16150 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
16154 #: ../fish/guestfish.pod:639
16157 " ><fs> vfs-type /dev/sda2\n"
16163 #: ../fish/guestfish.pod:642
16165 "Then open those devices using L</luks-open>. This creates a device-mapper "
16166 "device called C</dev/mapper/luksdev>."
16170 #: ../fish/guestfish.pod:645
16173 " ><fs> luks-open /dev/sda2 luksdev\n"
16174 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
16179 #: ../fish/guestfish.pod:648
16181 "Finally you have to tell LVM to scan for volume groups on the newly created "
16186 #: ../fish/guestfish.pod:651
16190 " vg-activate-all true\n"
16195 #: ../fish/guestfish.pod:654
16196 msgid "The logical volume(s) can now be mounted in the usual way."
16200 #: ../fish/guestfish.pod:656
16202 "Before closing a LUKS device you must unmount any logical volumes on it and "
16203 "deactivate the volume groups by calling C<vg-activate false VG> on each "
16204 "one. Then you can close the mapper device:"
16208 #: ../fish/guestfish.pod:660
16211 " vg-activate false /dev/VG\n"
16212 " luks-close /dev/mapper/luksdev\n"
16217 #: ../fish/guestfish.pod:663
16218 msgid "WINDOWS PATHS"
16222 #: ../fish/guestfish.pod:665
16224 "If a path is prefixed with C<win:> then you can use Windows-style paths "
16225 "(with some limitations). The following commands are equivalent:"
16229 #: ../fish/guestfish.pod:668
16232 " file /WINDOWS/system32/config/system.LOG\n"
16237 #: ../fish/guestfish.pod:670
16240 " file win:/windows/system32/config/system.log\n"
16245 #: ../fish/guestfish.pod:672
16248 " file win:\\windows\\system32\\config\\system.log\n"
16253 #: ../fish/guestfish.pod:674
16256 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
16261 #: ../fish/guestfish.pod:676
16263 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
16264 "handles case insensitivity like Windows would. This only works in argument "
16265 "positions that expect a path."
16269 #: ../fish/guestfish.pod:680
16270 msgid "UPLOADING AND DOWNLOADING FILES"
16274 #: ../fish/guestfish.pod:682
16276 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
16277 "others which upload from or download to a local file, you can use the "
16278 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
16282 #: ../fish/guestfish.pod:686
16290 #: ../fish/guestfish.pod:688
16291 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
16295 #: ../fish/guestfish.pod:691
16298 " tar-out /etc - | tar tf -\n"
16303 #: ../fish/guestfish.pod:693
16305 "writes the tarball to stdout and then pipes that into the external \"tar\" "
16306 "command (see L</PIPES>)."
16310 #: ../fish/guestfish.pod:696
16312 "When using C<-> to read from stdin, the input is read up to the end of "
16313 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
16314 "some arbitrary end marker:"
16318 #: ../fish/guestfish.pod:700
16321 " upload -<<END /foo\n"
16330 #: ../fish/guestfish.pod:706
16332 "Any string of characters can be used instead of C<END>. The end marker must "
16333 "appear on a line of its own, without any preceeding or following characters "
16334 "(not even spaces)."
16338 #: ../fish/guestfish.pod:710
16340 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
16341 "upload local files (so-called \"FileIn\" parameters in the generator)."
16345 #: ../fish/guestfish.pod:713
16346 msgid "EXIT ON ERROR BEHAVIOUR"
16350 #: ../fish/guestfish.pod:715
16352 "By default, guestfish will ignore any errors when in interactive mode "
16353 "(ie. taking commands from a human over a tty), and will exit on the first "
16354 "error in non-interactive mode (scripts, commands given on the command line)."
16358 #: ../fish/guestfish.pod:720
16360 "If you prefix a command with a I<-> character, then that command will not "
16361 "cause guestfish to exit, even if that (one) command returns an error."
16365 #: ../fish/guestfish.pod:724
16366 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
16370 #: ../fish/guestfish.pod:726
16372 "Guestfish can be remote-controlled over a socket. This is useful "
16373 "particularly in shell scripts where you want to make several different "
16374 "changes to a filesystem, but you don't want the overhead of starting up a "
16375 "guestfish process each time."
16379 #: ../fish/guestfish.pod:731
16380 msgid "Start a guestfish server process using:"
16384 #: ../fish/guestfish.pod:733
16387 " eval `guestfish --listen`\n"
16392 #: ../fish/guestfish.pod:735
16393 msgid "and then send it commands by doing:"
16397 #: ../fish/guestfish.pod:737
16400 " guestfish --remote cmd [...]\n"
16405 #: ../fish/guestfish.pod:739
16406 msgid "To cause the server to exit, send it the exit command:"
16410 #: ../fish/guestfish.pod:741
16413 " guestfish --remote exit\n"
16418 #: ../fish/guestfish.pod:743
16420 "Note that the server will normally exit if there is an error in a command. "
16421 "You can change this in the usual way. See section L</EXIT ON ERROR "
16426 #: ../fish/guestfish.pod:747
16427 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16431 #: ../fish/guestfish.pod:749
16433 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16434 "is how the I<--remote> option knows where to send the commands. You can "
16435 "have several guestfish listener processes running using:"
16439 #: ../fish/guestfish.pod:753
16442 " eval `guestfish --listen`\n"
16443 " pid1=$GUESTFISH_PID\n"
16444 " eval `guestfish --listen`\n"
16445 " pid2=$GUESTFISH_PID\n"
16447 " guestfish --remote=$pid1 cmd\n"
16448 " guestfish --remote=$pid2 cmd\n"
16453 #: ../fish/guestfish.pod:761
16454 msgid "REMOTE CONTROL DETAILS"
16458 #: ../fish/guestfish.pod:763
16460 "Remote control happens over a Unix domain socket called "
16461 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
16462 "of the process, and C<$PID> is the process ID of the server."
16466 #: ../fish/guestfish.pod:767
16467 msgid "Guestfish client and server versions must match exactly."
16471 #: ../fish/guestfish.pod:769
16472 msgid "PREPARED DISK IMAGES"
16476 #: ../fish/guestfish.pod:771
16478 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
16479 "preformatted disk images that guestfish can make for you to save typing. "
16480 "This is particularly useful for testing purposes. This option is used "
16481 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
16482 "can be mixed with I<-a>)."
16486 #: ../fish/guestfish.pod:777
16488 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
16489 "the second and so on. Existing files in the current directory are "
16494 #: ../fish/guestfish.pod:781
16496 "The type briefly describes how the disk should be sized, partitioned, how "
16497 "filesystem(s) should be created, and how content should be added. "
16498 "Optionally the type can be followed by extra parameters, separated by C<:> "
16499 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
16500 "sparsely-allocated disk, containing a single partition, with the partition "
16501 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
16502 "on a 1GB disk instead."
16506 #: ../fish/guestfish.pod:789
16507 msgid "To list the available types and any extra parameters they take, run:"
16511 #: ../fish/guestfish.pod:793
16513 "Note that the prepared filesystem is not mounted. You would usually have to "
16514 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
16518 #: ../fish/guestfish.pod:797
16520 "If any I<-N> or I<--new> options are given, the guest is automatically "
16525 #: ../fish/guestfish.pod:802
16526 msgid "Create a 100MB disk with an ext4-formatted partition:"
16530 #: ../fish/guestfish.pod:804
16533 " guestfish -N fs:ext4\n"
16538 #: ../fish/guestfish.pod:806
16539 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
16543 #: ../fish/guestfish.pod:808
16546 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
16551 #: ../fish/guestfish.pod:810
16552 msgid "Create a blank 200MB disk:"
16556 #: ../fish/guestfish.pod:812
16559 " guestfish -N disk:200M\n"
16564 #: ../fish/guestfish.pod:814
16565 msgid "PROGRESS BARS"
16569 #: ../fish/guestfish.pod:816
16571 "Some (not all) long-running commands send progress notification messages as "
16572 "they are running. Guestfish turns these messages into progress bars."
16576 #: ../fish/guestfish.pod:820
16578 "When a command that supports progress bars takes longer than two seconds to "
16579 "run, and if progress bars are enabled, then you will see one appearing below "
16584 #: ../fish/guestfish.pod:824
16587 " ><fs> copy-size /large-file /another-file 2048M\n"
16588 " / 10% [#####-----------------------------------------] 00:30\n"
16593 #: ../fish/guestfish.pod:827
16595 "The spinner on the left hand side moves round once for every progress "
16596 "notification received from the backend. This is a (reasonably) golden "
16597 "assurance that the command is \"doing something\" even if the progress bar "
16598 "is not moving, because the command is able to send the progress "
16599 "notifications. When the bar reaches 100% and the command finishes, the "
16600 "spinner disappears."
16604 #: ../fish/guestfish.pod:834
16606 "Progress bars are enabled by default when guestfish is used interactively. "
16607 "You can enable them even for non-interactive modes using I<--progress-bars>, "
16608 "and you can disable them completely using I<--no-progress-bars>."
16612 #: ../fish/guestfish.pod:839
16613 msgid "GUESTFISH COMMANDS"
16617 #: ../fish/guestfish.pod:841
16619 "The commands in this section are guestfish convenience commands, in other "
16620 "words, they are not part of the L<guestfs(3)> API."
16624 #: ../fish/guestfish.pod:844
16629 #: ../fish/guestfish.pod:846
16638 #: ../fish/guestfish.pod:849
16640 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
16641 "this displays detailed help for a command."
16645 #: ../fish/guestfish.pod:852
16646 msgid "quit | exit"
16650 #: ../fish/guestfish.pod:854
16651 msgid "This exits guestfish. You can also use C<^D> key."
16655 #: ../fish/guestfish.pod:856
16656 msgid "@FISH_COMMANDS@"
16660 #: ../fish/guestfish.pod:858
16665 #: ../fish/guestfish.pod:862 ../test-tool/libguestfs-test-tool.pod:83
16670 #: ../fish/guestfish.pod:864
16672 "guestfish returns 0 if the commands completed without error, or 1 if there "
16677 #: ../fish/guestfish.pod:871
16682 #: ../fish/guestfish.pod:873
16684 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
16689 #: ../fish/guestfish.pod:876
16690 msgid "GUESTFISH_PID"
16694 #: ../fish/guestfish.pod:878
16696 "Used with the I<--remote> option to specify the remote guestfish process to "
16697 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
16701 #: ../fish/guestfish.pod:882
16706 #: ../fish/guestfish.pod:884
16708 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
16709 "not specified, the external L<hexedit(1)> program is used."
16713 #: ../fish/guestfish.pod:888
16718 #: ../fish/guestfish.pod:890
16720 "If compiled with GNU readline support, various files in the home directory "
16721 "can be used. See L</FILES>."
16725 #: ../fish/guestfish.pod:899
16727 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
16728 "effect as using the B<-v> option."
16732 #: ../fish/guestfish.pod:911
16734 "Set the path that guestfish uses to search for kernel and initrd.img. See "
16735 "the discussion of paths in L<guestfs(3)>."
16739 #: ../fish/guestfish.pod:922
16740 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
16744 #: ../fish/guestfish.pod:924
16749 #: ../fish/guestfish.pod:926
16751 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
16756 #: ../fish/guestfish.pod:941 ../test-tool/libguestfs-test-tool.pod:88
16761 #: ../fish/guestfish.pod:945
16762 msgid "$HOME/.guestfish"
16766 #: ../fish/guestfish.pod:947
16768 "If compiled with GNU readline support, then the command history is saved in "
16773 #: ../fish/guestfish.pod:950
16774 msgid "$HOME/.inputrc"
16778 #: ../fish/guestfish.pod:952
16779 msgid "/etc/inputrc"
16783 #: ../fish/guestfish.pod:954
16785 "If compiled with GNU readline support, then these files can be used to "
16786 "configure readline. For further information, please see "
16787 "L<readline(3)/INITIALIZATION FILE>."
16791 #: ../fish/guestfish.pod:958
16792 msgid "To write rules which only apply to guestfish, use:"
16796 #: ../fish/guestfish.pod:960
16806 #: ../fish/guestfish.pod:964
16808 "Variables that you can set in inputrc that change the behaviour of guestfish "
16809 "in useful ways include:"
16813 #: ../fish/guestfish.pod:969
16814 msgid "completion-ignore-case (default: on)"
16818 #: ../fish/guestfish.pod:971
16820 "By default, guestfish will ignore case when tab-completing paths on the "
16825 #: ../fish/guestfish.pod:974
16828 " set completion-ignore-case off\n"
16833 #: ../fish/guestfish.pod:976
16834 msgid "to make guestfish case sensitive."
16838 #: ../fish/guestfish.pod:980
16843 #: ../fish/guestfish.pod:982
16844 msgid "test2.img (etc)"
16848 #: ../fish/guestfish.pod:984
16850 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
16851 "will be created in the file C<test1.img> in the current directory. The "
16852 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
16853 "the same name will be overwritten."
16857 #: ../fish/guestfish.pod:993
16859 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
16860 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
16861 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
16862 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
16866 #: ../fish/guestfish.pod:1017 ../test-tool/libguestfs-test-tool.pod:124 ../fuse/guestmount.pod:198 ../inspector/virt-inspector.pl:903 ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:521 ../tools/virt-df.pl:631 ../tools/virt-ls.pl:254 ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:236 ../tools/virt-cat.pl:206 ../tools/virt-tar.pl:302 ../tools/virt-rescue.pl:275 ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:273
16868 "This program is free software; you can redistribute it and/or modify it "
16869 "under the terms of the GNU General Public License as published by the Free "
16870 "Software Foundation; either version 2 of the License, or (at your option) "
16871 "any later version."
16875 #: ../fish/guestfish.pod:1022 ../test-tool/libguestfs-test-tool.pod:129 ../fuse/guestmount.pod:203 ../inspector/virt-inspector.pl:908 ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:526 ../tools/virt-df.pl:636 ../tools/virt-ls.pl:259 ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:241 ../tools/virt-cat.pl:211 ../tools/virt-tar.pl:307 ../tools/virt-rescue.pl:280 ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:278
16877 "This program is distributed in the hope that it will be useful, but WITHOUT "
16878 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
16879 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
16884 #: ../fish/guestfish.pod:1027 ../test-tool/libguestfs-test-tool.pod:134 ../fuse/guestmount.pod:208 ../inspector/virt-inspector.pl:913 ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:531 ../tools/virt-df.pl:641 ../tools/virt-ls.pl:264 ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:246 ../tools/virt-cat.pl:216 ../tools/virt-tar.pl:312 ../tools/virt-rescue.pl:285 ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:283
16886 "You should have received a copy of the GNU General Public License along with "
16887 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
16888 "Ave, Cambridge, MA 02139, USA."
16892 #: ../fish/guestfish-actions.pod:1
16897 #: ../fish/guestfish-actions.pod:3
16900 " add-cdrom filename\n"
16905 #: ../fish/guestfish-actions.pod:15
16907 "This call checks for the existence of C<filename>. This stops you from "
16908 "specifying other types of drive which are supported by qemu such as C<nbd:> "
16909 "and C<http:> URLs. To specify those, use the general L</config> call "
16914 #: ../fish/guestfish-actions.pod:22
16916 "If you just want to add an ISO file (often you use this as an efficient way "
16917 "to transfer large files into the guest), then you should probably use "
16918 "L</add-drive-ro> instead."
16922 #: ../fish/guestfish-actions.pod:35
16927 #: ../fish/guestfish-actions.pod:37
16930 " add-drive filename\n"
16935 #: ../fish/guestfish-actions.pod:39
16937 "This function is the equivalent of calling L</add-drive-opts> with no "
16938 "optional parameters, so the disk is added writable, with the format being "
16939 "detected automatically."
16943 #: ../fish/guestfish-actions.pod:43
16945 "Automatic detection of the format opens you up to a potential security hole "
16946 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
16947 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
16948 "you should think about replacing calls to this function with calls to "
16949 "L</add-drive-opts>, and specifying the format."
16953 #: ../fish/guestfish-actions.pod:50
16954 msgid "add-drive-opts"
16958 #: ../fish/guestfish-actions.pod:52
16963 #: ../fish/guestfish-actions.pod:54
16966 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
16971 #: ../fish/guestfish-actions.pod:81
16973 "This forces the image format. If you omit this (or use L</add-drive> or "
16974 "L</add-drive-ro>) then the format is automatically detected. Possible "
16975 "formats include C<raw> and C<qcow2>."
16979 #: ../fish/guestfish-actions.pod:92
16981 "This rarely-used option lets you emulate the behaviour of the deprecated "
16982 "L</add-drive-with-if> call (q.v.)"
16986 #: ../fish/guestfish-actions.pod:97
16988 "This command has one or more optional arguments. See L</OPTIONAL "
16993 #: ../fish/guestfish-actions.pod:99
16994 msgid "add-drive-ro"
16998 #: ../fish/guestfish-actions.pod:101
17003 #: ../fish/guestfish-actions.pod:103
17006 " add-drive-ro filename\n"
17011 #: ../fish/guestfish-actions.pod:105
17013 "This function is the equivalent of calling L</add-drive-opts> with the "
17014 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
17015 "is added read-only, with the format being detected automatically."
17019 #: ../fish/guestfish-actions.pod:110
17020 msgid "add-drive-ro-with-if"
17024 #: ../fish/guestfish-actions.pod:112
17027 " add-drive-ro-with-if filename iface\n"
17032 #: ../fish/guestfish-actions.pod:114
17034 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
17035 "interface emulation to use at run time."
17039 #: ../fish/guestfish-actions.pod:124
17040 msgid "add-drive-with-if"
17044 #: ../fish/guestfish-actions.pod:126
17047 " add-drive-with-if filename iface\n"
17052 #: ../fish/guestfish-actions.pod:128
17054 "This is the same as L</add-drive> but it allows you to specify the QEMU "
17055 "interface emulation to use at run time."
17059 #: ../fish/guestfish-actions.pod:138
17064 #: ../fish/guestfish-actions.pod:140
17067 " aug-clear augpath\n"
17072 #: ../fish/guestfish-actions.pod:145
17077 #: ../fish/guestfish-actions.pod:147
17085 #: ../fish/guestfish-actions.pod:149
17087 "Close the current Augeas handle and free up any resources used by it. After "
17088 "calling this, you have to call L</aug-init> again before you can use any "
17089 "other Augeas functions."
17093 #: ../fish/guestfish-actions.pod:154
17094 msgid "aug-defnode"
17098 #: ../fish/guestfish-actions.pod:156
17101 " aug-defnode name expr val\n"
17106 #: ../fish/guestfish-actions.pod:161
17108 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
17109 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
17110 "containing that single node."
17114 #: ../fish/guestfish-actions.pod:169
17119 #: ../fish/guestfish-actions.pod:171
17122 " aug-defvar name expr\n"
17127 #: ../fish/guestfish-actions.pod:180
17132 #: ../fish/guestfish-actions.pod:182
17135 " aug-get augpath\n"
17140 #: ../fish/guestfish-actions.pod:187
17145 #: ../fish/guestfish-actions.pod:189
17148 " aug-init root flags\n"
17153 #: ../fish/guestfish-actions.pod:195
17154 msgid "You must call this before using any other L</aug-*> commands."
17158 #: ../fish/guestfish-actions.pod:230
17159 msgid "Do not load the tree in L</aug-init>."
17163 #: ../fish/guestfish-actions.pod:234
17164 msgid "To close the handle, you can call L</aug-close>."
17168 #: ../fish/guestfish-actions.pod:238
17173 #: ../fish/guestfish-actions.pod:240
17176 " aug-insert augpath label true|false\n"
17181 #: ../fish/guestfish-actions.pod:250
17186 #: ../fish/guestfish-actions.pod:252
17194 #: ../fish/guestfish-actions.pod:259
17199 #: ../fish/guestfish-actions.pod:261
17202 " aug-ls augpath\n"
17207 #: ../fish/guestfish-actions.pod:263
17209 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
17210 "resulting nodes into alphabetical order."
17214 #: ../fish/guestfish-actions.pod:266
17219 #: ../fish/guestfish-actions.pod:268
17222 " aug-match augpath\n"
17227 #: ../fish/guestfish-actions.pod:274
17232 #: ../fish/guestfish-actions.pod:276
17235 " aug-mv src dest\n"
17240 #: ../fish/guestfish-actions.pod:281
17245 #: ../fish/guestfish-actions.pod:283
17248 " aug-rm augpath\n"
17253 #: ../fish/guestfish-actions.pod:289
17258 #: ../fish/guestfish-actions.pod:291
17266 #: ../fish/guestfish-actions.pod:295
17268 "The flags which were passed to L</aug-init> affect exactly how files are "
17273 #: ../fish/guestfish-actions.pod:298
17278 #: ../fish/guestfish-actions.pod:300
17281 " aug-set augpath val\n"
17286 #: ../fish/guestfish-actions.pod:304
17288 "In the Augeas API, it is possible to clear a node by setting the value to "
17289 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
17290 "this call. Instead you must use the L</aug-clear> call."
17294 #: ../fish/guestfish-actions.pod:309
17299 #: ../fish/guestfish-actions.pod:311
17302 " available 'groups ...'\n"
17307 #: ../fish/guestfish-actions.pod:317
17309 "The libguestfs groups, and the functions that those groups correspond to, "
17310 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
17311 "runtime by calling L</available-all-groups>."
17315 #: ../fish/guestfish-actions.pod:341
17316 msgid "You must call L</launch> before calling this function."
17320 #: ../fish/guestfish-actions.pod:363
17322 "This call was added in version C<1.0.80>. In previous versions of "
17323 "libguestfs all you could do would be to speculatively execute a command to "
17324 "find out if the daemon implemented it. See also L</version>."
17328 #: ../fish/guestfish-actions.pod:370
17329 msgid "available-all-groups"
17333 #: ../fish/guestfish-actions.pod:372
17336 " available-all-groups\n"
17341 #: ../fish/guestfish-actions.pod:374
17343 "This command returns a list of all optional groups that this daemon knows "
17344 "about. Note this returns both supported and unsupported groups. To find "
17345 "out which ones the daemon can actually support you have to call "
17346 "L</available> on each member of the returned list."
17350 #: ../fish/guestfish-actions.pod:380
17351 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
17355 #: ../fish/guestfish-actions.pod:382
17360 #: ../fish/guestfish-actions.pod:384
17363 " base64-in (base64file|-) filename\n"
17368 #: ../fish/guestfish-actions.pod:389 ../fish/guestfish-actions.pod:398 ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:816 ../fish/guestfish-actions.pod:835 ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:3868 ../fish/guestfish-actions.pod:3880 ../fish/guestfish-actions.pod:3891 ../fish/guestfish-actions.pod:3902 ../fish/guestfish-actions.pod:3954 ../fish/guestfish-actions.pod:3963 ../fish/guestfish-actions.pod:4017 ../fish/guestfish-actions.pod:4040
17369 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17373 #: ../fish/guestfish-actions.pod:391
17378 #: ../fish/guestfish-actions.pod:393
17381 " base64-out filename (base64file|-)\n"
17386 #: ../fish/guestfish-actions.pod:400
17387 msgid "blockdev-flushbufs"
17391 #: ../fish/guestfish-actions.pod:402
17394 " blockdev-flushbufs device\n"
17399 #: ../fish/guestfish-actions.pod:409
17400 msgid "blockdev-getbsz"
17404 #: ../fish/guestfish-actions.pod:411
17407 " blockdev-getbsz device\n"
17412 #: ../fish/guestfish-actions.pod:420
17413 msgid "blockdev-getro"
17417 #: ../fish/guestfish-actions.pod:422
17420 " blockdev-getro device\n"
17425 #: ../fish/guestfish-actions.pod:429
17426 msgid "blockdev-getsize64"
17430 #: ../fish/guestfish-actions.pod:431
17433 " blockdev-getsize64 device\n"
17438 #: ../fish/guestfish-actions.pod:435
17439 msgid "See also L</blockdev-getsz>."
17443 #: ../fish/guestfish-actions.pod:439
17444 msgid "blockdev-getss"
17448 #: ../fish/guestfish-actions.pod:441
17451 " blockdev-getss device\n"
17456 #: ../fish/guestfish-actions.pod:446
17457 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
17461 #: ../fish/guestfish-actions.pod:451
17462 msgid "blockdev-getsz"
17466 #: ../fish/guestfish-actions.pod:453
17469 " blockdev-getsz device\n"
17474 #: ../fish/guestfish-actions.pod:458
17476 "See also L</blockdev-getss> for the real sector size of the device, and "
17477 "L</blockdev-getsize64> for the more useful I<size in bytes>."
17481 #: ../fish/guestfish-actions.pod:464
17482 msgid "blockdev-rereadpt"
17486 #: ../fish/guestfish-actions.pod:466
17489 " blockdev-rereadpt device\n"
17494 #: ../fish/guestfish-actions.pod:472
17495 msgid "blockdev-setbsz"
17499 #: ../fish/guestfish-actions.pod:474
17502 " blockdev-setbsz device blocksize\n"
17507 #: ../fish/guestfish-actions.pod:483
17508 msgid "blockdev-setro"
17512 #: ../fish/guestfish-actions.pod:485
17515 " blockdev-setro device\n"
17520 #: ../fish/guestfish-actions.pod:491
17521 msgid "blockdev-setrw"
17525 #: ../fish/guestfish-actions.pod:493
17528 " blockdev-setrw device\n"
17533 #: ../fish/guestfish-actions.pod:499
17534 msgid "case-sensitive-path"
17538 #: ../fish/guestfish-actions.pod:501
17541 " case-sensitive-path path\n"
17546 #: ../fish/guestfish-actions.pod:525
17548 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
17549 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
17550 "how the directories were originally created under Windows)."
17554 #: ../fish/guestfish-actions.pod:533
17555 msgid "See also L</realpath>."
17559 #: ../fish/guestfish-actions.pod:535
17564 #: ../fish/guestfish-actions.pod:537
17572 #: ../fish/guestfish-actions.pod:541
17574 "Note that this function cannot correctly handle binary files (specifically, "
17575 "files containing C<\\0> character which is treated as end of string). For "
17576 "those you need to use the L</read-file> or L</download> functions which have "
17577 "a more complex interface."
17581 #: ../fish/guestfish-actions.pod:549
17586 #: ../fish/guestfish-actions.pod:551
17589 " checksum csumtype path\n"
17594 #: ../fish/guestfish-actions.pod:594
17595 msgid "To get the checksum for a device, use L</checksum-device>."
17599 #: ../fish/guestfish-actions.pod:596
17600 msgid "To get the checksums for many files, use L</checksums-out>."
17604 #: ../fish/guestfish-actions.pod:598
17605 msgid "checksum-device"
17609 #: ../fish/guestfish-actions.pod:600
17612 " checksum-device csumtype device\n"
17617 #: ../fish/guestfish-actions.pod:602
17619 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
17620 "device named C<device>. For the types of checksums supported see the "
17621 "L</checksum> command."
17625 #: ../fish/guestfish-actions.pod:606
17626 msgid "checksums-out"
17630 #: ../fish/guestfish-actions.pod:608
17633 " checksums-out csumtype directory (sumsfile|-)\n"
17638 #: ../fish/guestfish-actions.pod:624
17643 #: ../fish/guestfish-actions.pod:626
17646 " chmod mode path\n"
17651 #: ../fish/guestfish-actions.pod:637
17656 #: ../fish/guestfish-actions.pod:639
17659 " chown owner group path\n"
17664 #: ../fish/guestfish-actions.pod:647
17669 #: ../fish/guestfish-actions.pod:649
17672 " command 'arguments ...'\n"
17677 #: ../fish/guestfish-actions.pod:656
17679 "The single parameter is an argv-style list of arguments. The first element "
17680 "is the name of the program to run. Subsequent elements are parameters. The "
17681 "list must be non-empty (ie. must contain a program name). Note that the "
17682 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
17686 #: ../fish/guestfish-actions.pod:684
17687 msgid "command-lines"
17691 #: ../fish/guestfish-actions.pod:686
17694 " command-lines 'arguments ...'\n"
17699 #: ../fish/guestfish-actions.pod:688
17700 msgid "This is the same as L</command>, but splits the result into a list of lines."
17704 #: ../fish/guestfish-actions.pod:691
17705 msgid "See also: L</sh-lines>"
17709 #: ../fish/guestfish-actions.pod:696
17714 #: ../fish/guestfish-actions.pod:698
17717 " config qemuparam qemuvalue\n"
17722 #: ../fish/guestfish-actions.pod:709
17727 #: ../fish/guestfish-actions.pod:711
17730 " copy-size src dest size\n"
17735 #: ../fish/guestfish-actions.pod:719
17740 #: ../fish/guestfish-actions.pod:721
17748 #: ../fish/guestfish-actions.pod:726
17753 #: ../fish/guestfish-actions.pod:728
17761 #: ../fish/guestfish-actions.pod:733
17766 #: ../fish/guestfish-actions.pod:735
17774 #: ../fish/guestfish-actions.pod:742
17776 "If the destination is a device, it must be as large or larger than the "
17777 "source file or device, otherwise the copy will fail. This command cannot do "
17778 "partial copies (see L</copy-size>)."
17782 #: ../fish/guestfish-actions.pod:746
17787 #: ../fish/guestfish-actions.pod:748
17790 " debug subcmd 'extraargs ...'\n"
17795 #: ../fish/guestfish-actions.pod:750
17797 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
17798 "daemon) that runs inside the qemu subprocess."
17802 #: ../fish/guestfish-actions.pod:758
17803 msgid "debug-upload"
17807 #: ../fish/guestfish-actions.pod:760
17810 " debug-upload (filename|-) tmpname mode\n"
17815 #: ../fish/guestfish-actions.pod:762
17816 msgid "The L</debug-upload> command uploads a file to the libguestfs appliance."
17820 #: ../fish/guestfish-actions.pod:771
17825 #: ../fish/guestfish-actions.pod:773
17833 #: ../fish/guestfish-actions.pod:781
17838 #: ../fish/guestfish-actions.pod:783
17846 #: ../fish/guestfish-actions.pod:792
17851 #: ../fish/guestfish-actions.pod:794
17859 #: ../fish/guestfish-actions.pod:800
17861 "Another way to get the same information is to enable verbose messages with "
17862 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
17863 "before running the program."
17867 #: ../fish/guestfish-actions.pod:805
17872 #: ../fish/guestfish-actions.pod:807
17875 " download remotefilename (filename|-)\n"
17880 #: ../fish/guestfish-actions.pod:814
17881 msgid "See also L</upload>, L</cat>."
17885 #: ../fish/guestfish-actions.pod:818
17886 msgid "download-offset"
17890 #: ../fish/guestfish-actions.pod:820
17893 " download-offset remotefilename (filename|-) offset size\n"
17898 #: ../fish/guestfish-actions.pod:828
17900 "Note that there is no limit on the amount of data that can be downloaded "
17901 "with this call, unlike with L</pread>, and this call always reads the full "
17902 "amount unless an error occurs."
17906 #: ../fish/guestfish-actions.pod:833
17907 msgid "See also L</download>, L</pread>."
17911 #: ../fish/guestfish-actions.pod:837
17912 msgid "drop-caches"
17916 #: ../fish/guestfish-actions.pod:839
17919 " drop-caches whattodrop\n"
17924 #: ../fish/guestfish-actions.pod:851
17929 #: ../fish/guestfish-actions.pod:853
17937 #: ../fish/guestfish-actions.pod:865
17942 #: ../fish/guestfish-actions.pod:867
17945 " e2fsck-f device\n"
17950 #: ../fish/guestfish-actions.pod:873
17952 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
17953 "should use L</fsck>."
17957 #: ../fish/guestfish-actions.pod:876
17958 msgid "echo-daemon"
17962 #: ../fish/guestfish-actions.pod:878
17965 " echo-daemon 'words ...'\n"
17970 #: ../fish/guestfish-actions.pod:885
17971 msgid "See also L</ping-daemon>."
17975 #: ../fish/guestfish-actions.pod:887
17980 #: ../fish/guestfish-actions.pod:889
17983 " egrep regex path\n"
17988 #: ../fish/guestfish-actions.pod:897
17993 #: ../fish/guestfish-actions.pod:899
17996 " egrepi regex path\n"
18001 #: ../fish/guestfish-actions.pod:907
18006 #: ../fish/guestfish-actions.pod:909
18009 " equal file1 file2\n"
18014 #: ../fish/guestfish-actions.pod:916
18019 #: ../fish/guestfish-actions.pod:918
18027 #: ../fish/guestfish-actions.pod:923
18028 msgid "See also L</is-file>, L</is-dir>, L</stat>."
18032 #: ../fish/guestfish-actions.pod:925
18037 #: ../fish/guestfish-actions.pod:927
18040 " fallocate path len\n"
18045 #: ../fish/guestfish-actions.pod:944
18046 msgid "fallocate64"
18050 #: ../fish/guestfish-actions.pod:946
18053 " fallocate64 path len\n"
18058 #: ../fish/guestfish-actions.pod:952
18060 "Note that this call allocates disk blocks for the file. To create a sparse "
18061 "file use L</truncate-size> instead."
18065 #: ../fish/guestfish-actions.pod:955
18067 "The deprecated call L</fallocate> does the same, but owing to an oversight "
18068 "it only allowed 30 bit lengths to be specified, effectively limiting the "
18069 "maximum size of files created through that call to 1GB."
18073 #: ../fish/guestfish-actions.pod:964
18078 #: ../fish/guestfish-actions.pod:966
18081 " fgrep pattern path\n"
18086 #: ../fish/guestfish-actions.pod:974
18091 #: ../fish/guestfish-actions.pod:976
18094 " fgrepi pattern path\n"
18099 #: ../fish/guestfish-actions.pod:984
18104 #: ../fish/guestfish-actions.pod:986
18112 #: ../fish/guestfish-actions.pod:998
18114 "This command can also be used on C</dev/> devices (and partitions, LV "
18115 "names). You can for example use this to determine if a device contains a "
18116 "filesystem, although it's usually better to use L</vfs-type>."
18120 #: ../fish/guestfish-actions.pod:1008
18121 msgid "file-architecture"
18125 #: ../fish/guestfish-actions.pod:1010
18128 " file-architecture filename\n"
18133 #: ../fish/guestfish-actions.pod:1113
18138 #: ../fish/guestfish-actions.pod:1115
18146 #: ../fish/guestfish-actions.pod:1119
18148 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
18149 "L</is-file> etc. To get the size of block devices, use "
18150 "L</blockdev-getsize64>."
18154 #: ../fish/guestfish-actions.pod:1123
18159 #: ../fish/guestfish-actions.pod:1125
18162 " fill c len path\n"
18167 #: ../fish/guestfish-actions.pod:1131
18169 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
18170 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
18171 "L</fill-pattern>."
18175 #: ../fish/guestfish-actions.pod:1136
18176 msgid "fill-pattern"
18180 #: ../fish/guestfish-actions.pod:1138
18183 " fill-pattern pattern len path\n"
18188 #: ../fish/guestfish-actions.pod:1140
18190 "This function is like L</fill> except that it creates a new file of length "
18191 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
18192 "is truncated if necessary to ensure the length of the file is exactly C<len> "
18197 #: ../fish/guestfish-actions.pod:1145
18202 #: ../fish/guestfish-actions.pod:1147
18205 " find directory\n"
18210 #: ../fish/guestfish-actions.pod:1161
18211 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
18215 #: ../fish/guestfish-actions.pod:1174
18216 msgid "See also L</find0>."
18220 #: ../fish/guestfish-actions.pod:1179
18225 #: ../fish/guestfish-actions.pod:1181
18228 " find0 directory (files|-)\n"
18233 #: ../fish/guestfish-actions.pod:1187
18234 msgid "This command works the same way as L</find> with the following exceptions:"
18238 #: ../fish/guestfish-actions.pod:1214
18239 msgid "findfs-label"
18243 #: ../fish/guestfish-actions.pod:1216
18246 " findfs-label label\n"
18251 #: ../fish/guestfish-actions.pod:1222
18252 msgid "To find the label of a filesystem, use L</vfs-label>."
18256 #: ../fish/guestfish-actions.pod:1224
18257 msgid "findfs-uuid"
18261 #: ../fish/guestfish-actions.pod:1226
18264 " findfs-uuid uuid\n"
18269 #: ../fish/guestfish-actions.pod:1232
18270 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
18274 #: ../fish/guestfish-actions.pod:1234
18279 #: ../fish/guestfish-actions.pod:1236
18282 " fsck fstype device\n"
18287 #: ../fish/guestfish-actions.pod:1266
18292 #: ../fish/guestfish-actions.pod:1268
18300 #: ../fish/guestfish-actions.pod:1275
18301 msgid "get-autosync"
18305 #: ../fish/guestfish-actions.pod:1277
18313 #: ../fish/guestfish-actions.pod:1281
18318 #: ../fish/guestfish-actions.pod:1283
18326 #: ../fish/guestfish-actions.pod:1287
18327 msgid "get-e2label"
18331 #: ../fish/guestfish-actions.pod:1289
18334 " get-e2label device\n"
18339 #: ../fish/guestfish-actions.pod:1301
18344 #: ../fish/guestfish-actions.pod:1303
18347 " get-e2uuid device\n"
18352 #: ../fish/guestfish-actions.pod:1315
18353 msgid "get-memsize"
18357 #: ../fish/guestfish-actions.pod:1317
18365 #: ../fish/guestfish-actions.pod:1322
18367 "If L</set-memsize> was not called on this handle, and if "
18368 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
18369 "value for memsize."
18373 #: ../fish/guestfish-actions.pod:1329
18374 msgid "get-network"
18378 #: ../fish/guestfish-actions.pod:1331
18386 #: ../fish/guestfish-actions.pod:1335
18391 #: ../fish/guestfish-actions.pod:1337
18399 #: ../fish/guestfish-actions.pod:1344
18404 #: ../fish/guestfish-actions.pod:1346
18409 #: ../fish/guestfish-actions.pod:1348
18417 #: ../fish/guestfish-actions.pod:1355
18422 #: ../fish/guestfish-actions.pod:1357
18430 #: ../fish/guestfish-actions.pod:1364
18431 msgid "get-recovery-proc"
18435 #: ../fish/guestfish-actions.pod:1366
18438 " get-recovery-proc\n"
18443 #: ../fish/guestfish-actions.pod:1370
18444 msgid "get-selinux"
18448 #: ../fish/guestfish-actions.pod:1372
18456 #: ../fish/guestfish-actions.pod:1374
18458 "This returns the current setting of the selinux flag which is passed to the "
18459 "appliance at boot time. See L</set-selinux>."
18463 #: ../fish/guestfish-actions.pod:1380
18468 #: ../fish/guestfish-actions.pod:1382
18476 #: ../fish/guestfish-actions.pod:1389
18481 #: ../fish/guestfish-actions.pod:1391
18489 #: ../fish/guestfish-actions.pod:1395
18494 #: ../fish/guestfish-actions.pod:1397
18502 #: ../fish/guestfish-actions.pod:1399
18504 "Return the current umask. By default the umask is C<022> unless it has been "
18505 "set by calling L</umask>."
18509 #: ../fish/guestfish-actions.pod:1402
18510 msgid "get-verbose"
18514 #: ../fish/guestfish-actions.pod:1404
18522 #: ../fish/guestfish-actions.pod:1408
18527 #: ../fish/guestfish-actions.pod:1410
18535 #: ../fish/guestfish-actions.pod:1414
18536 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
18540 #: ../fish/guestfish-actions.pod:1417
18545 #: ../fish/guestfish-actions.pod:1419
18548 " getxattrs path\n"
18553 #: ../fish/guestfish-actions.pod:1427
18554 msgid "See also: L</lgetxattrs>, L<attr(5)>."
18558 #: ../fish/guestfish-actions.pod:1429
18559 msgid "glob-expand"
18563 #: ../fish/guestfish-actions.pod:1431
18566 " glob-expand pattern\n"
18571 #: ../fish/guestfish-actions.pod:1444
18576 #: ../fish/guestfish-actions.pod:1446
18579 " grep regex path\n"
18584 #: ../fish/guestfish-actions.pod:1454
18589 #: ../fish/guestfish-actions.pod:1456
18592 " grepi regex path\n"
18597 #: ../fish/guestfish-actions.pod:1464
18598 msgid "grub-install"
18602 #: ../fish/guestfish-actions.pod:1466
18605 " grub-install root device\n"
18610 #: ../fish/guestfish-actions.pod:1482
18615 #: ../fish/guestfish-actions.pod:1484
18623 #: ../fish/guestfish-actions.pod:1492
18628 #: ../fish/guestfish-actions.pod:1494
18631 " head-n nrlines path\n"
18636 #: ../fish/guestfish-actions.pod:1507
18641 #: ../fish/guestfish-actions.pod:1509
18649 #: ../fish/guestfish-actions.pod:1517
18654 #: ../fish/guestfish-actions.pod:1519
18657 " initrd-cat initrdpath filename\n"
18662 #: ../fish/guestfish-actions.pod:1531
18663 msgid "See also L</initrd-list>."
18667 #: ../fish/guestfish-actions.pod:1536
18668 msgid "initrd-list"
18672 #: ../fish/guestfish-actions.pod:1538
18675 " initrd-list path\n"
18680 #: ../fish/guestfish-actions.pod:1550
18681 msgid "inotify-add-watch"
18685 #: ../fish/guestfish-actions.pod:1552
18688 " inotify-add-watch path mask\n"
18693 #: ../fish/guestfish-actions.pod:1564
18694 msgid "inotify-close"
18698 #: ../fish/guestfish-actions.pod:1566
18706 #: ../fish/guestfish-actions.pod:1572
18707 msgid "inotify-files"
18711 #: ../fish/guestfish-actions.pod:1574
18719 #: ../fish/guestfish-actions.pod:1576
18721 "This function is a helpful wrapper around L</inotify-read> which just "
18722 "returns a list of pathnames of objects that were touched. The returned "
18723 "pathnames are sorted and deduplicated."
18727 #: ../fish/guestfish-actions.pod:1580
18728 msgid "inotify-init"
18732 #: ../fish/guestfish-actions.pod:1582
18735 " inotify-init maxevents\n"
18740 #: ../fish/guestfish-actions.pod:1588
18742 "C<maxevents> is the maximum number of events which will be queued up between "
18743 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
18744 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
18745 "default was 16384 events. Beyond this limit, the kernel throws away events, "
18746 "but records the fact that it threw them away by setting a flag "
18747 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
18751 #: ../fish/guestfish-actions.pod:1598
18753 "Before any events are generated, you have to add some watches to the "
18754 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
18755 "L</inotify-watch-all>."
18759 #: ../fish/guestfish-actions.pod:1604
18761 "Queued up events should be read periodically by calling L</inotify-read> (or "
18762 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
18763 "If you don't read the events out often enough then you risk the internal "
18764 "queue overflowing."
18768 #: ../fish/guestfish-actions.pod:1611
18770 "The handle should be closed after use by calling L</inotify-close>. This "
18771 "also removes any watches automatically."
18775 #: ../fish/guestfish-actions.pod:1620
18776 msgid "inotify-read"
18780 #: ../fish/guestfish-actions.pod:1622
18788 #: ../fish/guestfish-actions.pod:1635
18789 msgid "inotify-rm-watch"
18793 #: ../fish/guestfish-actions.pod:1637
18796 " inotify-rm-watch wd\n"
18801 #: ../fish/guestfish-actions.pod:1639
18802 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
18806 #: ../fish/guestfish-actions.pod:1642
18807 msgid "inspect-get-arch"
18811 #: ../fish/guestfish-actions.pod:1644
18814 " inspect-get-arch root\n"
18819 #: ../fish/guestfish-actions.pod:1646 ../fish/guestfish-actions.pod:1662 ../fish/guestfish-actions.pod:1708 ../fish/guestfish-actions.pod:1726 ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1762 ../fish/guestfish-actions.pod:1785 ../fish/guestfish-actions.pod:1802
18821 "This function should only be called with a root device string as returned by "
18826 #: ../fish/guestfish-actions.pod:1649
18828 "This returns the architecture of the inspected operating system. The "
18829 "possible return values are listed under L</file-architecture>."
18833 #: ../fish/guestfish-actions.pod:1658
18834 msgid "inspect-get-distro"
18838 #: ../fish/guestfish-actions.pod:1660
18841 " inspect-get-distro root\n"
18846 #: ../fish/guestfish-actions.pod:1704
18847 msgid "inspect-get-filesystems"
18851 #: ../fish/guestfish-actions.pod:1706
18854 " inspect-get-filesystems root\n"
18859 #: ../fish/guestfish-actions.pod:1719
18861 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18862 "L</inspect-get-mountpoints>."
18866 #: ../fish/guestfish-actions.pod:1722
18867 msgid "inspect-get-major-version"
18871 #: ../fish/guestfish-actions.pod:1724
18874 " inspect-get-major-version root\n"
18879 #: ../fish/guestfish-actions.pod:1743
18880 msgid "inspect-get-minor-version"
18884 #: ../fish/guestfish-actions.pod:1745
18887 " inspect-get-minor-version root\n"
18892 #: ../fish/guestfish-actions.pod:1755
18894 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18895 "L</inspect-get-major-version>."
18899 #: ../fish/guestfish-actions.pod:1758
18900 msgid "inspect-get-mountpoints"
18904 #: ../fish/guestfish-actions.pod:1760
18907 " inspect-get-mountpoints root\n"
18912 #: ../fish/guestfish-actions.pod:1778
18914 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18915 "L</inspect-get-filesystems>."
18919 #: ../fish/guestfish-actions.pod:1781
18920 msgid "inspect-get-product-name"
18924 #: ../fish/guestfish-actions.pod:1783
18927 " inspect-get-product-name root\n"
18932 #: ../fish/guestfish-actions.pod:1798
18933 msgid "inspect-get-type"
18937 #: ../fish/guestfish-actions.pod:1800
18940 " inspect-get-type root\n"
18945 #: ../fish/guestfish-actions.pod:1829
18950 #: ../fish/guestfish-actions.pod:1831
18958 #: ../fish/guestfish-actions.pod:1846
18960 "You can pass the root string(s) returned to other L</inspect-get-*> "
18961 "functions in order to query further information about each operating system, "
18962 "such as the name and version."
18966 #: ../fish/guestfish-actions.pod:1851
18968 "This function uses other libguestfs features such as L</mount-ro> and "
18969 "L</umount-all> in order to mount and unmount filesystems and look at the "
18970 "contents. This should be called with no disks currently mounted. The "
18971 "function may also use Augeas, so any existing Augeas handle will be closed."
18975 #: ../fish/guestfish-actions.pod:1863 ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2065
18976 msgid "See also L</list-filesystems>."
18980 #: ../fish/guestfish-actions.pod:1865
18981 msgid "is-blockdev"
18985 #: ../fish/guestfish-actions.pod:1867
18988 " is-blockdev path\n"
18993 #: ../fish/guestfish-actions.pod:1872 ../fish/guestfish-actions.pod:1890 ../fish/guestfish-actions.pod:1909 ../fish/guestfish-actions.pod:1918 ../fish/guestfish-actions.pod:1928 ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1971
18994 msgid "See also L</stat>."
18998 #: ../fish/guestfish-actions.pod:1874
19003 #: ../fish/guestfish-actions.pod:1876
19011 #: ../fish/guestfish-actions.pod:1883
19016 #: ../fish/guestfish-actions.pod:1885
19019 " is-chardev path\n"
19024 #: ../fish/guestfish-actions.pod:1892
19029 #: ../fish/guestfish-actions.pod:1894
19037 #: ../fish/guestfish-actions.pod:1901
19042 #: ../fish/guestfish-actions.pod:1903
19050 #: ../fish/guestfish-actions.pod:1911
19055 #: ../fish/guestfish-actions.pod:1913
19063 #: ../fish/guestfish-actions.pod:1920
19068 #: ../fish/guestfish-actions.pod:1922
19076 #: ../fish/guestfish-actions.pod:1930
19077 msgid "is-launching"
19081 #: ../fish/guestfish-actions.pod:1932
19089 #: ../fish/guestfish-actions.pod:1939
19094 #: ../fish/guestfish-actions.pod:1941
19102 #: ../fish/guestfish-actions.pod:1946
19107 #: ../fish/guestfish-actions.pod:1948
19115 #: ../fish/guestfish-actions.pod:1955
19120 #: ../fish/guestfish-actions.pod:1957
19123 " is-socket path\n"
19128 #: ../fish/guestfish-actions.pod:1964
19133 #: ../fish/guestfish-actions.pod:1966
19136 " is-symlink path\n"
19141 #: ../fish/guestfish-actions.pod:1973
19142 msgid "kill-subprocess"
19146 #: ../fish/guestfish-actions.pod:1975
19149 " kill-subprocess\n"
19154 #: ../fish/guestfish-actions.pod:1979
19159 #: ../fish/guestfish-actions.pod:1981
19164 #: ../fish/guestfish-actions.pod:1983
19172 #: ../fish/guestfish-actions.pod:1991
19177 #: ../fish/guestfish-actions.pod:1993
19180 " lchown owner group path\n"
19185 #: ../fish/guestfish-actions.pod:1995
19187 "Change the file owner to C<owner> and group to C<group>. This is like "
19188 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
19193 #: ../fish/guestfish-actions.pod:2003
19198 #: ../fish/guestfish-actions.pod:2005
19201 " lgetxattrs path\n"
19206 #: ../fish/guestfish-actions.pod:2007
19208 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
19209 "it returns the extended attributes of the link itself."
19213 #: ../fish/guestfish-actions.pod:2011
19214 msgid "list-devices"
19218 #: ../fish/guestfish-actions.pod:2013
19226 #: ../fish/guestfish-actions.pod:2021
19227 msgid "list-filesystems"
19231 #: ../fish/guestfish-actions.pod:2023
19234 " list-filesystems\n"
19239 #: ../fish/guestfish-actions.pod:2042
19241 "This command runs other libguestfs commands, which might include L</mount> "
19242 "and L</umount>, and therefore you should use this soon after launch and only "
19243 "when nothing is mounted."
19247 #: ../fish/guestfish-actions.pod:2046
19249 "Not all of the filesystems returned will be mountable. In particular, swap "
19250 "partitions are returned in the list. Also this command does not check that "
19251 "each filesystem found is valid and mountable, and some filesystems might be "
19252 "mountable but require special options. Filesystems may not all belong to a "
19253 "single logical operating system (use L</inspect-os> to look for OSes)."
19257 #: ../fish/guestfish-actions.pod:2054
19258 msgid "list-partitions"
19262 #: ../fish/guestfish-actions.pod:2056
19265 " list-partitions\n"
19270 #: ../fish/guestfish-actions.pod:2062
19272 "This does not return logical volumes. For that you will need to call "
19277 #: ../fish/guestfish-actions.pod:2067
19282 #: ../fish/guestfish-actions.pod:2069
19290 #: ../fish/guestfish-actions.pod:2077
19295 #: ../fish/guestfish-actions.pod:2079
19298 " ln target linkname\n"
19303 #: ../fish/guestfish-actions.pod:2083
19308 #: ../fish/guestfish-actions.pod:2085
19311 " ln-f target linkname\n"
19316 #: ../fish/guestfish-actions.pod:2090
19321 #: ../fish/guestfish-actions.pod:2092
19324 " ln-s target linkname\n"
19329 #: ../fish/guestfish-actions.pod:2096
19334 #: ../fish/guestfish-actions.pod:2098
19337 " ln-sf target linkname\n"
19342 #: ../fish/guestfish-actions.pod:2103
19343 msgid "lremovexattr"
19347 #: ../fish/guestfish-actions.pod:2105
19350 " lremovexattr xattr path\n"
19355 #: ../fish/guestfish-actions.pod:2107
19357 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
19358 "it removes an extended attribute of the link itself."
19362 #: ../fish/guestfish-actions.pod:2111
19367 #: ../fish/guestfish-actions.pod:2113
19375 #: ../fish/guestfish-actions.pod:2119
19377 "This command is mostly useful for interactive sessions. Programs should "
19378 "probably use L</readdir> instead."
19382 #: ../fish/guestfish-actions.pod:2122
19387 #: ../fish/guestfish-actions.pod:2124
19390 " lsetxattr xattr val vallen path\n"
19395 #: ../fish/guestfish-actions.pod:2126
19397 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
19398 "sets an extended attribute of the link itself."
19402 #: ../fish/guestfish-actions.pod:2130
19407 #: ../fish/guestfish-actions.pod:2132
19415 #: ../fish/guestfish-actions.pod:2136
19417 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
19418 "the link is stat-ed, not the file it refers to."
19422 #: ../fish/guestfish-actions.pod:2142
19427 #: ../fish/guestfish-actions.pod:2144
19430 " lstatlist path 'names ...'\n"
19435 #: ../fish/guestfish-actions.pod:2146
19437 "This call allows you to perform the L</lstat> operation on multiple files, "
19438 "where all files are in the directory C<path>. C<names> is the list of files "
19439 "from this directory."
19443 #: ../fish/guestfish-actions.pod:2155
19445 "This call is intended for programs that want to efficiently list a directory "
19446 "contents without making many round-trips. See also L</lxattrlist> for a "
19447 "similarly efficient call for getting extended attributes. Very long "
19448 "directory listings might cause the protocol message size to be exceeded, "
19449 "causing this call to fail. The caller must split up such requests into "
19450 "smaller groups of names."
19454 #: ../fish/guestfish-actions.pod:2163
19455 msgid "luks-add-key"
19459 #: ../fish/guestfish-actions.pod:2165
19462 " luks-add-key device keyslot\n"
19467 #: ../fish/guestfish-actions.pod:2172
19469 "Note that if C<keyslot> already contains a key, then this command will "
19470 "fail. You have to use L</luks-kill-slot> first to remove that key."
19474 #: ../fish/guestfish-actions.pod:2176 ../fish/guestfish-actions.pod:2198 ../fish/guestfish-actions.pod:2211 ../fish/guestfish-actions.pod:2225 ../fish/guestfish-actions.pod:2248 ../fish/guestfish-actions.pod:2258
19476 "This command has one or more key or passphrase parameters. Guestfish will "
19477 "prompt for these separately."
19481 #: ../fish/guestfish-actions.pod:2179
19486 #: ../fish/guestfish-actions.pod:2181
19489 " luks-close device\n"
19494 #: ../fish/guestfish-actions.pod:2183
19496 "This closes a LUKS device that was created earlier by L</luks-open> or "
19497 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
19498 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
19499 "underlying block device."
19503 #: ../fish/guestfish-actions.pod:2189
19504 msgid "luks-format"
19508 #: ../fish/guestfish-actions.pod:2191
19511 " luks-format device keyslot\n"
19516 #: ../fish/guestfish-actions.pod:2204
19517 msgid "luks-format-cipher"
19521 #: ../fish/guestfish-actions.pod:2206
19524 " luks-format-cipher device keyslot cipher\n"
19529 #: ../fish/guestfish-actions.pod:2208
19531 "This command is the same as L</luks-format> but it also allows you to set "
19532 "the C<cipher> used."
19536 #: ../fish/guestfish-actions.pod:2217
19537 msgid "luks-kill-slot"
19541 #: ../fish/guestfish-actions.pod:2219
19544 " luks-kill-slot device keyslot\n"
19549 #: ../fish/guestfish-actions.pod:2228
19554 #: ../fish/guestfish-actions.pod:2230
19557 " luks-open device mapname\n"
19562 #: ../fish/guestfish-actions.pod:2244
19564 "If this block device contains LVM volume groups, then calling L</vgscan> "
19565 "followed by L</vg-activate-all> will make them visible."
19569 #: ../fish/guestfish-actions.pod:2251
19570 msgid "luks-open-ro"
19574 #: ../fish/guestfish-actions.pod:2253
19577 " luks-open-ro device mapname\n"
19582 #: ../fish/guestfish-actions.pod:2255
19584 "This is the same as L</luks-open> except that a read-only mapping is "
19589 #: ../fish/guestfish-actions.pod:2261
19594 #: ../fish/guestfish-actions.pod:2263
19597 " lvcreate logvol volgroup mbytes\n"
19602 #: ../fish/guestfish-actions.pod:2268
19603 msgid "lvm-clear-filter"
19607 #: ../fish/guestfish-actions.pod:2270
19610 " lvm-clear-filter\n"
19615 #: ../fish/guestfish-actions.pod:2272
19617 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
19622 #: ../fish/guestfish-actions.pod:2278
19623 msgid "lvm-remove-all"
19627 #: ../fish/guestfish-actions.pod:2280
19630 " lvm-remove-all\n"
19635 #: ../fish/guestfish-actions.pod:2288
19636 msgid "lvm-set-filter"
19640 #: ../fish/guestfish-actions.pod:2290
19643 " lvm-set-filter 'devices ...'\n"
19648 #: ../fish/guestfish-actions.pod:2315
19653 #: ../fish/guestfish-actions.pod:2317
19656 " lvremove device\n"
19661 #: ../fish/guestfish-actions.pod:2325
19666 #: ../fish/guestfish-actions.pod:2327
19669 " lvrename logvol newlogvol\n"
19674 #: ../fish/guestfish-actions.pod:2331
19679 #: ../fish/guestfish-actions.pod:2333
19682 " lvresize device mbytes\n"
19687 #: ../fish/guestfish-actions.pod:2339
19688 msgid "lvresize-free"
19692 #: ../fish/guestfish-actions.pod:2341
19695 " lvresize-free lv percent\n"
19700 #: ../fish/guestfish-actions.pod:2349
19705 #: ../fish/guestfish-actions.pod:2351
19713 #: ../fish/guestfish-actions.pod:2359
19714 msgid "See also L</lvs-full>, L</list-filesystems>."
19718 #: ../fish/guestfish-actions.pod:2361
19723 #: ../fish/guestfish-actions.pod:2363
19731 #: ../fish/guestfish-actions.pod:2368
19736 #: ../fish/guestfish-actions.pod:2370
19744 #: ../fish/guestfish-actions.pod:2374
19749 #: ../fish/guestfish-actions.pod:2376
19752 " lxattrlist path 'names ...'\n"
19757 #: ../fish/guestfish-actions.pod:2392
19759 "This call is intended for programs that want to efficiently list a directory "
19760 "contents without making many round-trips. See also L</lstatlist> for a "
19761 "similarly efficient call for getting standard stats. Very long directory "
19762 "listings might cause the protocol message size to be exceeded, causing this "
19763 "call to fail. The caller must split up such requests into smaller groups of "
19768 #: ../fish/guestfish-actions.pod:2400
19773 #: ../fish/guestfish-actions.pod:2402
19781 #: ../fish/guestfish-actions.pod:2406
19786 #: ../fish/guestfish-actions.pod:2408
19789 " mkdir-mode path mode\n"
19794 #: ../fish/guestfish-actions.pod:2417
19795 msgid "See also L</mkdir>, L</umask>"
19799 #: ../fish/guestfish-actions.pod:2419
19804 #: ../fish/guestfish-actions.pod:2421
19812 #: ../fish/guestfish-actions.pod:2426
19817 #: ../fish/guestfish-actions.pod:2428
19820 " mkdtemp template\n"
19825 #: ../fish/guestfish-actions.pod:2449
19830 #: ../fish/guestfish-actions.pod:2451
19833 " mke2fs-J fstype blocksize device journal\n"
19838 #: ../fish/guestfish-actions.pod:2459
19839 msgid "See also L</mke2journal>."
19843 #: ../fish/guestfish-actions.pod:2461
19848 #: ../fish/guestfish-actions.pod:2463
19851 " mke2fs-JL fstype blocksize device label\n"
19856 #: ../fish/guestfish-actions.pod:2468
19857 msgid "See also L</mke2journal-L>."
19861 #: ../fish/guestfish-actions.pod:2470
19866 #: ../fish/guestfish-actions.pod:2472
19869 " mke2fs-JU fstype blocksize device uuid\n"
19874 #: ../fish/guestfish-actions.pod:2477
19875 msgid "See also L</mke2journal-U>."
19879 #: ../fish/guestfish-actions.pod:2479
19880 msgid "mke2journal"
19884 #: ../fish/guestfish-actions.pod:2481
19887 " mke2journal blocksize device\n"
19892 #: ../fish/guestfish-actions.pod:2488
19893 msgid "mke2journal-L"
19897 #: ../fish/guestfish-actions.pod:2490
19900 " mke2journal-L blocksize label device\n"
19905 #: ../fish/guestfish-actions.pod:2494
19906 msgid "mke2journal-U"
19910 #: ../fish/guestfish-actions.pod:2496
19913 " mke2journal-U blocksize uuid device\n"
19918 #: ../fish/guestfish-actions.pod:2500
19923 #: ../fish/guestfish-actions.pod:2502
19926 " mkfifo mode path\n"
19931 #: ../fish/guestfish-actions.pod:2504
19933 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
19934 "is just a convenient wrapper around L</mknod>."
19938 #: ../fish/guestfish-actions.pod:2510
19943 #: ../fish/guestfish-actions.pod:2512
19946 " mkfs fstype device\n"
19951 #: ../fish/guestfish-actions.pod:2518
19956 #: ../fish/guestfish-actions.pod:2520
19959 " mkfs-b fstype blocksize device\n"
19964 #: ../fish/guestfish-actions.pod:2522
19966 "This call is similar to L</mkfs>, but it allows you to control the block "
19967 "size of the resulting filesystem. Supported block sizes depend on the "
19968 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
19972 #: ../fish/guestfish-actions.pod:2530
19973 msgid "mkmountpoint"
19977 #: ../fish/guestfish-actions.pod:2532
19980 " mkmountpoint exemptpath\n"
19985 #: ../fish/guestfish-actions.pod:2534
19987 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
19988 "to create extra mountpoints before mounting the first filesystem."
19992 #: ../fish/guestfish-actions.pod:2558
19997 #: ../fish/guestfish-actions.pod:2560
20000 " mknod mode devmajor devminor path\n"
20005 #: ../fish/guestfish-actions.pod:2570
20007 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
20008 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
20009 "regular file). These constants are available in the standard Linux header "
20010 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
20011 "wrappers around this command which bitwise OR in the appropriate constant "
20016 #: ../fish/guestfish-actions.pod:2580
20021 #: ../fish/guestfish-actions.pod:2582
20024 " mknod-b mode devmajor devminor path\n"
20029 #: ../fish/guestfish-actions.pod:2584
20031 "This call creates a block device node called C<path> with mode C<mode> and "
20032 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20033 "wrapper around L</mknod>."
20037 #: ../fish/guestfish-actions.pod:2590
20042 #: ../fish/guestfish-actions.pod:2592
20045 " mknod-c mode devmajor devminor path\n"
20050 #: ../fish/guestfish-actions.pod:2594
20052 "This call creates a char device node called C<path> with mode C<mode> and "
20053 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20054 "wrapper around L</mknod>."
20058 #: ../fish/guestfish-actions.pod:2600
20063 #: ../fish/guestfish-actions.pod:2602
20071 #: ../fish/guestfish-actions.pod:2606
20076 #: ../fish/guestfish-actions.pod:2608
20079 " mkswap-L label device\n"
20084 #: ../fish/guestfish-actions.pod:2616
20089 #: ../fish/guestfish-actions.pod:2618
20092 " mkswap-U uuid device\n"
20097 #: ../fish/guestfish-actions.pod:2622
20098 msgid "mkswap-file"
20102 #: ../fish/guestfish-actions.pod:2624
20105 " mkswap-file path\n"
20110 #: ../fish/guestfish-actions.pod:2628
20112 "This command just writes a swap file signature to an existing file. To "
20113 "create the file itself, use something like L</fallocate>."
20117 #: ../fish/guestfish-actions.pod:2631
20122 #: ../fish/guestfish-actions.pod:2633
20125 " modprobe modulename\n"
20130 #: ../fish/guestfish-actions.pod:2640
20135 #: ../fish/guestfish-actions.pod:2642
20138 " mount device mountpoint\n"
20143 #: ../fish/guestfish-actions.pod:2658
20145 "B<Important note:> When you use this call, the filesystem options C<sync> "
20146 "and C<noatime> are set implicitly. This was originally done because we "
20147 "thought it would improve reliability, but it turns out that I<-o sync> has a "
20148 "very large negative performance impact and negligible effect on "
20149 "reliability. Therefore we recommend that you avoid using L</mount> in any "
20150 "code that needs performance, and instead use L</mount-options> (use an empty "
20151 "string for the first parameter if you don't want any options)."
20155 #: ../fish/guestfish-actions.pod:2668
20160 #: ../fish/guestfish-actions.pod:2670
20163 " mount-loop file mountpoint\n"
20168 #: ../fish/guestfish-actions.pod:2676
20169 msgid "mount-options"
20173 #: ../fish/guestfish-actions.pod:2678
20176 " mount-options options device mountpoint\n"
20181 #: ../fish/guestfish-actions.pod:2680
20183 "This is the same as the L</mount> command, but it allows you to set the "
20184 "mount options as for the L<mount(8)> I<-o> flag."
20188 #: ../fish/guestfish-actions.pod:2688
20193 #: ../fish/guestfish-actions.pod:2690
20196 " mount-ro device mountpoint\n"
20201 #: ../fish/guestfish-actions.pod:2692
20203 "This is the same as the L</mount> command, but it mounts the filesystem with "
20204 "the read-only (I<-o ro>) flag."
20208 #: ../fish/guestfish-actions.pod:2695
20213 #: ../fish/guestfish-actions.pod:2697
20216 " mount-vfs options vfstype device mountpoint\n"
20221 #: ../fish/guestfish-actions.pod:2699
20223 "This is the same as the L</mount> command, but it allows you to set both the "
20224 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
20228 #: ../fish/guestfish-actions.pod:2703
20229 msgid "mountpoints"
20233 #: ../fish/guestfish-actions.pod:2705
20241 #: ../fish/guestfish-actions.pod:2707
20243 "This call is similar to L</mounts>. That call returns a list of devices. "
20244 "This one returns a hash table (map) of device name to directory where the "
20245 "device is mounted."
20249 #: ../fish/guestfish-actions.pod:2711
20254 #: ../fish/guestfish-actions.pod:2713
20262 #: ../fish/guestfish-actions.pod:2720
20263 msgid "See also: L</mountpoints>"
20267 #: ../fish/guestfish-actions.pod:2722
20272 #: ../fish/guestfish-actions.pod:2724
20280 #: ../fish/guestfish-actions.pod:2729
20281 msgid "ntfs-3g-probe"
20285 #: ../fish/guestfish-actions.pod:2731
20288 " ntfs-3g-probe true|false device\n"
20293 #: ../fish/guestfish-actions.pod:2745
20298 #: ../fish/guestfish-actions.pod:2747
20301 " ntfsresize device\n"
20306 #: ../fish/guestfish-actions.pod:2753
20307 msgid "ntfsresize-size"
20311 #: ../fish/guestfish-actions.pod:2755
20314 " ntfsresize-size device size\n"
20319 #: ../fish/guestfish-actions.pod:2757
20321 "This command is the same as L</ntfsresize> except that it allows you to "
20322 "specify the new size (in bytes) explicitly."
20326 #: ../fish/guestfish-actions.pod:2760
20331 #: ../fish/guestfish-actions.pod:2762
20334 " part-add device prlogex startsect endsect\n"
20339 #: ../fish/guestfish-actions.pod:2764
20341 "This command adds a partition to C<device>. If there is no partition table "
20342 "on the device, call L</part-init> first."
20346 #: ../fish/guestfish-actions.pod:2776
20348 "Creating a partition which covers the whole disk is not so easy. Use "
20349 "L</part-disk> to do that."
20353 #: ../fish/guestfish-actions.pod:2779
20358 #: ../fish/guestfish-actions.pod:2781
20361 " part-del device partnum\n"
20366 #: ../fish/guestfish-actions.pod:2789
20371 #: ../fish/guestfish-actions.pod:2791
20374 " part-disk device parttype\n"
20379 #: ../fish/guestfish-actions.pod:2793
20381 "This command is simply a combination of L</part-init> followed by "
20382 "L</part-add> to create a single primary partition covering the whole disk."
20386 #: ../fish/guestfish-actions.pod:2797
20388 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
20389 "possible values are described in L</part-init>."
20393 #: ../fish/guestfish-actions.pod:2803
20394 msgid "part-get-bootable"
20398 #: ../fish/guestfish-actions.pod:2805
20401 " part-get-bootable device partnum\n"
20406 #: ../fish/guestfish-actions.pod:2810
20407 msgid "See also L</part-set-bootable>."
20411 #: ../fish/guestfish-actions.pod:2812
20412 msgid "part-get-mbr-id"
20416 #: ../fish/guestfish-actions.pod:2814
20419 " part-get-mbr-id device partnum\n"
20424 #: ../fish/guestfish-actions.pod:2819 ../fish/guestfish-actions.pod:2957
20426 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
20427 "undefined results for other partition table types (see "
20428 "L</part-get-parttype>)."
20432 #: ../fish/guestfish-actions.pod:2823
20433 msgid "part-get-parttype"
20437 #: ../fish/guestfish-actions.pod:2825
20440 " part-get-parttype device\n"
20445 #: ../fish/guestfish-actions.pod:2830
20447 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
20448 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
20449 "possible, although unusual. See L</part-init> for a full list."
20453 #: ../fish/guestfish-actions.pod:2835
20458 #: ../fish/guestfish-actions.pod:2837
20461 " part-init device parttype\n"
20466 #: ../fish/guestfish-actions.pod:2843
20468 "Initially there are no partitions. Following this, you should call "
20469 "L</part-add> for each partition required."
20473 #: ../fish/guestfish-actions.pod:2906
20478 #: ../fish/guestfish-actions.pod:2908
20481 " part-list device\n"
20486 #: ../fish/guestfish-actions.pod:2923
20488 "Start of the partition I<in bytes>. To get sectors you have to divide by "
20489 "the device's sector size, see L</blockdev-getss>."
20493 #: ../fish/guestfish-actions.pod:2936
20494 msgid "part-set-bootable"
20498 #: ../fish/guestfish-actions.pod:2938
20501 " part-set-bootable device partnum true|false\n"
20506 #: ../fish/guestfish-actions.pod:2947
20507 msgid "part-set-mbr-id"
20511 #: ../fish/guestfish-actions.pod:2949
20514 " part-set-mbr-id device partnum idbyte\n"
20519 #: ../fish/guestfish-actions.pod:2961
20520 msgid "part-set-name"
20524 #: ../fish/guestfish-actions.pod:2963
20527 " part-set-name device partnum name\n"
20532 #: ../fish/guestfish-actions.pod:2971
20533 msgid "part-to-dev"
20537 #: ../fish/guestfish-actions.pod:2973
20540 " part-to-dev partition\n"
20545 #: ../fish/guestfish-actions.pod:2979
20547 "The named partition must exist, for example as a string returned from "
20548 "L</list-partitions>."
20552 #: ../fish/guestfish-actions.pod:2982
20553 msgid "ping-daemon"
20557 #: ../fish/guestfish-actions.pod:2984
20565 #: ../fish/guestfish-actions.pod:2991
20570 #: ../fish/guestfish-actions.pod:2993
20573 " pread path count offset\n"
20578 #: ../fish/guestfish-actions.pod:3001
20579 msgid "See also L</pwrite>, L</pread-device>."
20583 #: ../fish/guestfish-actions.pod:3006
20584 msgid "pread-device"
20588 #: ../fish/guestfish-actions.pod:3008
20591 " pread-device device count offset\n"
20596 #: ../fish/guestfish-actions.pod:3016
20597 msgid "See also L</pread>."
20601 #: ../fish/guestfish-actions.pod:3021
20606 #: ../fish/guestfish-actions.pod:3023
20609 " pvcreate device\n"
20614 #: ../fish/guestfish-actions.pod:3029
20619 #: ../fish/guestfish-actions.pod:3031
20622 " pvremove device\n"
20627 #: ../fish/guestfish-actions.pod:3040
20632 #: ../fish/guestfish-actions.pod:3042
20635 " pvresize device\n"
20640 #: ../fish/guestfish-actions.pod:3047
20641 msgid "pvresize-size"
20645 #: ../fish/guestfish-actions.pod:3049
20648 " pvresize-size device size\n"
20653 #: ../fish/guestfish-actions.pod:3051
20655 "This command is the same as L</pvresize> except that it allows you to "
20656 "specify the new size (in bytes) explicitly."
20660 #: ../fish/guestfish-actions.pod:3054
20665 #: ../fish/guestfish-actions.pod:3056
20673 #: ../fish/guestfish-actions.pod:3064
20674 msgid "See also L</pvs-full>."
20678 #: ../fish/guestfish-actions.pod:3066
20683 #: ../fish/guestfish-actions.pod:3068
20691 #: ../fish/guestfish-actions.pod:3073
20696 #: ../fish/guestfish-actions.pod:3075
20704 #: ../fish/guestfish-actions.pod:3079
20709 #: ../fish/guestfish-actions.pod:3081
20712 " pwrite path content offset\n"
20717 #: ../fish/guestfish-actions.pod:3092
20718 msgid "See also L</pread>, L</pwrite-device>."
20722 #: ../fish/guestfish-actions.pod:3097
20723 msgid "pwrite-device"
20727 #: ../fish/guestfish-actions.pod:3099
20730 " pwrite-device device content offset\n"
20735 #: ../fish/guestfish-actions.pod:3109
20736 msgid "See also L</pwrite>."
20740 #: ../fish/guestfish-actions.pod:3114
20745 #: ../fish/guestfish-actions.pod:3116
20748 " read-file path\n"
20753 #: ../fish/guestfish-actions.pod:3121
20755 "Unlike L</cat>, this function can correctly handle files that contain "
20756 "embedded ASCII NUL characters. However unlike L</download>, this function "
20757 "is limited in the total size of file that can be handled."
20761 #: ../fish/guestfish-actions.pod:3129
20766 #: ../fish/guestfish-actions.pod:3131
20769 " read-lines path\n"
20774 #: ../fish/guestfish-actions.pod:3138
20776 "Note that this function cannot correctly handle binary files (specifically, "
20777 "files containing C<\\0> character which is treated as end of line). For "
20778 "those you need to use the L</read-file> function which has a more complex "
20783 #: ../fish/guestfish-actions.pod:3143
20788 #: ../fish/guestfish-actions.pod:3145
20796 #: ../fish/guestfish-actions.pod:3197
20798 "This function is primarily intended for use by programs. To get a simple "
20799 "list of names, use L</ls>. To get a printable directory for human "
20800 "consumption, use L</ll>."
20804 #: ../fish/guestfish-actions.pod:3201
20809 #: ../fish/guestfish-actions.pod:3203
20817 #: ../fish/guestfish-actions.pod:3207
20818 msgid "readlinklist"
20822 #: ../fish/guestfish-actions.pod:3209
20825 " readlinklist path 'names ...'\n"
20830 #: ../fish/guestfish-actions.pod:3233
20835 #: ../fish/guestfish-actions.pod:3235
20843 #: ../fish/guestfish-actions.pod:3240
20844 msgid "removexattr"
20848 #: ../fish/guestfish-actions.pod:3242
20851 " removexattr xattr path\n"
20856 #: ../fish/guestfish-actions.pod:3247
20857 msgid "See also: L</lremovexattr>, L<attr(5)>."
20861 #: ../fish/guestfish-actions.pod:3249
20866 #: ../fish/guestfish-actions.pod:3251
20869 " resize2fs device\n"
20874 #: ../fish/guestfish-actions.pod:3256
20876 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
20877 "before calling this command. For unknown reasons C<resize2fs> sometimes "
20878 "gives an error about this and sometimes not. In any case, it is always safe "
20879 "to call L</e2fsck-f> before calling this function."
20883 #: ../fish/guestfish-actions.pod:3262
20884 msgid "resize2fs-size"
20888 #: ../fish/guestfish-actions.pod:3264
20891 " resize2fs-size device size\n"
20896 #: ../fish/guestfish-actions.pod:3266
20898 "This command is the same as L</resize2fs> except that it allows you to "
20899 "specify the new size (in bytes) explicitly."
20903 #: ../fish/guestfish-actions.pod:3269
20908 #: ../fish/guestfish-actions.pod:3271
20916 #: ../fish/guestfish-actions.pod:3275
20921 #: ../fish/guestfish-actions.pod:3277
20929 #: ../fish/guestfish-actions.pod:3283
20934 #: ../fish/guestfish-actions.pod:3285
20942 #: ../fish/guestfish-actions.pod:3289
20943 msgid "rmmountpoint"
20947 #: ../fish/guestfish-actions.pod:3291
20950 " rmmountpoint exemptpath\n"
20955 #: ../fish/guestfish-actions.pod:3293
20957 "This calls removes a mountpoint that was previously created with "
20958 "L</mkmountpoint>. See L</mkmountpoint> for full details."
20962 #: ../fish/guestfish-actions.pod:3297
20963 msgid "scrub-device"
20967 #: ../fish/guestfish-actions.pod:3299
20970 " scrub-device device\n"
20975 #: ../fish/guestfish-actions.pod:3310
20980 #: ../fish/guestfish-actions.pod:3312
20983 " scrub-file file\n"
20988 #: ../fish/guestfish-actions.pod:3322
20989 msgid "scrub-freespace"
20993 #: ../fish/guestfish-actions.pod:3324
20996 " scrub-freespace dir\n"
21001 #: ../fish/guestfish-actions.pod:3326
21003 "This command creates the directory C<dir> and then fills it with files until "
21004 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
21005 "deletes them. The intention is to scrub any free space on the partition "
21006 "containing C<dir>."
21010 #: ../fish/guestfish-actions.pod:3335
21015 #: ../fish/guestfish-actions.pod:3337
21020 #: ../fish/guestfish-actions.pod:3339
21023 " set-append append\n"
21028 #: ../fish/guestfish-actions.pod:3350
21029 msgid "set-autosync"
21033 #: ../fish/guestfish-actions.pod:3352
21038 #: ../fish/guestfish-actions.pod:3354
21041 " set-autosync true|false\n"
21046 #: ../fish/guestfish-actions.pod:3356
21048 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
21049 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
21050 "closed (also if the program exits without closing handles)."
21054 #: ../fish/guestfish-actions.pod:3364
21059 #: ../fish/guestfish-actions.pod:3366
21064 #: ../fish/guestfish-actions.pod:3368
21067 " set-direct true|false\n"
21072 #: ../fish/guestfish-actions.pod:3374
21074 "One consequence of this is that log messages aren't caught by the library "
21075 "and handled by L</set-log-message-callback>, but go straight to stdout."
21079 #: ../fish/guestfish-actions.pod:3383
21080 msgid "set-e2label"
21084 #: ../fish/guestfish-actions.pod:3385
21087 " set-e2label device label\n"
21092 #: ../fish/guestfish-actions.pod:3391
21094 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
21095 "label on a filesystem."
21099 #: ../fish/guestfish-actions.pod:3394
21104 #: ../fish/guestfish-actions.pod:3396
21107 " set-e2uuid device uuid\n"
21112 #: ../fish/guestfish-actions.pod:3403
21114 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
21115 "UUID of a filesystem."
21119 #: ../fish/guestfish-actions.pod:3406
21120 msgid "set-memsize"
21124 #: ../fish/guestfish-actions.pod:3408
21129 #: ../fish/guestfish-actions.pod:3410
21132 " set-memsize memsize\n"
21137 #: ../fish/guestfish-actions.pod:3412
21139 "This sets the memory size in megabytes allocated to the qemu subprocess. "
21140 "This only has any effect if called before L</launch>."
21144 #: ../fish/guestfish-actions.pod:3423
21145 msgid "set-network"
21149 #: ../fish/guestfish-actions.pod:3425
21154 #: ../fish/guestfish-actions.pod:3427
21157 " set-network true|false\n"
21162 #: ../fish/guestfish-actions.pod:3435
21163 msgid "You must call this before calling L</launch>, otherwise it has no effect."
21167 #: ../fish/guestfish-actions.pod:3438
21172 #: ../fish/guestfish-actions.pod:3440
21177 #: ../fish/guestfish-actions.pod:3442
21180 " set-path searchpath\n"
21185 #: ../fish/guestfish-actions.pod:3451
21190 #: ../fish/guestfish-actions.pod:3453
21195 #: ../fish/guestfish-actions.pod:3455
21203 #: ../fish/guestfish-actions.pod:3475
21204 msgid "set-recovery-proc"
21208 #: ../fish/guestfish-actions.pod:3477
21209 msgid "recovery-proc"
21213 #: ../fish/guestfish-actions.pod:3479
21216 " set-recovery-proc true|false\n"
21221 #: ../fish/guestfish-actions.pod:3481
21223 "If this is called with the parameter C<false> then L</launch> does not "
21224 "create a recovery process. The purpose of the recovery process is to stop "
21225 "runaway qemu processes in the case where the main program aborts abruptly."
21229 #: ../fish/guestfish-actions.pod:3486
21231 "This only has any effect if called before L</launch>, and the default is "
21236 #: ../fish/guestfish-actions.pod:3495
21237 msgid "set-selinux"
21241 #: ../fish/guestfish-actions.pod:3497
21246 #: ../fish/guestfish-actions.pod:3499
21249 " set-selinux true|false\n"
21254 #: ../fish/guestfish-actions.pod:3510
21259 #: ../fish/guestfish-actions.pod:3512
21264 #: ../fish/guestfish-actions.pod:3514
21267 " set-trace true|false\n"
21272 #: ../fish/guestfish-actions.pod:3530
21273 msgid "set-verbose"
21277 #: ../fish/guestfish-actions.pod:3532
21282 #: ../fish/guestfish-actions.pod:3534
21285 " set-verbose true|false\n"
21290 #: ../fish/guestfish-actions.pod:3541
21295 #: ../fish/guestfish-actions.pod:3543
21298 " setcon context\n"
21303 #: ../fish/guestfish-actions.pod:3550
21308 #: ../fish/guestfish-actions.pod:3552
21311 " setxattr xattr val vallen path\n"
21316 #: ../fish/guestfish-actions.pod:3558
21317 msgid "See also: L</lsetxattr>, L<attr(5)>."
21321 #: ../fish/guestfish-actions.pod:3560
21326 #: ../fish/guestfish-actions.pod:3562
21329 " sfdisk device cyls heads sectors 'lines ...'\n"
21334 #: ../fish/guestfish-actions.pod:3584
21335 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
21339 #: ../fish/guestfish-actions.pod:3590
21344 #: ../fish/guestfish-actions.pod:3592
21347 " sfdiskM device 'lines ...'\n"
21352 #: ../fish/guestfish-actions.pod:3594
21354 "This is a simplified interface to the L</sfdisk> command, where partition "
21355 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
21356 "you don't need to specify the cyls, heads and sectors parameters which were "
21357 "rarely if ever used anyway."
21361 #: ../fish/guestfish-actions.pod:3600
21362 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
21366 #: ../fish/guestfish-actions.pod:3606
21371 #: ../fish/guestfish-actions.pod:3608
21374 " sfdisk-N device partnum cyls heads sectors line\n"
21379 #: ../fish/guestfish-actions.pod:3613
21381 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
21382 "cyls/heads/sectors parameters."
21386 #: ../fish/guestfish-actions.pod:3616
21387 msgid "See also: L</part-add>"
21391 #: ../fish/guestfish-actions.pod:3621
21392 msgid "sfdisk-disk-geometry"
21396 #: ../fish/guestfish-actions.pod:3623
21399 " sfdisk-disk-geometry device\n"
21404 #: ../fish/guestfish-actions.pod:3625
21406 "This displays the disk geometry of C<device> read from the partition table. "
21407 "Especially in the case where the underlying block device has been resized, "
21408 "this can be different from the kernel's idea of the geometry (see "
21409 "L</sfdisk-kernel-geometry>)."
21413 #: ../fish/guestfish-actions.pod:3633
21414 msgid "sfdisk-kernel-geometry"
21418 #: ../fish/guestfish-actions.pod:3635
21421 " sfdisk-kernel-geometry device\n"
21426 #: ../fish/guestfish-actions.pod:3642
21431 #: ../fish/guestfish-actions.pod:3644
21434 " sfdisk-l device\n"
21439 #: ../fish/guestfish-actions.pod:3650
21440 msgid "See also: L</part-list>"
21444 #: ../fish/guestfish-actions.pod:3652
21449 #: ../fish/guestfish-actions.pod:3654
21457 #: ../fish/guestfish-actions.pod:3659
21458 msgid "This is like L</command>, but passes the command to:"
21462 #: ../fish/guestfish-actions.pod:3667
21463 msgid "All the provisos about L</command> apply to this call."
21467 #: ../fish/guestfish-actions.pod:3669
21472 #: ../fish/guestfish-actions.pod:3671
21475 " sh-lines command\n"
21480 #: ../fish/guestfish-actions.pod:3673
21481 msgid "This is the same as L</sh>, but splits the result into a list of lines."
21485 #: ../fish/guestfish-actions.pod:3676
21486 msgid "See also: L</command-lines>"
21490 #: ../fish/guestfish-actions.pod:3678
21495 #: ../fish/guestfish-actions.pod:3680
21503 #: ../fish/guestfish-actions.pod:3684
21508 #: ../fish/guestfish-actions.pod:3686
21516 #: ../fish/guestfish-actions.pod:3692
21521 #: ../fish/guestfish-actions.pod:3694
21529 #: ../fish/guestfish-actions.pod:3702
21534 #: ../fish/guestfish-actions.pod:3704
21542 #: ../fish/guestfish-actions.pod:3712
21547 #: ../fish/guestfish-actions.pod:3714
21550 " strings-e encoding path\n"
21555 #: ../fish/guestfish-actions.pod:3716
21557 "This is like the L</strings> command, but allows you to specify the encoding "
21558 "of strings that are looked for in the source file C<path>."
21562 #: ../fish/guestfish-actions.pod:3726
21564 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
21565 "ISO-8859-X (this is what L</strings> uses)."
21569 #: ../fish/guestfish-actions.pod:3758
21570 msgid "swapoff-device"
21574 #: ../fish/guestfish-actions.pod:3760
21577 " swapoff-device device\n"
21582 #: ../fish/guestfish-actions.pod:3762
21584 "This command disables the libguestfs appliance swap device or partition "
21585 "named C<device>. See L</swapon-device>."
21589 #: ../fish/guestfish-actions.pod:3766
21590 msgid "swapoff-file"
21594 #: ../fish/guestfish-actions.pod:3768
21597 " swapoff-file file\n"
21602 #: ../fish/guestfish-actions.pod:3772
21603 msgid "swapoff-label"
21607 #: ../fish/guestfish-actions.pod:3774
21610 " swapoff-label label\n"
21615 #: ../fish/guestfish-actions.pod:3779
21616 msgid "swapoff-uuid"
21620 #: ../fish/guestfish-actions.pod:3781
21623 " swapoff-uuid uuid\n"
21628 #: ../fish/guestfish-actions.pod:3786
21629 msgid "swapon-device"
21633 #: ../fish/guestfish-actions.pod:3788
21636 " swapon-device device\n"
21641 #: ../fish/guestfish-actions.pod:3790
21643 "This command enables the libguestfs appliance to use the swap device or "
21644 "partition named C<device>. The increased memory is made available for all "
21645 "commands, for example those run using L</command> or L</sh>."
21649 #: ../fish/guestfish-actions.pod:3802
21650 msgid "swapon-file"
21654 #: ../fish/guestfish-actions.pod:3804
21657 " swapon-file file\n"
21662 #: ../fish/guestfish-actions.pod:3806
21663 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
21667 #: ../fish/guestfish-actions.pod:3809
21668 msgid "swapon-label"
21672 #: ../fish/guestfish-actions.pod:3811
21675 " swapon-label label\n"
21680 #: ../fish/guestfish-actions.pod:3813
21682 "This command enables swap to a labeled swap partition. See "
21683 "L</swapon-device> for other notes."
21687 #: ../fish/guestfish-actions.pod:3816
21688 msgid "swapon-uuid"
21692 #: ../fish/guestfish-actions.pod:3818
21695 " swapon-uuid uuid\n"
21700 #: ../fish/guestfish-actions.pod:3820
21702 "This command enables swap to a swap partition with the given UUID. See "
21703 "L</swapon-device> for other notes."
21707 #: ../fish/guestfish-actions.pod:3823
21712 #: ../fish/guestfish-actions.pod:3825
21720 #: ../fish/guestfish-actions.pod:3833
21725 #: ../fish/guestfish-actions.pod:3835
21733 #: ../fish/guestfish-actions.pod:3843
21738 #: ../fish/guestfish-actions.pod:3845
21741 " tail-n nrlines path\n"
21746 #: ../fish/guestfish-actions.pod:3858
21751 #: ../fish/guestfish-actions.pod:3860
21754 " tar-in (tarfile|-) directory\n"
21759 #: ../fish/guestfish-actions.pod:3865
21760 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
21764 #: ../fish/guestfish-actions.pod:3870
21769 #: ../fish/guestfish-actions.pod:3872
21772 " tar-out directory (tarfile|-)\n"
21777 #: ../fish/guestfish-actions.pod:3877
21778 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
21782 #: ../fish/guestfish-actions.pod:3882
21787 #: ../fish/guestfish-actions.pod:3884
21790 " tgz-in (tarball|-) directory\n"
21795 #: ../fish/guestfish-actions.pod:3889
21796 msgid "To upload an uncompressed tarball, use L</tar-in>."
21800 #: ../fish/guestfish-actions.pod:3893
21805 #: ../fish/guestfish-actions.pod:3895
21808 " tgz-out directory (tarball|-)\n"
21813 #: ../fish/guestfish-actions.pod:3900
21814 msgid "To download an uncompressed tarball, use L</tar-out>."
21818 #: ../fish/guestfish-actions.pod:3904
21823 #: ../fish/guestfish-actions.pod:3906
21831 #: ../fish/guestfish-actions.pod:3915
21836 #: ../fish/guestfish-actions.pod:3917
21844 #: ../fish/guestfish-actions.pod:3922
21845 msgid "truncate-size"
21849 #: ../fish/guestfish-actions.pod:3924
21852 " truncate-size path size\n"
21857 #: ../fish/guestfish-actions.pod:3929
21859 "If the current file size is less than C<size> then the file is extended to "
21860 "the required size with zero bytes. This creates a sparse file (ie. disk "
21861 "blocks are not allocated for the file until you write to it). To create a "
21862 "non-sparse file of zeroes, use L</fallocate64> instead."
21866 #: ../fish/guestfish-actions.pod:3935
21871 #: ../fish/guestfish-actions.pod:3937
21874 " tune2fs-l device\n"
21879 #: ../fish/guestfish-actions.pod:3947
21884 #: ../fish/guestfish-actions.pod:3949
21887 " txz-in (tarball|-) directory\n"
21892 #: ../fish/guestfish-actions.pod:3956
21897 #: ../fish/guestfish-actions.pod:3958
21900 " txz-out directory (tarball|-)\n"
21905 #: ../fish/guestfish-actions.pod:3965
21910 #: ../fish/guestfish-actions.pod:3967
21918 #: ../fish/guestfish-actions.pod:3981
21919 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
21923 #: ../fish/guestfish-actions.pod:3986
21928 #: ../fish/guestfish-actions.pod:3988
21933 #: ../fish/guestfish-actions.pod:3990
21936 " umount pathordevice\n"
21941 #: ../fish/guestfish-actions.pod:3996
21946 #: ../fish/guestfish-actions.pod:3998
21947 msgid "unmount-all"
21951 #: ../fish/guestfish-actions.pod:4000
21959 #: ../fish/guestfish-actions.pod:4006
21964 #: ../fish/guestfish-actions.pod:4008
21967 " upload (filename|-) remotefilename\n"
21972 #: ../fish/guestfish-actions.pod:4015
21973 msgid "See also L</download>."
21977 #: ../fish/guestfish-actions.pod:4019
21978 msgid "upload-offset"
21982 #: ../fish/guestfish-actions.pod:4021
21985 " upload-offset (filename|-) remotefilename offset\n"
21990 #: ../fish/guestfish-actions.pod:4033
21992 "Note that there is no limit on the amount of data that can be uploaded with "
21993 "this call, unlike with L</pwrite>, and this call always writes the full "
21994 "amount unless an error occurs."
21998 #: ../fish/guestfish-actions.pod:4038
21999 msgid "See also L</upload>, L</pwrite>."
22003 #: ../fish/guestfish-actions.pod:4042
22008 #: ../fish/guestfish-actions.pod:4044
22011 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
22016 #: ../fish/guestfish-actions.pod:4063
22021 #: ../fish/guestfish-actions.pod:4065
22029 #: ../fish/guestfish-actions.pod:4092
22031 "I<Note:> Don't use this call to test for availability of features. In "
22032 "enterprise distributions we backport features from later versions into "
22033 "earlier versions, making this an unreliable way to test for features. Use "
22034 "L</available> instead."
22038 #: ../fish/guestfish-actions.pod:4098
22043 #: ../fish/guestfish-actions.pod:4100
22046 " vfs-label device\n"
22051 #: ../fish/guestfish-actions.pod:4107
22052 msgid "To find a filesystem from the label, use L</findfs-label>."
22056 #: ../fish/guestfish-actions.pod:4109
22061 #: ../fish/guestfish-actions.pod:4111
22064 " vfs-type device\n"
22069 #: ../fish/guestfish-actions.pod:4121
22074 #: ../fish/guestfish-actions.pod:4123
22077 " vfs-uuid device\n"
22082 #: ../fish/guestfish-actions.pod:4130
22083 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
22087 #: ../fish/guestfish-actions.pod:4132
22088 msgid "vg-activate"
22092 #: ../fish/guestfish-actions.pod:4134
22095 " vg-activate true|false 'volgroups ...'\n"
22100 #: ../fish/guestfish-actions.pod:4147
22101 msgid "vg-activate-all"
22105 #: ../fish/guestfish-actions.pod:4149
22108 " vg-activate-all true|false\n"
22113 #: ../fish/guestfish-actions.pod:4159
22118 #: ../fish/guestfish-actions.pod:4161
22121 " vgcreate volgroup 'physvols ...'\n"
22126 #: ../fish/guestfish-actions.pod:4166
22131 #: ../fish/guestfish-actions.pod:4168
22134 " vglvuuids vgname\n"
22139 #: ../fish/guestfish-actions.pod:4173
22141 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
22142 "logical volumes and volume groups."
22146 #: ../fish/guestfish-actions.pod:4176
22147 msgid "See also L</vgpvuuids>."
22151 #: ../fish/guestfish-actions.pod:4178
22156 #: ../fish/guestfish-actions.pod:4180
22159 " vgpvuuids vgname\n"
22164 #: ../fish/guestfish-actions.pod:4185
22166 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
22167 "physical volumes and volume groups."
22171 #: ../fish/guestfish-actions.pod:4188
22172 msgid "See also L</vglvuuids>."
22176 #: ../fish/guestfish-actions.pod:4190
22181 #: ../fish/guestfish-actions.pod:4192
22184 " vgremove vgname\n"
22189 #: ../fish/guestfish-actions.pod:4199
22194 #: ../fish/guestfish-actions.pod:4201
22197 " vgrename volgroup newvolgroup\n"
22202 #: ../fish/guestfish-actions.pod:4205
22207 #: ../fish/guestfish-actions.pod:4207
22215 #: ../fish/guestfish-actions.pod:4215
22216 msgid "See also L</vgs-full>."
22220 #: ../fish/guestfish-actions.pod:4217
22225 #: ../fish/guestfish-actions.pod:4219
22233 #: ../fish/guestfish-actions.pod:4224
22238 #: ../fish/guestfish-actions.pod:4226
22246 #: ../fish/guestfish-actions.pod:4231
22251 #: ../fish/guestfish-actions.pod:4233
22259 #: ../fish/guestfish-actions.pod:4237
22264 #: ../fish/guestfish-actions.pod:4239
22272 #: ../fish/guestfish-actions.pod:4244
22277 #: ../fish/guestfish-actions.pod:4246
22285 #: ../fish/guestfish-actions.pod:4251
22290 #: ../fish/guestfish-actions.pod:4253
22298 #: ../fish/guestfish-actions.pod:4258
22303 #: ../fish/guestfish-actions.pod:4260
22306 " write path content\n"
22311 #: ../fish/guestfish-actions.pod:4268
22316 #: ../fish/guestfish-actions.pod:4270
22319 " write-file path content size\n"
22324 #: ../fish/guestfish-actions.pod:4293
22329 #: ../fish/guestfish-actions.pod:4295
22332 " zegrep regex path\n"
22337 #: ../fish/guestfish-actions.pod:4303
22342 #: ../fish/guestfish-actions.pod:4305
22345 " zegrepi regex path\n"
22350 #: ../fish/guestfish-actions.pod:4313
22355 #: ../fish/guestfish-actions.pod:4315
22363 #: ../fish/guestfish-actions.pod:4323
22364 msgid "See also: L</zero-device>, L</scrub-device>."
22368 #: ../fish/guestfish-actions.pod:4325
22369 msgid "zero-device"
22373 #: ../fish/guestfish-actions.pod:4327
22376 " zero-device device\n"
22381 #: ../fish/guestfish-actions.pod:4329
22383 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
22384 "which just zeroes the first few blocks of a device."
22388 #: ../fish/guestfish-actions.pod:4336
22393 #: ../fish/guestfish-actions.pod:4338
22396 " zerofree device\n"
22401 #: ../fish/guestfish-actions.pod:4351
22406 #: ../fish/guestfish-actions.pod:4353
22409 " zfgrep pattern path\n"
22414 #: ../fish/guestfish-actions.pod:4361
22419 #: ../fish/guestfish-actions.pod:4363
22422 " zfgrepi pattern path\n"
22427 #: ../fish/guestfish-actions.pod:4371
22432 #: ../fish/guestfish-actions.pod:4373
22435 " zfile meth path\n"
22440 #: ../fish/guestfish-actions.pod:4380
22441 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
22445 #: ../fish/guestfish-actions.pod:4390
22450 #: ../fish/guestfish-actions.pod:4392
22453 " zgrep regex path\n"
22458 #: ../fish/guestfish-actions.pod:4400
22463 #: ../fish/guestfish-actions.pod:4402
22466 " zgrepi regex path\n"
22471 #: ../fish/guestfish-commands.pod:1
22476 #: ../fish/guestfish-commands.pod:3
22481 #: ../fish/guestfish-commands.pod:5
22484 " alloc filename size\n"
22489 #: ../fish/guestfish-commands.pod:7
22491 "This creates an empty (zeroed) file of the given size, and then adds so it "
22492 "can be further examined."
22496 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
22497 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
22501 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
22502 msgid "Size can be specified using standard suffixes, eg. C<1M>."
22506 #: ../fish/guestfish-commands.pod:14
22508 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
22509 "image, see L</PREPARED DISK IMAGES>."
22513 #: ../fish/guestfish-commands.pod:17
22518 #: ../fish/guestfish-commands.pod:19
22521 " copy-in local [local ...] /remotedir\n"
22526 #: ../fish/guestfish-commands.pod:21
22528 "C<copy-in> copies local files or directories recursively into the disk "
22529 "image, placing them in the directory called C</remotedir> (which must "
22530 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
22531 "other commands as necessary."
22535 #: ../fish/guestfish-commands.pod:26
22537 "Multiple local files and directories can be specified, but the last "
22538 "parameter must always be a remote directory. Wildcards cannot be used."
22542 #: ../fish/guestfish-commands.pod:30
22547 #: ../fish/guestfish-commands.pod:32
22550 " copy-out remote [remote ...] localdir\n"
22555 #: ../fish/guestfish-commands.pod:34
22557 "C<copy-out> copies remote files or directories recursively out of the disk "
22558 "image, placing them on the host disk in a local directory called C<localdir> "
22559 "(which must exist). This guestfish meta-command turns into a sequence of "
22560 "L</download>, L</tar-out> and other commands as necessary."
22564 #: ../fish/guestfish-commands.pod:40
22566 "Multiple remote files and directories can be specified, but the last "
22567 "parameter must always be a local directory. To download to the current "
22568 "directory, use C<.> as in:"
22572 #: ../fish/guestfish-commands.pod:44
22575 " copy-out /home .\n"
22580 #: ../fish/guestfish-commands.pod:46
22582 "Wildcards cannot be used in the ordinary command, but you can use them with "
22583 "the help of L</glob> like this:"
22587 #: ../fish/guestfish-commands.pod:49
22590 " glob copy-out /home/* .\n"
22595 #: ../fish/guestfish-commands.pod:51
22600 #: ../fish/guestfish-commands.pod:53
22603 " echo [params ...]\n"
22608 #: ../fish/guestfish-commands.pod:55
22609 msgid "This echos the parameters to the terminal."
22613 #: ../fish/guestfish-commands.pod:57
22618 #: ../fish/guestfish-commands.pod:59
22623 #: ../fish/guestfish-commands.pod:61
22628 #: ../fish/guestfish-commands.pod:63
22636 #: ../fish/guestfish-commands.pod:65
22638 "This is used to edit a file. It downloads the file, edits it locally using "
22639 "your editor, then uploads the result."
22643 #: ../fish/guestfish-commands.pod:68
22645 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
22646 "or C<emacs> you will get those corresponding editors."
22650 #: ../fish/guestfish-commands.pod:72
22655 #: ../fish/guestfish-commands.pod:74
22658 " glob command args...\n"
22663 #: ../fish/guestfish-commands.pod:76
22665 "Expand wildcards in any paths in the args list, and run C<command> "
22666 "repeatedly on each matching path."
22670 #: ../fish/guestfish-commands.pod:79
22671 msgid "See L</WILDCARDS AND GLOBBING>."
22675 #: ../fish/guestfish-commands.pod:81
22680 #: ../fish/guestfish-commands.pod:83
22683 " hexedit <filename|device>\n"
22684 " hexedit <filename|device> <max>\n"
22685 " hexedit <filename|device> <start> <max>\n"
22690 #: ../fish/guestfish-commands.pod:87
22692 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
22697 #: ../fish/guestfish-commands.pod:90
22699 "This command works by downloading potentially the whole file or device, "
22700 "editing it locally, then uploading it. If the file or device is large, you "
22701 "have to specify which part you wish to edit by using C<max> and/or C<start> "
22702 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
22703 "usual modifiers allowed such as C<1M> (1 megabyte)."
22707 #: ../fish/guestfish-commands.pod:97
22708 msgid "For example to edit the first few sectors of a disk you might do:"
22712 #: ../fish/guestfish-commands.pod:100
22715 " hexedit /dev/sda 1M\n"
22720 #: ../fish/guestfish-commands.pod:102
22722 "which would allow you to edit anywhere within the first megabyte of the "
22727 #: ../fish/guestfish-commands.pod:105
22728 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
22732 #: ../fish/guestfish-commands.pod:107
22735 " hexedit /dev/sda1 0x400 0x400\n"
22740 #: ../fish/guestfish-commands.pod:109
22741 msgid "(assuming the superblock is in the standard location)."
22745 #: ../fish/guestfish-commands.pod:111
22747 "This command requires the external L<hexedit(1)> program. You can specify "
22748 "another program to use by setting the C<HEXEDITOR> environment variable."
22752 #: ../fish/guestfish-commands.pod:115
22753 msgid "See also L</hexdump>."
22757 #: ../fish/guestfish-commands.pod:117
22762 #: ../fish/guestfish-commands.pod:119
22770 #: ../fish/guestfish-commands.pod:121
22771 msgid "Change the local directory, ie. the current directory of guestfish itself."
22775 #: ../fish/guestfish-commands.pod:124
22776 msgid "Note that C<!cd> won't do what you might expect."
22780 #: ../fish/guestfish-commands.pod:126
22785 #: ../fish/guestfish-commands.pod:128
22790 #: ../fish/guestfish-commands.pod:130
22798 #: ../fish/guestfish-commands.pod:132
22799 msgid "Opens the manual page for guestfish."
22803 #: ../fish/guestfish-commands.pod:134
22808 #: ../fish/guestfish-commands.pod:136
22813 #: ../fish/guestfish-commands.pod:138
22821 #: ../fish/guestfish-commands.pod:140
22829 #: ../fish/guestfish-commands.pod:142
22830 msgid "This is used to view a file."
22834 #: ../fish/guestfish-commands.pod:144
22836 "The default viewer is C<$PAGER>. However if you use the alternate command "
22837 "C<less> you will get the C<less> command specifically."
22841 #: ../fish/guestfish-commands.pod:147
22846 #: ../fish/guestfish-commands.pod:149
22854 #: ../fish/guestfish-commands.pod:151
22856 "Close and reopen the libguestfs handle. It is not necessary to use this "
22857 "normally, because the handle is closed properly when guestfish exits. "
22858 "However this is occasionally useful for testing."
22862 #: ../fish/guestfish-commands.pod:155
22867 #: ../fish/guestfish-commands.pod:157
22870 " sparse filename size\n"
22875 #: ../fish/guestfish-commands.pod:159
22877 "This creates an empty sparse file of the given size, and then adds so it can "
22878 "be further examined."
22882 #: ../fish/guestfish-commands.pod:162
22884 "In all respects it works the same as the L</alloc> command, except that the "
22885 "image file is allocated sparsely, which means that disk blocks are not "
22886 "assigned to the file until they are needed. Sparse disk files only use "
22887 "space when written to, but they are slower and there is a danger you could "
22888 "run out of real disk space during a write operation."
22892 #: ../fish/guestfish-commands.pod:172
22897 #: ../fish/guestfish-commands.pod:174
22905 #: ../fish/guestfish-commands.pod:176
22907 "This command returns a list of the optional groups known to the daemon, and "
22908 "indicates which ones are supported by this build of the libguestfs "
22913 #: ../fish/guestfish-commands.pod:180
22914 msgid "See also L<guestfs(3)/AVAILABILITY>."
22918 #: ../fish/guestfish-commands.pod:182
22923 #: ../fish/guestfish-commands.pod:184
22926 " time command args...\n"
22931 #: ../fish/guestfish-commands.pod:186
22933 "Run the command as usual, but print the elapsed time afterwards. This can "
22934 "be useful for benchmarking operations."
22938 #: ../test-tool/libguestfs-test-tool.pod:5
22939 msgid "libguestfs-test-tool - End user tests for libguestfs"
22943 #: ../test-tool/libguestfs-test-tool.pod:9
22946 " libguestfs-test-tool [--options]\n"
22951 #: ../test-tool/libguestfs-test-tool.pod:13
22953 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
22954 "and developers, to allow them to check basic libguestfs functionality is "
22955 "working. This is needed because libguestfs occasionally breaks for reasons "
22956 "beyond our control: usually because of changes in the underlying qemu or "
22957 "kernel packages, or the host environment."
22961 #: ../test-tool/libguestfs-test-tool.pod:20
22962 msgid "If you suspect a problem in libguestfs, then just run:"
22966 #: ../test-tool/libguestfs-test-tool.pod:22
22969 " libguestfs-test-tool\n"
22974 #: ../test-tool/libguestfs-test-tool.pod:24
22975 msgid "It will print lots of diagnostic messages."
22979 #: ../test-tool/libguestfs-test-tool.pod:26
22980 msgid "If it runs to completion successfully, you will see this near the end:"
22984 #: ../test-tool/libguestfs-test-tool.pod:28
22987 " ===== TEST FINISHED OK =====\n"
22992 #: ../test-tool/libguestfs-test-tool.pod:30
22993 msgid "and the test tool will exit with code 0."
22997 #: ../test-tool/libguestfs-test-tool.pod:32
22999 "If it fails (and/or exits with non-zero error code), please paste the "
23000 "B<complete, unedited> output of the test tool into a bug report. More "
23001 "information about reporting bugs can be found on the "
23002 "L<http://libguestfs.org/> website."
23006 #: ../test-tool/libguestfs-test-tool.pod:41
23011 #: ../test-tool/libguestfs-test-tool.pod:43
23012 msgid "Display short usage information and exit."
23016 #: ../test-tool/libguestfs-test-tool.pod:45
23017 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
23021 #: ../test-tool/libguestfs-test-tool.pod:47
23023 "Pass an alternate name for the helper program. libguestfs-test-tool will "
23024 "normally look in the C<$libexec> directory that was configured when the tool "
23029 #: ../test-tool/libguestfs-test-tool.pod:51
23030 msgid "I<--qemu qemu_binary>"
23034 #: ../test-tool/libguestfs-test-tool.pod:53
23036 "If you have downloaded another qemu binary, point this option at the full "
23037 "path of the binary to try it."
23041 #: ../test-tool/libguestfs-test-tool.pod:56
23042 msgid "I<--qemudir qemu_source_dir>"
23046 #: ../test-tool/libguestfs-test-tool.pod:58
23048 "If you have compiled qemu from source, point this option at the source "
23049 "directory to try it."
23053 #: ../test-tool/libguestfs-test-tool.pod:61
23054 msgid "I<--timeout N>"
23058 #: ../test-tool/libguestfs-test-tool.pod:63
23060 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
23061 "does not usually need to be adjusted unless your machine is very slow."
23065 #: ../test-tool/libguestfs-test-tool.pod:69
23066 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
23070 #: ../test-tool/libguestfs-test-tool.pod:71
23072 "If you have compiled another version of qemu from source and would like to "
23073 "try that, then you can use the I<--qemudir> option to point to the qemu "
23074 "source directory."
23078 #: ../test-tool/libguestfs-test-tool.pod:75
23080 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
23081 "option to point to the binary."
23085 #: ../test-tool/libguestfs-test-tool.pod:78
23087 "When using an alternate qemu with libguestfs, usually you would need to "
23088 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
23089 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
23090 "when you use either of the I<--qemudir> or I<--qemu> options."
23094 #: ../test-tool/libguestfs-test-tool.pod:85
23096 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
23097 "I<1> if there was an error."
23101 #: ../test-tool/libguestfs-test-tool.pod:92
23102 msgid "/usr/libexec/libguestfs-test-tool-helper"
23106 #: ../test-tool/libguestfs-test-tool.pod:94
23108 "This helper program is run inside the appliance and provides additional "
23113 #: ../test-tool/libguestfs-test-tool.pod:97
23114 msgid "/usr/bin/mkisofs"
23118 #: ../test-tool/libguestfs-test-tool.pod:99
23120 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
23121 "which is used as part of the tests."
23125 #: ../test-tool/libguestfs-test-tool.pod:106
23127 "For the full list of environment variables which may affect libguestfs, "
23128 "please see the L<guestfs(3)> manual page."
23132 #: ../test-tool/libguestfs-test-tool.pod:111
23133 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
23137 #: ../test-tool/libguestfs-test-tool.pod:121 ../fuse/guestmount.pod:195
23138 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
23142 #: ../fuse/guestmount.pod:5
23143 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
23147 #: ../fuse/guestmount.pod:9
23150 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
23155 #: ../fuse/guestmount.pod:13
23157 "You must I<not> use C<guestmount> in read-write mode on live virtual "
23158 "machines. If you do this, you risk disk corruption in the VM."
23162 #: ../fuse/guestmount.pod:18
23164 "The guestmount program can be used to mount virtual machine filesystems and "
23165 "other disk images on the host. It uses libguestfs for access to the guest "
23166 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
23167 "a mountable device."
23171 #: ../fuse/guestmount.pod:23
23173 "Along with other options, you have to give at least one device (I<-a> "
23174 "option) and at least one mountpoint (I<-m> option). How this works is "
23175 "better explained in the L<guestfish(1)> manual page, or you can use "
23176 "L<virt-inspector(1)> and/or the wrapper script C<guestmount-wrapper> to help "
23181 #: ../fuse/guestmount.pod:29
23183 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
23184 "by you, and the filesystem will not be visible to any other users unless you "
23185 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
23186 "the filesystem, use the C<fusermount -u> command."
23190 #: ../fuse/guestmount.pod:37
23192 "For a typical Windows guest which has its main filesystem on the first "
23197 #: ../fuse/guestmount.pod:40
23200 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
23205 #: ../fuse/guestmount.pod:42
23207 "For a typical Linux guest which has a /boot filesystem on the first "
23208 "partition, and the root filesystem on a logical volume:"
23212 #: ../fuse/guestmount.pod:45
23215 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
23220 #: ../fuse/guestmount.pod:47
23222 "To get L<virt-inspector(1)> to do the hard work of detecting guest "
23223 "mountpoints for you:"
23227 #: ../fuse/guestmount.pod:50
23230 " guestmount $(virt-inspector --ro-fish MyGuest) /mnt\n"
23235 #: ../fuse/guestmount.pod:52
23237 "(or use --fish if you don't want it to be a read only mount). The option is "
23238 "called I<--ro-fish> or I<--fish> because these parameters are compatible "
23239 "with L<guestfish(1)>."
23243 #: ../fuse/guestmount.pod:56
23245 "If you don't know what filesystems are contained in a guest or disk image, "
23246 "use L<virt-list-filesystems(1)> first:"
23250 #: ../fuse/guestmount.pod:59
23253 " virt-list-filesystems MyGuest\n"
23258 #: ../fuse/guestmount.pod:61
23260 "If you want to trace the libguestfs calls but without excessive debugging, "
23265 #: ../fuse/guestmount.pod:64
23268 " guestmount [-a ... -m ...] --trace /mnt\n"
23273 #: ../fuse/guestmount.pod:66
23274 msgid "If you want to debug the program, we recommend:"
23278 #: ../fuse/guestmount.pod:68
23281 " guestmount [-a ... -m ...] --trace --verbose /mnt\n"
23286 #: ../fuse/guestmount.pod:76
23287 msgid "Add a block device or virtual machine image."
23291 #: ../fuse/guestmount.pod:78
23292 msgid "B<--dir-cache-timeout N>"
23296 #: ../fuse/guestmount.pod:80
23298 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
23299 "seconds. The readdir cache [actually, there are several semi-independent "
23300 "caches] is populated after a readdir(2) call with the stat and extended "
23301 "attributes of the files in the directory, in anticipation that they will be "
23302 "requested soon after."
23306 #: ../fuse/guestmount.pod:86
23308 "There is also a different attribute cache implemented by FUSE (see the FUSE "
23309 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
23310 "requests, only cache existing ones."
23314 #: ../fuse/guestmount.pod:90
23315 msgid "B<--fuse-help>"
23319 #: ../fuse/guestmount.pod:92
23320 msgid "Display help on special FUSE options (see I<-o> below)."
23324 #: ../fuse/guestmount.pod:96
23325 msgid "Display brief help and exit."
23329 #: ../fuse/guestmount.pod:98
23330 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
23334 #: ../fuse/guestmount.pod:100
23336 "Mount the named partition or logical volume on the given mountpoint B<in the "
23337 "guest> (this has nothing to do with mountpoints in the host)."
23341 #: ../fuse/guestmount.pod:103
23343 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
23344 "something on C</>."
23348 #: ../fuse/guestmount.pod:108
23350 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
23351 "unmounted. If you specify this option, then we don't attempt to sync the "
23352 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
23356 #: ../fuse/guestmount.pod:113
23357 msgid "B<-o option> | B<--option option>"
23361 #: ../fuse/guestmount.pod:115
23362 msgid "Pass extra options to FUSE."
23366 #: ../fuse/guestmount.pod:117
23368 "To get a list of all the extra options supported by FUSE, use the command "
23369 "below. Note that only the FUSE I<-o> options can be passed, and only some "
23370 "of them are a good idea."
23374 #: ../fuse/guestmount.pod:121
23377 " guestmount --fuse-help\n"
23382 #: ../fuse/guestmount.pod:123
23383 msgid "Some potentially useful FUSE options:"
23387 #: ../fuse/guestmount.pod:127
23388 msgid "B<-o allow_other>"
23392 #: ../fuse/guestmount.pod:129
23393 msgid "Allow other users to see the filesystem."
23397 #: ../fuse/guestmount.pod:131
23398 msgid "B<-o attr_timeout=N>"
23402 #: ../fuse/guestmount.pod:133
23403 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
23407 #: ../fuse/guestmount.pod:135
23408 msgid "B<-o kernel_cache>"
23412 #: ../fuse/guestmount.pod:137
23414 "Allow the kernel to cache files (reduces the number of reads that have to go "
23415 "through the L<guestfs(3)> API). This is generally a good idea if you can "
23416 "afford the extra memory usage."
23420 #: ../fuse/guestmount.pod:141
23421 msgid "B<-o uid=N> B<-o gid=N>"
23425 #: ../fuse/guestmount.pod:143
23427 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
23428 "the chosen values."
23432 #: ../fuse/guestmount.pod:150
23434 "Add devices and mount everything read-only. Also disallow writes and make "
23435 "the disk appear read-only to FUSE."
23439 #: ../fuse/guestmount.pod:153
23441 "This is highly recommended if you are not going to edit the guest disk. If "
23442 "the guest is running and this option is I<not> supplied, then there is a "
23443 "strong risk of disk corruption in the guest. We try to prevent this from "
23444 "happening, but it is not always possible."
23448 #: ../fuse/guestmount.pod:160
23449 msgid "Enable SELinux support for the guest."
23453 #: ../fuse/guestmount.pod:162
23458 #: ../fuse/guestmount.pod:164
23459 msgid "Trace libguestfs calls (to stderr)."
23463 #: ../fuse/guestmount.pod:166
23464 msgid "This also stops the daemon from forking into the background."
23468 #: ../fuse/guestmount.pod:170
23469 msgid "Enable verbose messages from underlying libguestfs."
23473 #: ../fuse/guestmount.pod:174
23474 msgid "Display the program version and exit."
23478 #: ../fuse/guestmount.pod:180
23480 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
23481 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
23482 "L<http://fuse.sf.net/>."
23486 #: ../inspector/virt-inspector.pl:40
23488 "virt-inspector - Display OS version, kernel, drivers, mount points, "
23489 "applications, etc. in a virtual machine"
23493 #: ../inspector/virt-inspector.pl:44
23496 " virt-inspector [--connect URI] domname\n"
23501 #: ../inspector/virt-inspector.pl:46
23504 " virt-inspector guest.img [guest.img ...]\n"
23509 #: ../inspector/virt-inspector.pl:50
23511 "B<virt-inspector> examines a virtual machine and tries to determine the "
23512 "version of the OS, the kernel version, what drivers are installed, whether "
23513 "the virtual machine is fully virtualized (FV) or para-virtualized (PV), what "
23514 "applications are installed and more."
23518 #: ../inspector/virt-inspector.pl:55
23520 "Virt-inspector can produce output in several formats, including a readable "
23521 "text report, and XML for feeding into other programs."
23525 #: ../inspector/virt-inspector.pl:58
23527 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
23528 "libvirt domain (see: C<virsh list --all>)."
23532 #: ../inspector/virt-inspector.pl:61
23534 "You can also run virt-inspector directly on disk images from a single "
23535 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
23536 "has several block devices, in which case you should list them one after "
23537 "another, with the first corresponding to the guest's C</dev/sda>, the second "
23538 "to the guest's C</dev/sdb> and so on."
23542 #: ../inspector/virt-inspector.pl:67
23544 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
23545 "inspect several virtual machines, you have to run virt-inspector several "
23546 "times (for example, from a shell script for-loop)."
23550 #: ../inspector/virt-inspector.pl:72
23552 "Because virt-inspector needs direct access to guest images, it won't "
23553 "normally work over remote libvirt connections."
23557 #: ../inspector/virt-inspector.pl:85 ../tools/virt-edit.pl:83 ../tools/virt-win-reg.pl:182 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:89 ../tools/virt-list-filesystems.pl:60 ../tools/virt-cat.pl:90 ../tools/virt-tar.pl:109 ../tools/virt-rescue.pl:113 ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:61
23558 msgid "Display brief help."
23562 #: ../inspector/virt-inspector.pl:91 ../tools/virt-edit.pl:89 ../tools/virt-win-reg.pl:188 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:95 ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66 ../tools/virt-cat.pl:96 ../tools/virt-tar.pl:115 ../tools/virt-rescue.pl:119 ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:67
23563 msgid "B<--version>"
23567 #: ../inspector/virt-inspector.pl:93 ../tools/virt-edit.pl:91 ../tools/virt-win-reg.pl:190 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:97 ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68 ../tools/virt-cat.pl:98 ../tools/virt-tar.pl:117 ../tools/virt-rescue.pl:121 ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:69
23568 msgid "Display version number and exit."
23572 #: ../inspector/virt-inspector.pl:99 ../tools/virt-edit.pl:113 ../tools/virt-win-reg.pl:204 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:103 ../tools/virt-list-filesystems.pl:74 ../tools/virt-cat.pl:104 ../tools/virt-tar.pl:123 ../tools/virt-rescue.pl:135 ../tools/virt-list-partitions.pl:75
23573 msgid "B<--connect URI> | B<-c URI>"
23577 #: ../inspector/virt-inspector.pl:101 ../tools/virt-edit.pl:115 ../tools/virt-win-reg.pl:206 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:105 ../tools/virt-list-filesystems.pl:76 ../tools/virt-cat.pl:106 ../tools/virt-tar.pl:125 ../tools/virt-rescue.pl:137 ../tools/virt-list-partitions.pl:77
23579 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
23580 "to the default libvirt hypervisor."
23584 #: ../inspector/virt-inspector.pl:104
23586 "Libvirt is only used if you specify a C<domname> on the command line. If "
23587 "you specify guest block devices directly, then libvirt is not used at all."
23591 #: ../inspector/virt-inspector.pl:112 ../tools/virt-edit.pl:125 ../tools/virt-win-reg.pl:216 ../tools/virt-df.pl:117 ../tools/virt-ls.pl:115 ../tools/virt-resize.pl:523 ../tools/virt-list-filesystems.pl:86 ../tools/virt-cat.pl:116 ../tools/virt-tar.pl:135 ../tools/virt-rescue.pl:147 ../tools/virt-list-partitions.pl:87
23592 msgid "B<--format> raw"
23596 #: ../inspector/virt-inspector.pl:114 ../tools/virt-edit.pl:127 ../tools/virt-win-reg.pl:218 ../tools/virt-df.pl:119 ../tools/virt-ls.pl:117 ../tools/virt-list-filesystems.pl:88 ../tools/virt-cat.pl:118 ../tools/virt-tar.pl:137 ../tools/virt-rescue.pl:149 ../tools/virt-list-partitions.pl:89
23598 "Specify the format of disk images given on the command line. If this is "
23599 "omitted then the format is autodetected from the content of the disk image."
23603 #: ../inspector/virt-inspector.pl:118 ../tools/virt-edit.pl:131 ../tools/virt-win-reg.pl:222 ../tools/virt-df.pl:123 ../tools/virt-ls.pl:121 ../tools/virt-list-filesystems.pl:92 ../tools/virt-cat.pl:122 ../tools/virt-tar.pl:141 ../tools/virt-rescue.pl:153 ../tools/virt-list-partitions.pl:93
23605 "If disk images are requested from libvirt, then this program asks libvirt "
23606 "for this information. In this case, the value of the format parameter is "
23611 #: ../inspector/virt-inspector.pl:122 ../tools/virt-edit.pl:135 ../tools/virt-win-reg.pl:226 ../tools/virt-df.pl:127 ../tools/virt-ls.pl:125 ../tools/virt-resize.pl:528 ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96 ../tools/virt-cat.pl:126 ../tools/virt-tar.pl:145 ../tools/virt-rescue.pl:157 ../tools/virt-list-partitions.pl:97
23613 "If working with untrusted raw-format guest disk images, you should ensure "
23614 "the format is always specified."
23618 #: ../inspector/virt-inspector.pl:131
23620 "The following options select the output format. Use only one of them. The "
23621 "default is a readable text report."
23625 #: ../inspector/virt-inspector.pl:136
23626 msgid "B<--text> (default)"
23630 #: ../inspector/virt-inspector.pl:138
23631 msgid "Plain text report."
23635 #: ../inspector/virt-inspector.pl:140
23640 #: ../inspector/virt-inspector.pl:142
23641 msgid "Produce no output at all."
23645 #: ../inspector/virt-inspector.pl:144
23650 #: ../inspector/virt-inspector.pl:146
23652 "If you select I<--xml> then you get XML output which can be fed to other "
23657 #: ../inspector/virt-inspector.pl:149
23662 #: ../inspector/virt-inspector.pl:151
23664 "If you select I<--yaml> then you get YAML output which can be fed to other "
23669 #: ../inspector/virt-inspector.pl:154
23674 #: ../inspector/virt-inspector.pl:156
23676 "If you select I<--perl> then you get Perl structures output which can be "
23677 "used directly in another Perl program."
23681 #: ../inspector/virt-inspector.pl:159
23686 #: ../inspector/virt-inspector.pl:161
23687 msgid "B<--ro-fish>"
23691 #: ../inspector/virt-inspector.pl:163
23693 "If you select I<--fish> then we print a L<guestfish(1)> command line which "
23694 "will automatically mount up the filesystems on the correct mount points. "
23695 "Try this for example:"
23699 #: ../inspector/virt-inspector.pl:167
23702 " guestfish $(virt-inspector --fish guest.img)\n"
23707 #: ../inspector/virt-inspector.pl:169
23709 "I<--ro-fish> is the same, but the I<--ro> option is passed to guestfish so "
23710 "that the filesystems are mounted read-only."
23714 #: ../inspector/virt-inspector.pl:172
23719 #: ../inspector/virt-inspector.pl:174
23721 "In \"query mode\" we answer common questions about the guest, such as "
23722 "whether it is fullvirt or needs a Xen hypervisor to run."
23726 #: ../inspector/virt-inspector.pl:177
23727 msgid "See section I<QUERY MODE> below."
23731 #: ../inspector/virt-inspector.pl:183
23732 msgid "B<--windows-registry>"
23736 #: ../inspector/virt-inspector.pl:185
23738 "This flag is ignored for compatibility with earlier releases of the "
23743 #: ../inspector/virt-inspector.pl:188
23745 "In this version, if L<Win::Hivex(3)> is available, then we attempt to parse "
23746 "information out of the Registry for any Windows guest."
23750 #: ../inspector/virt-inspector.pl:244
23751 msgid "OUTPUT FORMAT"
23755 #: ../inspector/virt-inspector.pl:246
23758 " Operating system(s)\n"
23759 " -------------------\n"
23760 " Linux (distro + version)\n"
23761 " Windows (version)\n"
23764 " +--- Filesystems ---------- Installed apps --- Kernel & drivers\n"
23765 " ----------- -------------- ----------------\n"
23766 " mount point => device List of apps Extra information\n"
23767 " mount point => device and versions about kernel(s)\n"
23768 " ... and drivers\n"
23769 " swap => swap device\n"
23770 " (plus lots of extra information\n"
23771 " about each filesystem)\n"
23776 #: ../inspector/virt-inspector.pl:261
23777 msgid "The output of virt-inspector is a complex two-level data structure."
23781 #: ../inspector/virt-inspector.pl:263
23783 "At the top level is a list of the operating systems installed on the guest. "
23784 "(For the vast majority of guests, only a single OS is installed.) The data "
23785 "returned for the OS includes the name (Linux, Windows), the distribution and "
23790 #: ../inspector/virt-inspector.pl:268
23791 msgid "The diagram above shows what we return for each OS."
23795 #: ../inspector/virt-inspector.pl:270
23797 "With the I<--xml> option the output is mapped into an XML document. There "
23798 "is a RELAX-NG schema for this XML in the file I<virt-inspector.rng> which "
23799 "normally ships with virt-inspector, or can be found in the source."
23803 #: ../inspector/virt-inspector.pl:275
23805 "With the I<--fish> or I<--ro-fish> option the mount points are mapped to "
23806 "L<guestfish(1)> command line parameters, so that you can go in afterwards "
23807 "and inspect the guest with everything mounted in the right place. For "
23812 #: ../inspector/virt-inspector.pl:280
23815 " guestfish $(virt-inspector --ro-fish guest.img)\n"
23816 " ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot\n"
23821 #: ../inspector/virt-inspector.pl:620
23826 #: ../inspector/virt-inspector.pl:622
23828 "When you use C<virt-inspector --query>, the output is a series of lines of "
23833 #: ../inspector/virt-inspector.pl:625
23839 " xen_pv_drivers=no\n"
23844 #: ../inspector/virt-inspector.pl:630
23846 "(each answer is usually C<yes> or C<no>, or the line is completely missing "
23847 "if we could not determine the answer at all)."
23851 #: ../inspector/virt-inspector.pl:633
23853 "If the guest is multiboot, you can get apparently conflicting answers "
23854 "(eg. C<windows=yes> and C<linux=yes>, or a guest which is both fullvirt and "
23855 "has a Xen PV kernel). This is normal, and just means that the guest can do "
23856 "both things, although it might require operator intervention such as "
23857 "selecting a boot option when the guest is booting."
23861 #: ../inspector/virt-inspector.pl:640
23862 msgid "This section describes the full range of answers possible."
23866 #: ../inspector/virt-inspector.pl:661
23867 msgid "windows=(yes|no)"
23871 #: ../inspector/virt-inspector.pl:663
23872 msgid "Answer C<yes> if Microsoft Windows is installed in the guest."
23876 #: ../inspector/virt-inspector.pl:676
23877 msgid "linux=(yes|no)"
23881 #: ../inspector/virt-inspector.pl:678
23882 msgid "Answer C<yes> if a Linux kernel is installed in the guest."
23886 #: ../inspector/virt-inspector.pl:691
23887 msgid "rhel=(yes|no)"
23891 #: ../inspector/virt-inspector.pl:693
23892 msgid "Answer C<yes> if the guest contains Red Hat Enterprise Linux."
23896 #: ../inspector/virt-inspector.pl:707
23897 msgid "fedora=(yes|no)"
23901 #: ../inspector/virt-inspector.pl:709
23902 msgid "Answer C<yes> if the guest contains the Fedora Linux distribution."
23906 #: ../inspector/virt-inspector.pl:722
23907 msgid "debian=(yes|no)"
23911 #: ../inspector/virt-inspector.pl:724
23912 msgid "Answer C<yes> if the guest contains the Debian Linux distribution."
23916 #: ../inspector/virt-inspector.pl:737
23917 msgid "fullvirt=(yes|no)"
23921 #: ../inspector/virt-inspector.pl:739
23923 "Answer C<yes> if there is at least one operating system kernel installed in "
23924 "the guest which runs fully virtualized. Such a guest would require a "
23925 "hypervisor which supports full system virtualization."
23929 #: ../inspector/virt-inspector.pl:762
23930 msgid "xen_domU_kernel=(yes|no)"
23934 #: ../inspector/virt-inspector.pl:764
23936 "Answer C<yes> if there is at least one Linux kernel installed in the guest "
23937 "which is compiled as a Xen DomU (a Xen paravirtualized guest)."
23941 #: ../inspector/virt-inspector.pl:784
23942 msgid "xen_pv_drivers=(yes|no)"
23946 #: ../inspector/virt-inspector.pl:786
23948 "Answer C<yes> if the guest has Xen paravirtualized drivers installed "
23949 "(usually the kernel itself will be fully virtualized, but the PV drivers "
23950 "have been installed by the administrator for performance reasons)."
23954 #: ../inspector/virt-inspector.pl:808
23955 msgid "virtio_drivers=(yes|no)"
23959 #: ../inspector/virt-inspector.pl:810
23961 "Answer C<yes> if the guest has virtio paravirtualized drivers installed. "
23962 "Virtio drivers are commonly used to improve the performance of KVM."
23966 #: ../inspector/virt-inspector.pl:831
23967 msgid "userspace_arch=(x86_64|...)"
23971 #: ../inspector/virt-inspector.pl:833
23972 msgid "Print the architecture of userspace."
23976 #: ../inspector/virt-inspector.pl:835 ../inspector/virt-inspector.pl:856
23977 msgid "NB. For multi-boot VMs this can print several lines."
23981 #: ../inspector/virt-inspector.pl:852
23982 msgid "kernel_arch=(x86_64|...)"
23986 #: ../inspector/virt-inspector.pl:854
23987 msgid "Print the architecture of the kernel."
23991 #: ../inspector/virt-inspector.pl:877 ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:142 ../tools/virt-win-reg.pl:480 ../tools/virt-df.pl:607 ../tools/virt-ls.pl:228 ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:209 ../tools/virt-cat.pl:181 ../tools/virt-tar.pl:276 ../tools/virt-rescue.pl:250 ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:247
23992 msgid "SHELL QUOTING"
23996 #: ../inspector/virt-inspector.pl:879 ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:482 ../tools/virt-df.pl:609 ../tools/virt-ls.pl:230 ../tools/virt-resize.pl:1481 ../tools/virt-list-filesystems.pl:211 ../tools/virt-cat.pl:183 ../tools/virt-tar.pl:278 ../tools/virt-rescue.pl:252 ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:249
23998 "Libvirt guest names can contain arbitrary characters, some of which have "
23999 "meaning to the shell such as C<#> and space. You may need to quote or "
24000 "escape these characters on the command line. See the shell manual page "
24001 "L<sh(1)> for details."
24005 #: ../inspector/virt-inspector.pl:886 ../tools/virt-df.pl:616
24007 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
24008 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24012 #: ../inspector/virt-inspector.pl:895 ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:515 ../tools/virt-df.pl:625 ../tools/virt-ls.pl:248 ../tools/virt-resize.pl:1510 ../tools/virt-list-filesystems.pl:230 ../tools/virt-cat.pl:200 ../tools/virt-tar.pl:296 ../tools/virt-rescue.pl:269 ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:267
24013 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
24017 #: ../inspector/virt-inspector.pl:897
24018 msgid "Matthew Booth L<mbooth@redhat.com>"
24022 #: ../inspector/virt-inspector.pl:901 ../tools/virt-ls.pl:252 ../tools/virt-list-filesystems.pl:234 ../tools/virt-cat.pl:204 ../tools/virt-tar.pl:300
24023 msgid "Copyright (C) 2009 Red Hat Inc."
24027 #: ../tools/virt-edit.pl:35
24028 msgid "virt-edit - Edit a file in a virtual machine"
24032 #: ../tools/virt-edit.pl:39
24035 " virt-edit [--options] domname file\n"
24040 #: ../tools/virt-edit.pl:41
24043 " virt-edit [--options] disk.img [disk.img ...] file\n"
24048 #: ../tools/virt-edit.pl:43
24051 " virt-edit [domname|disk.img] file -e 'expr'\n"
24056 #: ../tools/virt-edit.pl:47
24058 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
24059 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
24060 "doing this, but doesn't catch all cases."
24064 #: ../tools/virt-edit.pl:53
24066 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
24067 "the named virtual machine (or disk image)."
24071 #: ../tools/virt-edit.pl:56
24073 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
24074 "you should look at the L<guestfish(1)> tool."
24078 #: ../tools/virt-edit.pl:61
24079 msgid "Edit the named files interactively:"
24083 #: ../tools/virt-edit.pl:63
24086 " virt-edit mydomain /boot/grub/grub.conf\n"
24091 #: ../tools/virt-edit.pl:65
24094 " virt-edit mydomain /etc/passwd\n"
24099 #: ../tools/virt-edit.pl:67
24101 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
24102 "below). To change the init default level to 5:"
24106 #: ../tools/virt-edit.pl:71
24109 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
24114 #: ../tools/virt-edit.pl:97
24115 msgid "B<--backup extension> | B<-b extension>"
24119 #: ../tools/virt-edit.pl:99
24121 "Create a backup of the original file I<in the guest disk image>. The backup "
24122 "has the original filename with C<extension> added."
24126 #: ../tools/virt-edit.pl:102
24128 "Usually the first character of C<extension> would be a dot C<.> so you would "
24133 #: ../tools/virt-edit.pl:105
24136 " virt-edit -b .orig [etc]\n"
24141 #: ../tools/virt-edit.pl:107
24142 msgid "By default, no backup file is made."
24146 #: ../tools/virt-edit.pl:118 ../tools/virt-win-reg.pl:209 ../tools/virt-df.pl:100 ../tools/virt-ls.pl:108 ../tools/virt-list-filesystems.pl:79 ../tools/virt-cat.pl:109 ../tools/virt-tar.pl:128 ../tools/virt-rescue.pl:140 ../tools/virt-list-partitions.pl:80
24148 "If you specify guest block devices directly, then libvirt is not used at "
24153 #: ../tools/virt-edit.pl:142
24154 msgid "B<--expr EXPR> | B<-e EXPR>"
24158 #: ../tools/virt-edit.pl:144
24160 "Instead of launching the external editor, non-interactively apply the Perl "
24161 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
24166 #: ../tools/virt-edit.pl:148
24168 "Be careful to properly quote the expression to prevent it from being altered "
24173 #: ../tools/virt-edit.pl:268
24174 msgid "NON-INTERACTIVE EDITING"
24178 #: ../tools/virt-edit.pl:270
24180 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
24181 "administrator can interactively edit the file."
24185 #: ../tools/virt-edit.pl:273
24187 "There are two ways also to use C<virt-edit> from scripts in order to make "
24188 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
24189 "like this, it's less error-prone to write scripts directly using the "
24190 "libguestfs API and Augeas for configuration file editing.)"
24194 #: ../tools/virt-edit.pl:279
24196 "The first method is to temporarily set C<$EDITOR> to any script or program "
24197 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
24198 "update C<tmpfile> in place however it likes."
24202 #: ../tools/virt-edit.pl:283
24204 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
24205 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
24206 "instances of C<foo> with C<bar> in a file:"
24210 #: ../tools/virt-edit.pl:287
24213 " virt-edit domname filename -e 's/foo/bar/'\n"
24218 #: ../tools/virt-edit.pl:289
24220 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
24221 "For example to delete root's password you could do:"
24225 #: ../tools/virt-edit.pl:292
24228 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
24233 #: ../tools/virt-edit.pl:294
24235 "What really happens is that the snippet is evaluated as a Perl expression "
24236 "for each line of the file. The line, including the final C<\\n>, is passed "
24237 "in C<$_> and the expression should update C<$_> or leave it unchanged."
24241 #: ../tools/virt-edit.pl:299
24243 "To delete a line, set C<$_> to the empty string. For example, to delete the "
24244 "C<apache> user account from the password file you can do:"
24248 #: ../tools/virt-edit.pl:302
24251 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
24256 #: ../tools/virt-edit.pl:304
24258 "To insert a line, prepend or append it to C<$_>. However appending lines to "
24259 "the end of the file is rather difficult this way since there is no concept "
24260 "of \"last line of the file\" - your expression just doesn't get called "
24261 "again. You might want to use the first method (setting C<$EDITOR>) if you "
24266 #: ../tools/virt-edit.pl:310
24268 "The variable C<$lineno> contains the current line number. As is "
24269 "traditional, the first line in the file is number C<1>."
24273 #: ../tools/virt-edit.pl:313
24275 "The return value from the expression is ignored, but the expression may call "
24276 "C<die> in order to abort the whole program, leaving the original file "
24281 #: ../tools/virt-edit.pl:317
24283 "Remember when matching the end of a line that C<$_> may contain the final "
24284 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
24285 "newline then neither of these. Thus to match or substitute some text at the "
24286 "end of a line, use this regular expression:"
24290 #: ../tools/virt-edit.pl:322
24293 " /some text(\\r?\\n)?$/\n"
24298 #: ../tools/virt-edit.pl:324
24300 "Alternately, use the perl C<chomp> function, being careful not to chomp "
24301 "C<$_> itself (since that would remove all newlines from the file):"
24305 #: ../tools/virt-edit.pl:328
24308 " my $m = $_; chomp $m; $m =~ /some text$/\n"
24313 #: ../tools/virt-edit.pl:334
24318 #: ../tools/virt-edit.pl:336
24320 "If set, this string is used as the editor. It may contain arguments, "
24321 "eg. C<\"emacs -nw\">"
24325 #: ../tools/virt-edit.pl:339
24326 msgid "If not set, C<vi> is used."
24330 #: ../tools/virt-edit.pl:352
24332 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
24333 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, "
24334 "L<perl(1)>, L<perlre(1)>."
24338 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:513 ../tools/virt-df.pl:623 ../tools/virt-ls.pl:246 ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:228 ../tools/virt-cat.pl:198 ../tools/virt-tar.pl:294 ../tools/virt-rescue.pl:267 ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:265
24343 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:629 ../tools/virt-rescue.pl:273 ../tools/virt-list-partitions.pl:271
24344 msgid "Copyright (C) 2009-2010 Red Hat Inc."
24348 #: ../tools/virt-win-reg.pl:38
24350 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
24355 #: ../tools/virt-win-reg.pl:42
24358 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
24363 #: ../tools/virt-win-reg.pl:44
24366 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
24371 #: ../tools/virt-win-reg.pl:46
24374 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
24379 #: ../tools/virt-win-reg.pl:48
24382 " virt-win-reg --merge domname [input.reg ...]\n"
24387 #: ../tools/virt-win-reg.pl:50
24390 " virt-win-reg [--options] disk.img ... # instead of domname\n"
24395 #: ../tools/virt-win-reg.pl:54
24397 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
24398 "virtual machines. If you do this, you I<will> get irreversible disk "
24399 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
24400 "but doesn't catch all cases."
24404 #: ../tools/virt-win-reg.pl:59
24406 "Modifying the Windows Registry is an inherently risky operation. The format "
24407 "is deliberately obscure and undocumented, and Registry changes can leave the "
24408 "system unbootable. Therefore when using the C<--merge> option, make sure "
24409 "you have a reliable backup first."
24413 #: ../tools/virt-win-reg.pl:66
24415 "This program can export and merge Windows Registry entries from a Windows "
24420 #: ../tools/virt-win-reg.pl:69
24422 "The first parameter is the libvirt guest name or the raw disk image of a "
24427 #: ../tools/virt-win-reg.pl:72
24429 "If C<--merge> is I<not> specified, then the chosen registry key is "
24430 "displayed/exported (recursively). For example:"
24434 #: ../tools/virt-win-reg.pl:75
24437 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
24442 #: ../tools/virt-win-reg.pl:77
24443 msgid "You can also display single values from within registry keys, for example:"
24447 #: ../tools/virt-win-reg.pl:80
24450 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
24451 " $ virt-win-reg Windows7 $cvkey ProductName\n"
24452 " Windows 7 Enterprise\n"
24457 #: ../tools/virt-win-reg.pl:84
24459 "With C<--merge>, you can merge a textual regedit file into the Windows "
24464 #: ../tools/virt-win-reg.pl:87
24467 " $ virt-win-reg --merge Windows7 changes.reg\n"
24472 #: ../tools/virt-win-reg.pl:89
24473 msgid "SUPPORTED SYSTEMS"
24477 #: ../tools/virt-win-reg.pl:91
24479 "The program currently supports Windows NT-derived guests starting with "
24480 "Windows XP through to at least Windows 7."
24484 #: ../tools/virt-win-reg.pl:94
24486 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
24487 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
24488 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
24492 #: ../tools/virt-win-reg.pl:98
24494 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
24499 #: ../tools/virt-win-reg.pl:101
24501 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
24506 #: ../tools/virt-win-reg.pl:104
24511 #: ../tools/virt-win-reg.pl:106
24513 "This program is only meant for simple access to the registry. If you want "
24514 "to do complicated things with the registry, we suggest you download the "
24515 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
24516 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
24517 "L<hivexregedit(1)>."
24521 #: ../tools/virt-win-reg.pl:112
24526 #: ../tools/virt-win-reg.pl:114
24528 "C<virt-win-reg> expects that regedit files have already been reencoded in "
24529 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
24530 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
24531 "with Windows-style line endings, you may need to reencode the whole file "
24532 "before or after processing."
24536 #: ../tools/virt-win-reg.pl:120
24538 "To reencode a file from Windows format to Linux (before processing it with "
24539 "the C<--merge> option), you would do something like this:"
24543 #: ../tools/virt-win-reg.pl:123
24546 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
24551 #: ../tools/virt-win-reg.pl:125
24553 "To go in the opposite direction, after exporting and before sending the file "
24554 "to a Windows user, do something like this:"
24558 #: ../tools/virt-win-reg.pl:128
24561 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
24566 #: ../tools/virt-win-reg.pl:130
24567 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
24571 #: ../tools/virt-win-reg.pl:132
24573 "If you are unsure about the current encoding, use the L<file(1)> command. "
24574 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
24575 "Windows-style (CRLF) line endings, like this:"
24579 #: ../tools/virt-win-reg.pl:136
24582 " $ file software.reg\n"
24583 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
24584 " with CRLF line terminators\n"
24589 #: ../tools/virt-win-reg.pl:140
24590 msgid "This file would need conversion before you could C<--merge> it."
24594 #: ../tools/virt-win-reg.pl:144
24596 "Be careful when passing parameters containing C<\\> (backslash) in the "
24597 "shell. Usually you will have to use 'single quotes' or double backslashes "
24598 "(but not both) to protect them from the shell."
24602 #: ../tools/virt-win-reg.pl:148
24603 msgid "Paths and value names are case-insensitive."
24607 #: ../tools/virt-win-reg.pl:150
24608 msgid "CurrentControlSet etc."
24612 #: ../tools/virt-win-reg.pl:152
24614 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
24615 "Registry at the level of the hive file, and therefore you cannot modify "
24620 #: ../tools/virt-win-reg.pl:156
24622 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
24623 "circumstances it might refer to another control set. The way to find out is "
24624 "to look at the C<HKLM\\SYSTEM\\Select> key:"
24628 #: ../tools/virt-win-reg.pl:160
24631 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
24632 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
24633 " \"Current\"=dword:00000001\n"
24634 " \"Default\"=dword:00000001\n"
24635 " \"Failed\"=dword:00000000\n"
24636 " \"LastKnownGood\"=dword:00000002\n"
24641 #: ../tools/virt-win-reg.pl:167
24642 msgid "\"Default\" is the one which Windows will choose when it boots."
24646 #: ../tools/virt-win-reg.pl:169
24647 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
24651 #: ../tools/virt-win-reg.pl:196 ../tools/virt-make-fs.pl:177
24656 #: ../tools/virt-win-reg.pl:198 ../tools/virt-resize.pl:501
24657 msgid "Enable debugging messages."
24661 #: ../tools/virt-win-reg.pl:233
24666 #: ../tools/virt-win-reg.pl:235
24668 "In merge mode, this merges a textual regedit file into the Windows Registry "
24669 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
24670 "displays or exports Registry entries instead."
24674 #: ../tools/virt-win-reg.pl:239
24676 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
24677 "result in disk corruption. However exporting (without this flag) is always "
24682 #: ../tools/virt-win-reg.pl:247
24683 msgid "B<--encoding> UTF-16LE|ASCII"
24687 #: ../tools/virt-win-reg.pl:249
24689 "When merging (only), you may need to specify the encoding for strings to be "
24690 "used in the hive file. This is explained in detail in "
24691 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
24695 #: ../tools/virt-win-reg.pl:253
24697 "The default is to use UTF-16LE, which should work with recent versions of "
24702 #: ../tools/virt-win-reg.pl:489
24704 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
24705 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
24706 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
24707 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24711 #: ../tools/virt-win-reg.pl:504 ../tools/virt-make-fs.pl:550
24713 "When reporting bugs, please enable debugging and capture the I<complete> "
24718 #: ../tools/virt-win-reg.pl:507
24721 " export LIBGUESTFS_DEBUG=1\n"
24722 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
24727 #: ../tools/virt-win-reg.pl:510
24729 "Attach /tmp/virt-win-reg.log to a new bug report at "
24730 "L<https://bugzilla.redhat.com/>"
24734 #: ../tools/virt-win-reg.pl:519 ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
24735 msgid "Copyright (C) 2010 Red Hat Inc."
24739 #: ../tools/virt-df.pl:36
24740 msgid "virt-df - Display free space on virtual filesystems"
24744 #: ../tools/virt-df.pl:40
24747 " virt-df [--options]\n"
24752 #: ../tools/virt-df.pl:42
24755 " virt-df [--options] domname\n"
24760 #: ../tools/virt-df.pl:44
24763 " virt-df [--options] disk.img [disk.img ...]\n"
24768 #: ../tools/virt-df.pl:48
24770 "C<virt-df> is a command line tool to display free space on virtual machine "
24771 "filesystems. Unlike other tools, it doesn't just display the amount of "
24772 "space allocated to a virtual machine, but can look inside the virtual "
24773 "machine to see how much space is really being used."
24777 #: ../tools/virt-df.pl:53
24779 "It is like the L<df(1)> command, but for virtual machines, except that it "
24780 "also works for Windows virtual machines."
24784 #: ../tools/virt-df.pl:56
24786 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
24787 "of all active and inactive guests, and performs a C<df>-type operation on "
24788 "each one in turn, printing out the results."
24792 #: ../tools/virt-df.pl:60
24794 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
24795 "either the single named libvirt domain, or on the disk image(s) listed on "
24796 "the command line (which must all belong to a single VM). In this mode (with "
24797 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
24798 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
24802 #: ../tools/virt-df.pl:67
24804 "Use the C<--csv> option to get a format which can be easily parsed by other "
24805 "programs. Other options are mostly similar to standard C<df> options. See "
24806 "below for the complete list."
24810 #: ../tools/virt-df.pl:107
24815 #: ../tools/virt-df.pl:109
24817 "Write out the results in CSV format (comma-separated values). This format "
24818 "can be imported easily into databases and spreadsheets, but read L</NOTE "
24819 "ABOUT CSV FORMAT> below."
24823 #: ../tools/virt-df.pl:134
24824 msgid "B<--human-readable> | B<-h>"
24828 #: ../tools/virt-df.pl:136
24829 msgid "Print sizes in human-readable format."
24833 #: ../tools/virt-df.pl:138
24834 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
24838 #: ../tools/virt-df.pl:144
24839 msgid "B<--inodes> | B<-i>"
24843 #: ../tools/virt-df.pl:146
24844 msgid "Print inodes instead of blocks."
24848 #: ../tools/virt-df.pl:152
24849 msgid "B<--one-per-guest>"
24853 #: ../tools/virt-df.pl:154
24855 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
24856 "disks from several guests to a single libguestfs appliance."
24860 #: ../tools/virt-df.pl:157
24861 msgid "You might use this option in the following circumstances:"
24865 #: ../tools/virt-df.pl:163
24867 "If you think an untrusted guest might actively try to exploit the libguestfs "
24868 "appliance kernel, then this prevents one guest from interfering with the "
24869 "stats printed for another guest."
24873 #: ../tools/virt-df.pl:169
24875 "If the kernel has a bug which stops it from accessing a filesystem in one "
24876 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
24877 "and report stats for further guests."
24881 #: ../tools/virt-df.pl:583
24882 msgid "NOTE ABOUT CSV FORMAT"
24886 #: ../tools/virt-df.pl:585
24888 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
24889 "should be easy to parse, but it is definitely not easy to parse."
24893 #: ../tools/virt-df.pl:588
24895 "Myth: Just split fields at commas. Reality: This does I<not> work "
24896 "reliably. This example has two columns:"
24900 #: ../tools/virt-df.pl:591
24903 " \"foo,bar\",baz\n"
24908 #: ../tools/virt-df.pl:593
24910 "Myth: Read the file one line at a time. Reality: This does I<not> work "
24911 "reliably. This example has one row:"
24915 #: ../tools/virt-df.pl:596
24924 #: ../tools/virt-df.pl:599
24926 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
24927 "packaged in major Linux distributions)."
24931 #: ../tools/virt-df.pl:602
24933 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
24934 "or Python's built-in csv library)."
24938 #: ../tools/virt-df.pl:605
24939 msgid "Most spreadsheets and databases can import CSV directly."
24943 #: ../tools/virt-ls.pl:35
24944 msgid "virt-ls - List files in a virtual machine"
24948 #: ../tools/virt-ls.pl:39
24951 " virt-ls [--options] domname directory\n"
24956 #: ../tools/virt-ls.pl:41
24959 " virt-ls [--options] disk.img [disk.img ...] directory\n"
24964 #: ../tools/virt-ls.pl:45
24966 "C<virt-ls> is a command line tool to list the names of files in a directory "
24967 "inside a virtual machine or disk image."
24971 #: ../tools/virt-ls.pl:48
24973 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
24974 "For more complex cases you should look at the L<guestfish(1)> tool."
24978 #: ../tools/virt-ls.pl:52
24980 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
24981 "simple listing is like the ordinary L<ls(1)> command:"
24985 #: ../tools/virt-ls.pl:55
24988 " $ virt-ls myguest /\n"
24996 #: ../tools/virt-ls.pl:60
24997 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
25001 #: ../tools/virt-ls.pl:62
25004 " $ virt-ls -l myguest /\n"
25006 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
25007 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
25013 #: ../tools/virt-ls.pl:68
25015 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
25016 "and directories recursively:"
25020 #: ../tools/virt-ls.pl:71
25023 " $ virt-ls -R myguest /tmp\n"
25031 #: ../tools/virt-ls.pl:76
25033 "You I<cannot> combine these options. To do more complicated things, use "
25038 #: ../tools/virt-ls.pl:132 ../tools/virt-list-filesystems.pl:103 ../tools/virt-list-partitions.pl:112
25039 msgid "B<-l> | B<--long>"
25043 #: ../tools/virt-ls.pl:134
25044 msgid "B<-R> | B<--recursive>"
25048 #: ../tools/virt-ls.pl:136
25050 "Select the mode. With neither of these options, C<virt-ls> produces a "
25051 "simple, flat list of the files in the named directory."
25055 #: ../tools/virt-ls.pl:139
25057 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
25058 "like the plain C<ls -l> command)."
25062 #: ../tools/virt-ls.pl:142
25064 "C<virt-ls -R> produces a recursive list of files starting at the named "
25065 "directory. See the documentation for the C<guestfs_find> command "
25066 "L<guestfs(3)> for precise details."
25070 #: ../tools/virt-ls.pl:146
25071 msgid "You cannot combine these options."
25075 #: ../tools/virt-ls.pl:237
25077 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
25078 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
25079 "L<http://libguestfs.org/>."
25083 #: ../tools/virt-resize.pl:42
25084 msgid "virt-resize - Resize a virtual machine disk"
25088 #: ../tools/virt-resize.pl:46
25091 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
25092 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
25093 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
25098 #: ../tools/virt-resize.pl:52
25100 "Virt-resize is a tool which can resize a virtual machine disk, making it "
25101 "larger or smaller overall, and resizing or deleting any partitions contained "
25106 #: ../tools/virt-resize.pl:56
25108 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
25109 "not> be used on live virtual machines - for consistent results, shut the "
25110 "virtual machine down before resizing it."
25114 #: ../tools/virt-resize.pl:60
25116 "If you are not familiar with the associated tools: "
25117 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)> and L<virt-df(1)>, "
25118 "we recommend you go and read those manual pages first."
25122 #: ../tools/virt-resize.pl:68
25124 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
25125 "fill the extra 5GB of space."
25129 #: ../tools/virt-resize.pl:71
25132 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
25133 " virt-list-partitions -lht olddisk\n"
25134 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
25135 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
25140 #: ../tools/virt-resize.pl:76
25142 "As above, but make the /boot partition 200MB bigger, while giving the "
25143 "remaining space to /dev/sda2:"
25147 #: ../tools/virt-resize.pl:79
25150 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
25155 #: ../tools/virt-resize.pl:81
25156 msgid "As above, but the output format will be uncompressed qcow2:"
25160 #: ../tools/virt-resize.pl:83
25163 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
25164 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
25169 #: ../tools/virt-resize.pl:86
25170 msgid "DETAILED USAGE"
25174 #: ../tools/virt-resize.pl:88
25175 msgid "EXPANDING A VIRTUAL MACHINE DISK"
25179 #: ../tools/virt-resize.pl:92
25180 msgid "1. Shut down the virtual machine"
25184 #: ../tools/virt-resize.pl:94
25185 msgid "2. Locate input disk image"
25189 #: ../tools/virt-resize.pl:96
25191 "Locate the input disk image (ie. the file or device on the host containing "
25192 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
25193 "dumpxml> like this to find the disk image name:"
25197 #: ../tools/virt-resize.pl:100
25200 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
25201 " Found 1 nodes:\n"
25203 " <source dev=\"/dev/vg/lv_guest\" />\n"
25208 #: ../tools/virt-resize.pl:105
25209 msgid "3. Look at current sizing"
25213 #: ../tools/virt-resize.pl:107
25214 msgid "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
25218 #: ../tools/virt-resize.pl:110
25221 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
25222 " /dev/sda1 ext3 101.9M\n"
25223 " /dev/sda2 pv 7.9G\n"
25224 " /dev/sda device 8.0G\n"
25229 #: ../tools/virt-resize.pl:115
25231 "(This example is a virtual machine with an 8 GB disk which we would like to "
25232 "expand up to 10 GB)."
25236 #: ../tools/virt-resize.pl:118
25237 msgid "4. Create output disk"
25241 #: ../tools/virt-resize.pl:120
25243 "Virt-resize cannot do in-place disk modifications. You have to have space "
25244 "to store the resized output disk."
25248 #: ../tools/virt-resize.pl:123
25249 msgid "To store the resized disk image in a file, create a file of a suitable size:"
25253 #: ../tools/virt-resize.pl:126
25256 " # rm -f outdisk\n"
25257 " # truncate -s 10G outdisk\n"
25262 #: ../tools/virt-resize.pl:129
25263 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25267 #: ../tools/virt-resize.pl:131
25270 " # lvcreate -L 10G -n lv_name vg_name\n"
25275 #: ../tools/virt-resize.pl:133
25276 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25280 #: ../tools/virt-resize.pl:135
25283 " # virsh pool-list\n"
25284 " # virsh vol-create-as poolname newvol 10G\n"
25289 #: ../tools/virt-resize.pl:138
25294 #: ../tools/virt-resize.pl:140
25296 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25297 "file) and the output disk. The output disk is the one created in the "
25302 #: ../tools/virt-resize.pl:144
25305 " # virt-resize indisk outdisk\n"
25310 #: ../tools/virt-resize.pl:146
25312 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25313 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25314 "larger, then an extra, empty partition is created at the end of the disk "
25315 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25320 #: ../tools/virt-resize.pl:152
25322 "More realistically you'd want to expand existing partitions in the disk "
25323 "image by passing extra options (for the full list see the L</OPTIONS> "
25328 #: ../tools/virt-resize.pl:156
25330 "L</--expand> is the most useful option. It expands the named partition "
25331 "within the disk to fill any extra space:"
25335 #: ../tools/virt-resize.pl:159
25338 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25343 #: ../tools/virt-resize.pl:161
25345 "(In this case, an extra partition is I<not> created at the end of the disk, "
25346 "because there will be no unused space)."
25350 #: ../tools/virt-resize.pl:164
25352 "L</--resize> is the other commonly used option. The following would "
25353 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25354 "rest of the available space:"
25358 #: ../tools/virt-resize.pl:168
25361 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25362 " indisk outdisk\n"
25367 #: ../tools/virt-resize.pl:171
25369 "If the expanded partition in the image contains a filesystem or LVM PV, then "
25370 "if virt-resize knows how, it will resize the contents, the equivalent of "
25371 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or "
25372 "L<ntfsresize(8)>. However virt-resize does not know how to resize some "
25373 "filesystems, so you would have to online resize them after booting the "
25374 "guest. And virt-resize also does not resize anything inside an LVM PV, it "
25375 "just resizes the PV itself and leaves the user to resize any LVs inside that "
25380 #: ../tools/virt-resize.pl:180
25381 msgid "Other options are covered below."
25385 #: ../tools/virt-resize.pl:182
25390 #: ../tools/virt-resize.pl:184
25391 msgid "Thoroughly test the new disk image I<before> discarding the old one."
25395 #: ../tools/virt-resize.pl:186
25396 msgid "If you are using libvirt, edit the XML to point at the new disk:"
25400 #: ../tools/virt-resize.pl:188
25403 " # virsh edit guestname\n"
25408 #: ../tools/virt-resize.pl:190
25410 "Change E<lt>source ...E<gt>, see "
25411 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
25415 #: ../tools/virt-resize.pl:193
25416 msgid "Then start up the domain with the new, resized disk:"
25420 #: ../tools/virt-resize.pl:195
25423 " # virsh start guestname\n"
25428 #: ../tools/virt-resize.pl:197
25430 "and check that it still works. See also the L</NOTES> section below for "
25431 "additional information."
25435 #: ../tools/virt-resize.pl:200
25436 msgid "7. Resize LVs etc inside the guest"
25440 #: ../tools/virt-resize.pl:202
25441 msgid "(This can also be done offline using L<guestfish(1)>)"
25445 #: ../tools/virt-resize.pl:204
25447 "Once the guest has booted you should see the new space available, at least "
25448 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
25449 "may need to resize LVs inside PVs, and also resize filesystem types that "
25450 "virt-resize does not know how to expand."
25454 #: ../tools/virt-resize.pl:211
25455 msgid "SHRINKING A VIRTUAL MACHINE DISK"
25459 #: ../tools/virt-resize.pl:213
25461 "Shrinking is somewhat more complex than expanding, and only an overview is "
25466 #: ../tools/virt-resize.pl:216
25468 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
25469 "filesystems). The user has to shrink content before passing the disk image "
25470 "to virt-resize, and virt-resize will check that the content has been shrunk "
25475 #: ../tools/virt-resize.pl:221
25476 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
25480 #: ../tools/virt-resize.pl:223
25482 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
25483 "steps 3 and 4 above to allocate a new disk image."
25487 #: ../tools/virt-resize.pl:226
25488 msgid "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
25492 #: ../tools/virt-resize.pl:229
25493 msgid "IGNORING OR DELETING PARTITIONS"
25497 #: ../tools/virt-resize.pl:231
25499 "virt-resize also gives a convenient way to ignore or delete partitions when "
25500 "copying from the input disk to the output disk. Ignoring a partition speeds "
25501 "up the copy where you don't care about the existing contents of a "
25502 "partition. Deleting a partition removes it completely, but note that it "
25503 "also renumbers any partitions after the one which is deleted, which can "
25504 "leave some guests unbootable."
25508 #: ../tools/virt-resize.pl:238
25509 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
25513 #: ../tools/virt-resize.pl:240
25515 "If the input disk is in qcow2 format, then you may prefer that the output is "
25516 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
25517 "the fly. The output format is simply determined by the format of the empty "
25518 "output container that you provide. Thus to create qcow2 output, use:"
25522 #: ../tools/virt-resize.pl:246
25525 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
25530 #: ../tools/virt-resize.pl:248
25531 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
25535 #: ../tools/virt-resize.pl:250
25536 msgid "Similarly, to get non-sparse raw output use:"
25540 #: ../tools/virt-resize.pl:252
25543 " fallocate -l size outdisk\n"
25548 #: ../tools/virt-resize.pl:254
25550 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
25551 "if=/dev/zero of=outdisk bs=1M count=..>)"
25555 #: ../tools/virt-resize.pl:267
25556 msgid "Display help."
25560 #: ../tools/virt-resize.pl:281
25561 msgid "B<--resize part=size>"
25565 #: ../tools/virt-resize.pl:283
25567 "Resize the named partition (expanding or shrinking it) so that it has the "
25572 #: ../tools/virt-resize.pl:286
25574 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
25575 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
25576 "Exabytes; or as a percentage of the current size; or as a relative number or "
25577 "percentage. For example:"
25581 #: ../tools/virt-resize.pl:291
25584 " --resize /dev/sda2=10G\n"
25589 #: ../tools/virt-resize.pl:293
25592 " --resize /dev/sda4=90%\n"
25597 #: ../tools/virt-resize.pl:295
25600 " --resize /dev/sda2=+1G\n"
25605 #: ../tools/virt-resize.pl:297
25608 " --resize /dev/sda2=-200M\n"
25613 #: ../tools/virt-resize.pl:299
25616 " --resize /dev/sda1=+128K\n"
25621 #: ../tools/virt-resize.pl:301
25624 " --resize /dev/sda1=+10%\n"
25629 #: ../tools/virt-resize.pl:303
25632 " --resize /dev/sda1=-10%\n"
25637 #: ../tools/virt-resize.pl:305
25639 "You can increase the size of any partition. Virt-resize will expand the "
25640 "direct content of the partition if it knows how (see C<--expand> below)."
25644 #: ../tools/virt-resize.pl:309
25646 "You can only I<decrease> the size of partitions that contain filesystems or "
25647 "PVs which have already been shrunk. Virt-resize will check this has been "
25648 "done before proceeding, or else will print an error (see also "
25649 "C<--resize-force>)."
25653 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406 ../tools/virt-resize.pl:423
25654 msgid "You can give this option multiple times."
25658 #: ../tools/virt-resize.pl:320
25659 msgid "B<--resize-force part=size>"
25663 #: ../tools/virt-resize.pl:322
25665 "This is the same as C<--resize> except that it will let you decrease the "
25666 "size of any partition. Generally this means you will lose any data which "
25667 "was at the end of the partition you shrink, but you may not care about that "
25668 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25669 "as a swap partition)."
25673 #: ../tools/virt-resize.pl:328
25674 msgid "See also the C<--ignore> option."
25678 #: ../tools/virt-resize.pl:334
25679 msgid "B<--expand part>"
25683 #: ../tools/virt-resize.pl:336
25685 "Expand the named partition so it uses up all extra space (space left over "
25686 "after any other resize changes that you request have been done)."
25690 #: ../tools/virt-resize.pl:339
25692 "If virt-resize knows how, it will expand the direct content of the "
25693 "partition. For example, if the partition is an LVM PV, it will expand the "
25694 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
25695 "content it doesn't know about alone."
25699 #: ../tools/virt-resize.pl:344
25700 msgid "Currently virt-resize can resize:"
25704 #: ../tools/virt-resize.pl:350
25706 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
25711 #: ../tools/virt-resize.pl:355
25713 "NTFS filesystems contained directly in a partition, if libguestfs was "
25714 "compiled with support for NTFS."
25718 #: ../tools/virt-resize.pl:358
25720 "The filesystem must have been shut down consistently last time it was used. "
25721 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
25722 "consistency check, so at the first boot after resizing Windows will check "
25727 #: ../tools/virt-resize.pl:365
25729 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
25730 "inside the PV. The user will have to resize LVs as desired."
25734 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
25735 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
25739 #: ../tools/virt-resize.pl:377
25740 msgid "B<--shrink part>"
25744 #: ../tools/virt-resize.pl:379
25746 "Shrink the named partition until the overall disk image fits in the "
25747 "destination. The named partition B<must> contain a filesystem or PV which "
25748 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25749 "online tools). Virt-resize will check this and give an error if it has not "
25754 #: ../tools/virt-resize.pl:385
25756 "The amount by which the overall disk must be shrunk (after carrying out all "
25757 "other operations requested by the user) is called the \"deficit\". For "
25758 "example, a straight copy (assume no other operations) from a 5GB disk image "
25759 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25760 "would give an error unless the user specified a partition to shrink and that "
25761 "partition had more than a gigabyte of free space."
25765 #: ../tools/virt-resize.pl:399
25766 msgid "B<--ignore part>"
25770 #: ../tools/virt-resize.pl:401
25772 "Ignore the named partition. Effectively this means the partition is "
25773 "allocated on the destination disk, but the content is not copied across from "
25774 "the source disk. The content of the partition will be blank (all zero "
25779 #: ../tools/virt-resize.pl:412
25780 msgid "B<--delete part>"
25784 #: ../tools/virt-resize.pl:414
25786 "Delete the named partition. It would be more accurate to describe this as "
25787 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
25788 "the original disk image is left intact."
25792 #: ../tools/virt-resize.pl:418
25794 "Note that when you delete a partition, then anything contained in the "
25795 "partition is also deleted. Furthermore, this causes any partitions that "
25796 "come after to be I<renumbered>, which can easily make your guest unbootable."
25800 #: ../tools/virt-resize.pl:429
25801 msgid "B<--LV-expand logvol>"
25805 #: ../tools/virt-resize.pl:431
25807 "This takes the logical volume and, as a final step, expands it to fill all "
25808 "the space available in its volume group. A typical usage, assuming a Linux "
25809 "guest with a single PV C</dev/sda2> and a root device called "
25810 "C</dev/vg_guest/lv_root> would be:"
25814 #: ../tools/virt-resize.pl:436
25817 " virt-resize indisk outdisk \\\n"
25818 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
25823 #: ../tools/virt-resize.pl:439
25825 "This would first expand the partition (and PV), and then expand the root "
25826 "device to fill the extra space in the PV."
25830 #: ../tools/virt-resize.pl:442
25832 "The contents of the LV are also resized if virt-resize knows how to do "
25833 "that. You can stop virt-resize from trying to expand the content by using "
25834 "the option C<--no-expand-content>."
25838 #: ../tools/virt-resize.pl:446
25839 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
25843 #: ../tools/virt-resize.pl:449
25845 "You can give this option multiple times, I<but> it doesn't make sense to do "
25846 "this unless the logical volumes you specify are all in different volume "
25851 #: ../tools/virt-resize.pl:457
25852 msgid "B<--no-copy-boot-loader>"
25856 #: ../tools/virt-resize.pl:459
25858 "By default, virt-resize copies over some sectors at the start of the disk "
25859 "(up to the beginning of the first partition). Commonly these sectors "
25860 "contain the Master Boot Record (MBR) and the boot loader, and are required "
25861 "in order for the guest to boot correctly."
25865 #: ../tools/virt-resize.pl:464
25867 "If you specify this flag, then this initial copy is not done. You may need "
25868 "to reinstall the boot loader in this case."
25872 #: ../tools/virt-resize.pl:472
25873 msgid "B<--no-extra-partition>"
25877 #: ../tools/virt-resize.pl:474
25879 "By default, virt-resize creates an extra partition if there is any extra, "
25880 "unused space after all resizing has happened. Use this option to prevent "
25881 "the extra partition from being created. If you do this then the extra space "
25882 "will be inaccessible until you run fdisk, parted, or some other partitioning "
25883 "tool in the guest."
25887 #: ../tools/virt-resize.pl:480
25889 "Note that if the surplus space is smaller than 10 MB, no extra partition "
25894 #: ../tools/virt-resize.pl:487
25895 msgid "B<--no-expand-content>"
25899 #: ../tools/virt-resize.pl:489
25901 "By default, virt-resize will try to expand the direct contents of "
25902 "partitions, if it knows how (see C<--expand> option above)."
25906 #: ../tools/virt-resize.pl:492
25908 "If you give the C<--no-expand-content> option then virt-resize will not "
25913 #: ../tools/virt-resize.pl:499
25914 msgid "B<-d> | B<--debug>"
25918 #: ../tools/virt-resize.pl:507
25919 msgid "B<-n> | B<--dryrun>"
25923 #: ../tools/virt-resize.pl:509
25924 msgid "Print a summary of what would be done, but don't do anything."
25928 #: ../tools/virt-resize.pl:515
25929 msgid "B<-q> | B<--quiet>"
25933 #: ../tools/virt-resize.pl:517
25934 msgid "Don't print the summary."
25938 #: ../tools/virt-resize.pl:525
25940 "Specify the format of the input disk image. If this flag is not given then "
25941 "it is auto-detected from the image itself."
25945 #: ../tools/virt-resize.pl:531
25947 "Note that this option I<does not> affect the output format. See L</QCOW2 "
25948 "AND NON-SPARSE RAW FORMATS>."
25952 #: ../tools/virt-resize.pl:538
25953 msgid "B<--output-format> raw"
25957 #: ../tools/virt-resize.pl:540
25959 "Specify the format of the output disk image. If this flag is not given then "
25960 "it is auto-detected from the image itself."
25964 #: ../tools/virt-resize.pl:546
25966 "Note that you still need to create the output disk with the right format. "
25967 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
25971 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
25976 #: ../tools/virt-resize.pl:1424
25977 msgid "\"Partition 1 does not end on cylinder boundary.\""
25981 #: ../tools/virt-resize.pl:1426
25983 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
25984 "means the partitions will not be aligned to the ancient CHS geometry. "
25985 "However CHS geometry is meaningless for disks manufactured since the early "
25986 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
25987 "cylinders is not required by any modern operating system."
25991 #: ../tools/virt-resize.pl:1433
25992 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25996 #: ../tools/virt-resize.pl:1435
25998 "In Windows Vista and later versions, Microsoft switched to using a separate "
25999 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
26000 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
26001 "the boot partition. Doing so seems to break the guest completely. However "
26002 "expanding the second partition (ie. C: drive) should work."
26006 #: ../tools/virt-resize.pl:1442
26008 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
26009 "NTFS partitions have been expanded. This is just a safety check and (unless "
26010 "it find errors) is nothing to worry about."
26014 #: ../tools/virt-resize.pl:1446
26015 msgid "GUEST BOOT STUCK AT \"GRUB\""
26019 #: ../tools/virt-resize.pl:1448
26021 "If a Linux guest does not boot after resizing, and the boot is stuck after "
26022 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
26023 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
26024 "although we think is to do with partition alignment."
26028 #: ../tools/virt-resize.pl:1453
26031 " guestfish -i -a newdisk\n"
26032 " ><fs> cat /boot/grub/device.map\n"
26033 " # check the contents of this file are sensible or\n"
26034 " # edit the file if necessary\n"
26035 " ><fs> grub-install / /dev/vda\n"
26041 #: ../tools/virt-resize.pl:1460
26043 "For more flexible guest reconfiguration, including if you need to specify "
26044 "other parameters to grub-install, use L<virt-rescue(1)>."
26048 #: ../tools/virt-resize.pl:1463
26049 msgid "ALTERNATIVE TOOLS"
26053 #: ../tools/virt-resize.pl:1465
26055 "There are several proprietary tools for resizing partitions. We won't "
26056 "mention any here."
26060 #: ../tools/virt-resize.pl:1468
26062 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
26063 "operations on disk images. They can resize and move partitions, but I don't "
26064 "think they can do anything with the contents, and they certainly don't "
26069 #: ../tools/virt-resize.pl:1473
26071 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
26072 "but at a much lower level. You will probably end up hand-calculating sector "
26073 "offsets, which is something that virt-resize was designed to avoid. If you "
26074 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
26079 #: ../tools/virt-resize.pl:1488
26081 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
26082 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
26083 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, "
26084 "L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, "
26085 "L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
26089 #: ../tools/virt-list-filesystems.pl:32
26090 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
26094 #: ../tools/virt-list-filesystems.pl:36
26097 " virt-list-filesystems [--options] domname\n"
26102 #: ../tools/virt-list-filesystems.pl:38
26105 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
26110 #: ../tools/virt-list-filesystems.pl:42
26112 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
26113 "are contained in a virtual machine or disk image."
26117 #: ../tools/virt-list-filesystems.pl:46
26119 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
26120 "functionality. For more complex cases you should look at the "
26121 "L<guestfish(1)> tool."
26125 #: ../tools/virt-list-filesystems.pl:105
26127 "With this option, C<virt-list-filesystems> displays the type of each "
26128 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
26132 #: ../tools/virt-list-filesystems.pl:112
26133 msgid "B<-a> | B<--all>"
26137 #: ../tools/virt-list-filesystems.pl:114
26139 "Normally we only show mountable filesystems. If this option is given then "
26140 "swap devices are shown too."
26144 #: ../tools/virt-list-filesystems.pl:218
26146 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
26147 "L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
26148 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26152 #: ../tools/virt-cat.pl:34
26153 msgid "virt-cat - Display a file in a virtual machine"
26157 #: ../tools/virt-cat.pl:38
26160 " virt-cat [--options] domname file\n"
26165 #: ../tools/virt-cat.pl:40
26168 " virt-cat [--options] disk.img [disk.img ...] file\n"
26173 #: ../tools/virt-cat.pl:44
26175 "C<virt-cat> is a command line tool to display the contents of C<file> where "
26176 "C<file> exists in the named virtual machine (or disk image)."
26180 #: ../tools/virt-cat.pl:47
26182 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
26183 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
26188 #: ../tools/virt-cat.pl:53
26189 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
26193 #: ../tools/virt-cat.pl:56
26196 " virt-cat mydomain /etc/fstab\n"
26201 #: ../tools/virt-cat.pl:58
26202 msgid "List syslog messages from a VM:"
26206 #: ../tools/virt-cat.pl:60
26209 " virt-cat mydomain /var/log/messages | tail\n"
26214 #: ../tools/virt-cat.pl:62
26215 msgid "Find out what DHCP IP address a VM acquired:"
26219 #: ../tools/virt-cat.pl:64
26222 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
26227 #: ../tools/virt-cat.pl:66
26228 msgid "Find out what packages were recently installed:"
26232 #: ../tools/virt-cat.pl:68
26235 " virt-cat mydomain /var/log/yum.log | tail\n"
26240 #: ../tools/virt-cat.pl:70
26241 msgid "Find out who is logged on inside a virtual machine:"
26245 #: ../tools/virt-cat.pl:72
26248 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
26254 #: ../tools/virt-cat.pl:75
26255 msgid "or who was logged on:"
26259 #: ../tools/virt-cat.pl:77
26262 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
26263 " last -f /tmp/wtmp\n"
26268 #: ../tools/virt-cat.pl:190
26270 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, "
26271 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26275 #: ../tools/virt-tar.pl:34
26276 msgid "virt-tar - Extract or upload files to a virtual machine"
26280 #: ../tools/virt-tar.pl:38
26283 " virt-tar [--options] -x domname directory tarball\n"
26288 #: ../tools/virt-tar.pl:40
26291 " virt-tar [--options] -u domname tarball directory\n"
26296 #: ../tools/virt-tar.pl:42
26299 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
26304 #: ../tools/virt-tar.pl:44
26307 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
26312 #: ../tools/virt-tar.pl:48
26313 msgid "Download C</home> from the VM into a local tarball:"
26317 #: ../tools/virt-tar.pl:50
26320 " virt-tar -x domname /home home.tar\n"
26325 #: ../tools/virt-tar.pl:52
26328 " virt-tar -zx domname /home home.tar.gz\n"
26333 #: ../tools/virt-tar.pl:54
26334 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
26338 #: ../tools/virt-tar.pl:56
26341 " virt-tar -u domname uploadstuff.tar /tmp\n"
26346 #: ../tools/virt-tar.pl:58
26349 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
26354 #: ../tools/virt-tar.pl:62
26356 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
26357 "virtual machines. If you do this, you risk disk corruption in the VM. "
26358 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
26362 #: ../tools/virt-tar.pl:67
26364 "You can use C<-x> (extract) on live virtual machines, but you might get "
26365 "inconsistent results or errors if there is filesystem activity inside the "
26366 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
26367 "work, but the only way to guarantee consistent results is if the virtual "
26368 "machine is shut down."
26372 #: ../tools/virt-tar.pl:75
26374 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
26375 "parts of a guest filesystem. There are many possibilities: making backups, "
26376 "uploading data files, snooping on guest activity, fixing or customizing "
26381 #: ../tools/virt-tar.pl:80
26383 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
26384 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
26385 "should look at the L<guestfish(1)> tool."
26389 #: ../tools/virt-tar.pl:84
26391 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
26392 "its contents (recursively) from the virtual machine into a local tarball. "
26393 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
26394 "virtual machine. You cannot use these two options together."
26398 #: ../tools/virt-tar.pl:90
26400 "In addition, you may need to use the C<-z> (gZip) option to enable "
26401 "compression. When uploading, you have to specify C<-z> if the upload file "
26402 "is compressed because virt-tar won't detect this on its own."
26406 #: ../tools/virt-tar.pl:94
26408 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
26409 "example it cannot do PKZip files or bzip2 compression. If you want that "
26410 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
26411 "the L<libguestfs(3)> API)."
26415 #: ../tools/virt-tar.pl:152
26416 msgid "B<-x> | B<--extract> | B<--download>"
26420 #: ../tools/virt-tar.pl:154
26421 msgid "B<-u> | B<--upload>"
26425 #: ../tools/virt-tar.pl:156
26427 "Use C<-x> to extract (download) a directory from a virtual machine to a "
26432 #: ../tools/virt-tar.pl:159
26434 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
26435 "Please read the L</WARNING> section above before using this option."
26439 #: ../tools/virt-tar.pl:163
26440 msgid "You must specify exactly one of these options."
26444 #: ../tools/virt-tar.pl:169
26445 msgid "B<-z> | B<--gzip>"
26449 #: ../tools/virt-tar.pl:171
26450 msgid "Specify that the input or output tarball is gzip-compressed."
26454 #: ../tools/virt-tar.pl:285
26456 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26457 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
26458 "L<http://libguestfs.org/>."
26462 #: ../tools/virt-rescue.pl:33
26463 msgid "virt-rescue - Run a rescue shell on a virtual machine"
26467 #: ../tools/virt-rescue.pl:37
26470 " virt-rescue [--options] domname\n"
26475 #: ../tools/virt-rescue.pl:39
26478 " virt-rescue [--options] disk.img [disk.img ...]\n"
26483 #: ../tools/virt-rescue.pl:43
26485 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
26486 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
26487 "you from doing this, but doesn't catch all cases."
26491 #: ../tools/virt-rescue.pl:47
26493 "However if you use the I<--ro> (read only) option, then you can attach a "
26494 "shell to a live virtual machine. The results might be strange or "
26495 "inconsistent at times but you won't get disk corruption."
26499 #: ../tools/virt-rescue.pl:53
26501 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
26502 "need for a CD. virt-rescue gives you a rescue shell and some simple "
26503 "recovery tools which you can use to examine or rescue a virtual machine or "
26508 #: ../tools/virt-rescue.pl:58
26510 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
26511 "on disk image(s):"
26515 #: ../tools/virt-rescue.pl:61
26518 " virt-rescue GuestName\n"
26523 #: ../tools/virt-rescue.pl:63
26526 " virt-rescue --ro /path/to/disk.img\n"
26531 #: ../tools/virt-rescue.pl:65
26534 " virt-rescue /dev/sdc\n"
26539 #: ../tools/virt-rescue.pl:67
26540 msgid "For live VMs you I<must> use the --ro option."
26544 #: ../tools/virt-rescue.pl:69
26546 "When you run virt-rescue on a virtual machine or disk image, you are placed "
26547 "in an interactive bash shell where you can use many ordinary Linux "
26548 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
26549 "appliance. You must mount the virtual machine's filesystems by hand. There "
26550 "is an empty directory called C</sysroot> where you can mount filesystems."
26554 #: ../tools/virt-rescue.pl:76
26556 "In the example below, we list logical volumes, then choose one to mount "
26557 "under C</sysroot>:"
26561 #: ../tools/virt-rescue.pl:79
26565 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
26566 " lv_root vg_f11x64 -wi-a- 8.83G\n"
26567 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
26568 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
26569 " ><rescue> ls /sysroot\n"
26574 #: ../tools/virt-rescue.pl:86
26576 "If you don't know what filesystems are available on the virtual machine then "
26577 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
26581 #: ../tools/virt-rescue.pl:92
26583 "Virt-rescue can be used on I<any> disk image file or device, not just a "
26584 "virtual machine. For example you can use it on a blank file if you want to "
26585 "partition that file (although we would recommend using L<guestfish(1)> "
26586 "instead as it is more suitable for this purpose). You can even use "
26587 "virt-rescue on things like SD cards."
26591 #: ../tools/virt-rescue.pl:98
26593 "This tool is just designed for quick interactive hacking on a virtual "
26594 "machine. For more structured access to a virtual machine disk image, you "
26595 "should use L<guestfs(3)>. To get a structured shell that you can use to "
26596 "make scripted changes to guests, use L<guestfish(1)>."
26600 #: ../tools/virt-rescue.pl:127
26601 msgid "B<--append kernelopts>"
26605 #: ../tools/virt-rescue.pl:129
26606 msgid "Pass additional options to the rescue kernel."
26610 #: ../tools/virt-rescue.pl:164
26611 msgid "B<--memsize MB> | B<-m MB>"
26615 #: ../tools/virt-rescue.pl:166
26617 "Change the amount of memory allocated to the rescue system. The default is "
26618 "set by libguestfs and is small but adequate for running system tools. The "
26619 "occasional program might need more memory. The parameter is specified in "
26624 #: ../tools/virt-rescue.pl:175
26625 msgid "B<--ro> | B<-r>"
26629 #: ../tools/virt-rescue.pl:177
26630 msgid "Open the image read-only."
26634 #: ../tools/virt-rescue.pl:189
26636 "Enable SELinux in the rescue appliance. You should read "
26637 "L<guestfs(3)/SELINUX> before using this option."
26641 #: ../tools/virt-rescue.pl:247
26643 "Several environment variables affect virt-rescue. See "
26644 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
26648 #: ../tools/virt-rescue.pl:259
26650 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
26651 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26655 #: ../tools/virt-make-fs.pl:37
26656 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
26660 #: ../tools/virt-make-fs.pl:41
26663 " virt-make-fs [--options] input.tar output.img\n"
26668 #: ../tools/virt-make-fs.pl:43
26671 " virt-make-fs [--options] input.tar.gz output.img\n"
26676 #: ../tools/virt-make-fs.pl:45
26679 " virt-make-fs [--options] directory output.img\n"
26684 #: ../tools/virt-make-fs.pl:49
26686 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
26687 "archive or some files in a directory. It is similar to tools like "
26688 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
26689 "it can create common filesystem types like ext2/3 or NTFS, which can be "
26690 "useful if you want to attach these filesystems to existing virtual machines "
26691 "(eg. to import large amounts of read-only data to a VM)."
26695 #: ../tools/virt-make-fs.pl:57
26696 msgid "Basic usage is:"
26700 #: ../tools/virt-make-fs.pl:59
26703 " virt-make-fs input output\n"
26708 #: ../tools/virt-make-fs.pl:61
26710 "where C<input> is either a directory containing files that you want to add, "
26711 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
26712 "C<output> is a disk image. The input type is detected automatically. The "
26713 "output disk image defaults to a raw ext2 image unless you specify extra "
26714 "flags (see L</OPTIONS> below)."
26718 #: ../tools/virt-make-fs.pl:67
26719 msgid "EXTRA SPACE"
26723 #: ../tools/virt-make-fs.pl:69
26725 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
26726 "the files that it contains, but might have extra space. Depending on how "
26727 "you are going to use the output, you might think this extra space is wasted "
26728 "and want to minimize it, or you might want to leave space so that more files "
26729 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
26730 "but you can use the C<--size> flag to leave space in the filesystem if you "
26735 #: ../tools/virt-make-fs.pl:77
26737 "An alternative way to leave extra space but not make the output image any "
26738 "bigger is to use an alternative disk image format (instead of the default "
26739 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
26740 "image format (check your hypervisor supports this before using it). This "
26741 "allows you to choose a large C<--size> but the extra space won't actually be "
26742 "allocated in the image until you try to store something in it."
26746 #: ../tools/virt-make-fs.pl:85
26748 "Don't forget that you can also use local commands including L<resize2fs(8)> "
26749 "and L<virt-resize(1)> to resize existing filesystems, or rerun "
26750 "virt-make-resize to build another image from scratch."
26754 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
26759 #: ../tools/virt-make-fs.pl:91
26762 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
26767 #: ../tools/virt-make-fs.pl:93
26768 msgid "FILESYSTEM TYPE"
26772 #: ../tools/virt-make-fs.pl:95
26774 "The default filesystem type is C<ext2>. Just about any filesystem type that "
26775 "libguestfs supports can be used (but I<not> read-only formats like "
26776 "ISO9660). Here are some of the more common choices:"
26780 #: ../tools/virt-make-fs.pl:101
26785 #: ../tools/virt-make-fs.pl:103
26787 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
26788 "you are not going to use the filesystem in a way that requires the journal, "
26789 "then this is just wasted overhead."
26793 #: ../tools/virt-make-fs.pl:107
26794 msgid "I<ntfs> or I<vfat>"
26798 #: ../tools/virt-make-fs.pl:109
26799 msgid "Useful if exporting data to a Windows guest."
26803 #: ../tools/virt-make-fs.pl:111
26805 "I<Note for vfat>: The tar archive or local directory must only contain files "
26806 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
26807 "program running within libguestfs is unable to change the ownership of "
26808 "non-root files, since vfat itself does not support this."
26812 #: ../tools/virt-make-fs.pl:116
26817 #: ../tools/virt-make-fs.pl:118
26819 "Lower overhead than C<ext2>, but certain limitations on filename length and "
26820 "total filesystem size."
26824 #: ../tools/virt-make-fs.pl:125
26827 " virt-make-fs --type=minix input minixfs.img\n"
26832 #: ../tools/virt-make-fs.pl:127
26833 msgid "TO PARTITION OR NOT TO PARTITION"
26837 #: ../tools/virt-make-fs.pl:129
26838 msgid "Optionally virt-make-fs can add a partition table to the output disk."
26842 #: ../tools/virt-make-fs.pl:131
26844 "Adding a partition can make the disk image more compatible with certain "
26845 "virtualized operating systems which don't expect to see a filesystem "
26846 "directly located on a block device (Linux doesn't care and will happily "
26847 "handle both types)."
26851 #: ../tools/virt-make-fs.pl:136
26853 "On the other hand, if you have a partition table then the output image is no "
26854 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
26855 "directly on a partitioned disk image. (However libguestfs tools such as "
26856 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
26860 #: ../tools/virt-make-fs.pl:144
26861 msgid "Add an MBR partition:"
26865 #: ../tools/virt-make-fs.pl:146
26868 " virt-make-fs --partition -- input disk.img\n"
26873 #: ../tools/virt-make-fs.pl:148
26875 "If the output disk image could be terabyte-sized or larger, it's better to "
26876 "use an EFI/GPT-compatible partition table:"
26880 #: ../tools/virt-make-fs.pl:151
26883 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
26888 #: ../tools/virt-make-fs.pl:179
26889 msgid "Enable debugging information."
26893 #: ../tools/virt-make-fs.pl:185
26894 msgid "B<--size=E<lt>NE<gt>>"
26898 #: ../tools/virt-make-fs.pl:187
26899 msgid "B<--size=+E<lt>NE<gt>>"
26903 #: ../tools/virt-make-fs.pl:189
26904 msgid "B<-s E<lt>NE<gt>>"
26908 #: ../tools/virt-make-fs.pl:191
26909 msgid "B<-s +E<lt>NE<gt>>"
26913 #: ../tools/virt-make-fs.pl:193
26914 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
26918 #: ../tools/virt-make-fs.pl:196
26920 "If this option is I<not> given, then the output image will be just large "
26921 "enough to contain all the files, with not much wasted space."
26925 #: ../tools/virt-make-fs.pl:199
26927 "To choose a fixed size output disk, specify an absolute number followed by "
26928 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
26929 "Petabytes or Exabytes. This must be large enough to contain all the input "
26930 "files, else you will get an error."
26934 #: ../tools/virt-make-fs.pl:204
26936 "To leave extra space, specify C<+> (plus sign) and a number followed by "
26937 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
26938 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
26939 "the input files, and (approximately) an extra 200 MB free space."
26943 #: ../tools/virt-make-fs.pl:210
26945 "Note that virt-make-fs estimates free space, and therefore will not produce "
26946 "filesystems containing precisely the free space requested. (It is much more "
26947 "expensive and time-consuming to produce a filesystem which has precisely the "
26948 "desired free space)."
26952 #: ../tools/virt-make-fs.pl:219
26953 msgid "B<--format=E<lt>fmtE<gt>>"
26957 #: ../tools/virt-make-fs.pl:221
26958 msgid "B<-F E<lt>fmtE<gt>>"
26962 #: ../tools/virt-make-fs.pl:223
26963 msgid "Choose the output disk image format."
26967 #: ../tools/virt-make-fs.pl:225
26968 msgid "The default is C<raw> (raw disk image)."
26972 #: ../tools/virt-make-fs.pl:227
26974 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
26975 "that would really make sense here is C<qcow2>."
26979 #: ../tools/virt-make-fs.pl:234
26980 msgid "B<--type=E<lt>fsE<gt>>"
26984 #: ../tools/virt-make-fs.pl:236
26985 msgid "B<-t E<lt>fsE<gt>>"
26989 #: ../tools/virt-make-fs.pl:238
26990 msgid "Choose the output filesystem type."
26994 #: ../tools/virt-make-fs.pl:240
26995 msgid "The default is C<ext2>."
26999 #: ../tools/virt-make-fs.pl:242
27000 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
27004 #: ../tools/virt-make-fs.pl:249
27005 msgid "B<--partition>"
27009 #: ../tools/virt-make-fs.pl:251
27010 msgid "B<--partition=E<lt>parttypeE<gt>>"
27014 #: ../tools/virt-make-fs.pl:253
27016 "If specified, this flag adds an MBR partition table to the output disk "
27021 #: ../tools/virt-make-fs.pl:256
27023 "You can change the partition table type, eg. C<--partition=gpt> for large "
27028 #: ../tools/virt-make-fs.pl:259
27030 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
27031 "might consider the next parameter to be the partition type. For example:"
27035 #: ../tools/virt-make-fs.pl:263
27038 " virt-make-fs --partition input.tar ...\n"
27043 #: ../tools/virt-make-fs.pl:265
27045 "would cause virt-make-fs to think you wanted to use a partition type of "
27046 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
27047 "dash) between options and the input file argument:"
27051 #: ../tools/virt-make-fs.pl:269
27054 " virt-make-fs --partition -- input.tar ...\n"
27059 #: ../tools/virt-make-fs.pl:536
27061 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
27062 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
27063 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
27067 #: ../tools/virt-make-fs.pl:553
27070 " export LIBGUESTFS_DEBUG=1\n"
27071 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
27076 #: ../tools/virt-make-fs.pl:556
27078 "Attach /tmp/virt-make-fs.log to a new bug report at "
27079 "L<https://bugzilla.redhat.com/>"
27083 #: ../tools/virt-list-partitions.pl:32
27084 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
27088 #: ../tools/virt-list-partitions.pl:36
27091 " virt-list-partitions [--options] domname\n"
27096 #: ../tools/virt-list-partitions.pl:38
27099 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
27104 #: ../tools/virt-list-partitions.pl:42
27106 "C<virt-list-partitions> is a command line tool to list the partitions that "
27107 "are contained in a virtual machine or disk image. It is mainly useful as a "
27108 "first step to using L<virt-resize(1)>."
27112 #: ../tools/virt-list-partitions.pl:47
27114 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
27115 "functionality. For more complex cases you should look at the "
27116 "L<guestfish(1)> tool."
27120 #: ../tools/virt-list-partitions.pl:104
27121 msgid "B<-h> | B<--human-readable>"
27125 #: ../tools/virt-list-partitions.pl:106
27126 msgid "Show sizes in human-readable form (eg. \"1G\")."
27130 #: ../tools/virt-list-partitions.pl:114
27132 "With this option, C<virt-list-partitions> displays the type and size of each "
27133 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
27137 #: ../tools/virt-list-partitions.pl:121
27138 msgid "B<-t> | B<--total>"
27142 #: ../tools/virt-list-partitions.pl:123
27143 msgid "Display the total size of each block device (as a separate row or rows)."
27147 #: ../tools/virt-list-partitions.pl:256
27149 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, "
27150 "L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
27151 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."