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.25\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2010-10-28 18:08+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:31 ../tools/virt-edit.pl:30 ../tools/virt-win-reg.pl:33 ../tools/virt-df.pl:32 ../tools/virt-ls.pl:30 ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28 ../tools/virt-cat.pl:29 ../tools/virt-tar.pl:29 ../tools/virt-rescue.pl:29 ../tools/virt-make-fs.pl:33 ../tools/virt-list-partitions.pl:28
25 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pl:33 ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35 ../tools/virt-df.pl:34 ../tools/virt-ls.pl:32 ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30 ../tools/virt-cat.pl:31 ../tools/virt-tar.pl:31 ../tools/virt-rescue.pl:31 ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
30 #: ../src/guestfs.pod:5
31 msgid "guestfs - Library for accessing and modifying virtual machine images"
35 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pl:37 ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39 ../tools/virt-df.pl:38 ../tools/virt-ls.pl:36 ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34 ../tools/virt-cat.pl:35 ../tools/virt-tar.pl:35 ../tools/virt-rescue.pl:35 ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
40 #: ../src/guestfs.pod:9
43 " #include <guestfs.h>\n"
48 #: ../src/guestfs.pod:11
51 " guestfs_h *g = guestfs_create ();\n"
52 " guestfs_add_drive (g, \"guest.img\");\n"
53 " guestfs_launch (g);\n"
54 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
55 " guestfs_touch (g, \"/hello\");\n"
56 " guestfs_umount (g, \"/\");\n"
57 " guestfs_sync (g);\n"
58 " guestfs_close (g);\n"
63 #: ../src/guestfs.pod:20
66 " cc prog.c -o prog -lguestfs\n"
68 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
73 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:30 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20 ../inspector/virt-inspector.pl:43 ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63 ../tools/virt-df.pl:46 ../tools/virt-ls.pl:42 ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40 ../tools/virt-cat.pl:41 ../tools/virt-tar.pl:72 ../tools/virt-rescue.pl:51 ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
78 #: ../src/guestfs.pod:26
80 "Libguestfs is a library for accessing and modifying guest disk images. "
81 "Amongst the things this is good for: making batch configuration changes to "
82 "guests, getting disk used/free statistics (see also: virt-df), migrating "
83 "between virtualization systems (see also: virt-p2v), performing partial "
84 "backups, performing partial guest clones, cloning guests and changing "
85 "registry/UUID/hostname info, and much else besides."
89 #: ../src/guestfs.pod:34
91 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
92 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
93 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
98 #: ../src/guestfs.pod:39
100 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
101 "what filesystem is in each LV, etc.). It can also run commands in the "
102 "context of the guest. Also you can access filesystems over FUSE."
106 #: ../src/guestfs.pod:44
108 "Libguestfs is a library that can be linked with C and C++ management "
109 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
110 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
115 #: ../src/guestfs.pod:49
117 "You don't need to be root to use libguestfs, although obviously you do need "
118 "enough permissions to access the disk images."
122 #: ../src/guestfs.pod:52
124 "Libguestfs is a large API because it can do many things. For a gentle "
125 "introduction, please read the L</API OVERVIEW> section next."
129 #: ../src/guestfs.pod:55
134 #: ../src/guestfs.pod:57
136 "This section provides a gentler overview of the libguestfs API. We also try "
137 "to group API calls together, where that may not be obvious from reading "
138 "about the individual calls in the main section of this manual."
142 #: ../src/guestfs.pod:62
147 #: ../src/guestfs.pod:64
149 "Before you can use libguestfs calls, you have to create a handle. Then you "
150 "must add at least one disk image to the handle, followed by launching the "
151 "handle, then performing whatever operations you want, and finally closing "
152 "the handle. By convention we use the single letter C<g> for the name of the "
153 "handle variable, although of course you can use any name you want."
157 #: ../src/guestfs.pod:71
158 msgid "The general structure of all libguestfs-using programs looks like this:"
162 #: ../src/guestfs.pod:74
165 " guestfs_h *g = guestfs_create ();\n"
170 #: ../src/guestfs.pod:76
173 " /* Call guestfs_add_drive additional times if there are\n"
174 " * multiple disk images.\n"
176 " guestfs_add_drive (g, \"guest.img\");\n"
181 #: ../src/guestfs.pod:81
184 " /* Most manipulation calls won't work until you've launched\n"
185 " * the handle 'g'. You have to do this _after_ adding drives\n"
186 " * and _before_ other commands.\n"
188 " guestfs_launch (g);\n"
193 #: ../src/guestfs.pod:87
196 " /* Now you can examine what partitions, LVs etc are available.\n"
198 " char **partitions = guestfs_list_partitions (g);\n"
199 " char **logvols = guestfs_lvs (g);\n"
204 #: ../src/guestfs.pod:92
207 " /* To access a filesystem in the image, you must mount it.\n"
209 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
214 #: ../src/guestfs.pod:96
217 " /* Now you can perform filesystem actions on the guest\n"
220 " guestfs_touch (g, \"/hello\");\n"
225 #: ../src/guestfs.pod:101
228 " /* You only need to call guestfs_sync if you have made\n"
229 " * changes to the guest image. (But if you've made changes\n"
230 " * then you *must* sync). See also: guestfs_umount and\n"
231 " * guestfs_umount_all calls.\n"
233 " guestfs_sync (g);\n"
238 #: ../src/guestfs.pod:108
241 " /* Close the handle 'g'. */\n"
242 " guestfs_close (g);\n"
247 #: ../src/guestfs.pod:111
249 "The code above doesn't include any error checking. In real code you should "
250 "check return values carefully for errors. In general all functions that "
251 "return integers return C<-1> on error, and all functions that return "
252 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
253 "how to handle errors, and consult the documentation for each function call "
254 "below to see precisely how they return error indications."
258 #: ../src/guestfs.pod:119
263 #: ../src/guestfs.pod:121
265 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
266 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
267 "actual block device, or simply an empty file of zeroes that you have created "
268 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
273 #: ../src/guestfs.pod:127
275 "The call you should use in modern code for adding drives is "
276 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
277 "specifying that the format is raw, do:"
281 #: ../src/guestfs.pod:131
284 " guestfs_add_drive_opts (g, filename,\n"
285 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
291 #: ../src/guestfs.pod:135
292 msgid "You can add a disk read-only using:"
296 #: ../src/guestfs.pod:137
299 " guestfs_add_drive_opts (g, filename,\n"
300 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
301 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
307 #: ../src/guestfs.pod:142
309 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
310 "libguestfs won't modify the file."
314 #: ../src/guestfs.pod:145
316 "Be extremely cautious if the disk image is in use, eg. if it is being used "
317 "by a virtual machine. Adding it read-write will almost certainly cause disk "
318 "corruption, but adding it read-only is safe."
322 #: ../src/guestfs.pod:149
324 "You must add at least one disk image, and you may add multiple disk images. "
325 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
326 "first one you added), C</dev/sdb> (for the second one you added), etc."
330 #: ../src/guestfs.pod:154
332 "Once L</guestfs_launch> has been called you cannot add any more images. You "
333 "can call L</guestfs_list_devices> to get a list of the device names, in the "
334 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
338 #: ../src/guestfs.pod:159
343 #: ../src/guestfs.pod:161
345 "Before you can read or write files, create directories and so on in a disk "
346 "image that contains filesystems, you have to mount those filesystems using "
347 "L</guestfs_mount>. If you already know that a disk image contains (for "
348 "example) one partition with a filesystem on that partition, then you can "
353 #: ../src/guestfs.pod:167
356 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
361 #: ../src/guestfs.pod:169
363 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
364 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
365 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
369 #: ../src/guestfs.pod:173
371 "If you are given a disk image and you don't know what it contains then you "
372 "have to find out. Libguestfs can do that too: use "
373 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
374 "and LVs, and either try mounting each to see what is mountable, or else "
375 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also "
376 "has a set of APIs for inspection of disk images (see L</INSPECTION> below). "
377 "But you might find it easier to look at higher level programs built on top "
378 "of libguestfs, in particular L<virt-inspector(1)>."
382 #: ../src/guestfs.pod:183
384 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
385 "several other variations of the C<guestfs_mount_*> call."
389 #: ../src/guestfs.pod:186
390 msgid "FILESYSTEM ACCESS AND MODIFICATION"
394 #: ../src/guestfs.pod:188
396 "The majority of the libguestfs API consists of fairly low-level calls for "
397 "accessing and modifying the files, directories, symlinks etc on mounted "
398 "filesystems. There are over a hundred such calls which you can find listed "
399 "in detail below in this man page, and we don't even pretend to cover them "
400 "all in this overview."
404 #: ../src/guestfs.pod:194
406 "Specify filenames as full paths, starting with C<\"/\"> and including the "
411 #: ../src/guestfs.pod:197
413 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
414 "the file called C<\"etc/passwd\"> then you could do:"
418 #: ../src/guestfs.pod:200
421 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
426 #: ../src/guestfs.pod:202
428 "This would return C<data> as a newly allocated buffer containing the full "
429 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
430 "or C<NULL> if there was an error."
434 #: ../src/guestfs.pod:206
436 "As another example, to create a top-level directory on that filesystem "
437 "called C<\"var\"> you would do:"
441 #: ../src/guestfs.pod:209
444 " guestfs_mkdir (g, \"/var\");\n"
449 #: ../src/guestfs.pod:211
450 msgid "To create a symlink you could do:"
454 #: ../src/guestfs.pod:213
457 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
458 " \"/etc/rc3.d/S30portmap\");\n"
463 #: ../src/guestfs.pod:216
465 "Libguestfs will reject attempts to use relative paths and there is no "
466 "concept of a current working directory."
470 #: ../src/guestfs.pod:219
472 "Libguestfs can return errors in many situations: for example if the "
473 "filesystem isn't writable, or if a file or directory that you requested "
474 "doesn't exist. If you are using the C API (documented here) you have to "
475 "check for those error conditions after each call. (Other language bindings "
476 "turn these errors into exceptions)."
480 #: ../src/guestfs.pod:225
482 "File writes are affected by the per-handle umask, set by calling "
483 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
487 #: ../src/guestfs.pod:228
492 #: ../src/guestfs.pod:230
494 "Libguestfs contains API calls to read, create and modify partition tables on "
499 #: ../src/guestfs.pod:233
501 "In the common case where you want to create a single partition covering the "
502 "whole disk, you should use the L</guestfs_part_disk> call:"
506 #: ../src/guestfs.pod:237
509 " const char *parttype = \"mbr\";\n"
510 " if (disk_is_larger_than_2TB)\n"
511 " parttype = \"gpt\";\n"
512 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
517 #: ../src/guestfs.pod:242
519 "Obviously this effectively wipes anything that was on that disk image "
524 #: ../src/guestfs.pod:245
529 #: ../src/guestfs.pod:247
531 "Libguestfs provides access to a large part of the LVM2 API, such as "
532 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
533 "unless you familiarize yourself with the concepts of physical volumes, "
534 "volume groups and logical volumes."
538 #: ../src/guestfs.pod:252
540 "This author strongly recommends reading the LVM HOWTO, online at "
541 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
545 #: ../src/guestfs.pod:255
550 #: ../src/guestfs.pod:257
552 "Use L</guestfs_cat> to download small, text only files. This call is "
553 "limited to files which are less than 2 MB and which cannot contain any ASCII "
554 "NUL (C<\\0>) characters. However it has a very simple to use API."
558 #: ../src/guestfs.pod:262
560 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
561 "bit data, since it returns a (pointer, size) pair. However it is still "
562 "limited to \"small\" files, less than 2 MB."
566 #: ../src/guestfs.pod:266
568 "L</guestfs_download> can be used to download any file, with no limits on "
569 "content or size (even files larger than 4 GB)."
573 #: ../src/guestfs.pod:269
574 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
578 #: ../src/guestfs.pod:272
583 #: ../src/guestfs.pod:274
585 "It's often the case that you want to write a file or files to the disk "
590 #: ../src/guestfs.pod:277
592 "To write a small file with fixed content, use L</guestfs_write>. To create "
593 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
594 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
595 "variety of other functions for creating test files, for example "
596 "L</guestfs_fill> and L</guestfs_fill_pattern>."
600 #: ../src/guestfs.pod:283
602 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
603 "file content or size (even files larger than 4 GB)."
607 #: ../src/guestfs.pod:286
608 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
612 #: ../src/guestfs.pod:288
614 "However the fastest way to upload I<large numbers of arbitrary files> is to "
615 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
616 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
617 "the drive in a predictable way (eg. adding it last after all other drives) "
618 "then you can get the device name from L</guestfs_list_devices> and mount it "
619 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
620 "sometimes non-portable between kernel versions, and they don't support "
621 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
622 "using a label or UUID, use an ISO image instead."
626 #: ../src/guestfs.pod:299
631 #: ../src/guestfs.pod:301
633 "There are various different commands for copying between files and devices "
634 "and in and out of the guest filesystem. These are summarised in the table "
639 #: ../src/guestfs.pod:307
640 msgid "B<file> to B<file>"
644 #: ../src/guestfs.pod:309
646 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
647 "directories recursively."
651 #: ../src/guestfs.pod:312
652 msgid "B<file or device> to B<file or device>"
656 #: ../src/guestfs.pod:314
658 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
659 "devices in the guest."
663 #: ../src/guestfs.pod:317
664 msgid "Example: duplicate the contents of an LV:"
668 #: ../src/guestfs.pod:319
671 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
676 #: ../src/guestfs.pod:321
678 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
679 "(C</dev/VG/Original>). To copy less than the whole source device, use "
680 "L</guestfs_copy_size>."
684 #: ../src/guestfs.pod:325
685 msgid "B<file on the host> to B<file or device>"
689 #: ../src/guestfs.pod:327
690 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
694 #: ../src/guestfs.pod:329
695 msgid "B<file or device> to B<file on the host>"
699 #: ../src/guestfs.pod:331
700 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
704 #: ../src/guestfs.pod:335
705 msgid "LISTING FILES"
709 #: ../src/guestfs.pod:337
711 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
712 "L<guestfish(1)>-equivalent command C<ll>)."
716 #: ../src/guestfs.pod:340
718 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
719 "programs, as a flat list of strings."
723 #: ../src/guestfs.pod:343
725 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
726 "directory, plus additional information about each one. It is more "
727 "equivalent to using the L<readdir(3)> call on a local filesystem."
731 #: ../src/guestfs.pod:347
733 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
738 #: ../src/guestfs.pod:350
739 msgid "RUNNING COMMANDS"
743 #: ../src/guestfs.pod:352
745 "Although libguestfs is primarily an API for manipulating files inside guest "
746 "images, we also provide some limited facilities for running commands inside "
751 #: ../src/guestfs.pod:356
752 msgid "There are many limitations to this:"
756 #: ../src/guestfs.pod:360 ../src/guestfs.pod:365 ../src/guestfs.pod:370 ../src/guestfs.pod:374 ../src/guestfs.pod:379 ../src/guestfs.pod:383 ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:1159 ../src/guestfs.pod:1164 ../src/guestfs.pod:1168 ../src/guestfs.pod:1384 ../src/guestfs.pod:1389 ../src/guestfs.pod:1393 ../src/guestfs.pod:1495 ../src/guestfs.pod:1499 ../src/guestfs.pod:1503 ../src/guestfs.pod:1508 ../src/guestfs.pod:1516 ../src/guestfs.pod:1535 ../src/guestfs.pod:1543 ../src/guestfs.pod:1773 ../src/guestfs.pod:1779 ../src/guestfs.pod:1784 ../src/guestfs.pod:1790 ../src/guestfs.pod:1897 ../src/guestfs.pod:1901 ../src/guestfs.pod:1905 ../src/guestfs.pod:1909 ../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 ../inspector/virt-inspector.pl:370 ../inspector/virt-inspector.pl:374 ../tools/virt-df.pl:161 ../tools/virt-df.pl:167 ../tools/virt-resize.pl:348 ../tools/virt-resize.pl:353 ../tools/virt-resize.pl:363
761 #: ../src/guestfs.pod:362
763 "The kernel version that the command runs under will be different from what "
768 #: ../src/guestfs.pod:367
770 "If the command needs to communicate with daemons, then most likely they "
775 #: ../src/guestfs.pod:372
776 msgid "The command will be running in limited memory."
780 #: ../src/guestfs.pod:376
782 "The network may not be available unless you enable it (see "
783 "L</guestfs_set_network>)."
787 #: ../src/guestfs.pod:381
788 msgid "Only supports Linux guests (not Windows, BSD, etc)."
792 #: ../src/guestfs.pod:385
793 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
797 #: ../src/guestfs.pod:390
799 "For SELinux guests, you may need to enable SELinux and load policy first. "
800 "See L</SELINUX> in this manpage."
804 #: ../src/guestfs.pod:395
806 "I<Security:> It is not safe to run commands from untrusted, possibly "
807 "malicious guests. These commands may attempt to exploit your program by "
808 "sending unexpected output. They could also try to exploit the Linux kernel "
809 "or qemu provided by the libguestfs appliance. They could use the network "
810 "provided by the libguestfs appliance to bypass ordinary network partitions "
811 "and firewalls. They could use the elevated privileges or different SELinux "
812 "context of your program to their advantage."
816 #: ../src/guestfs.pod:404
818 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
819 "(a script which runs when the guest next boots normally), and to have this "
820 "script run the commands you want in the normal context of the running guest, "
821 "network security and so on."
825 #: ../src/guestfs.pod:411
827 "The two main API calls to run commands are L</guestfs_command> and "
828 "L</guestfs_sh> (there are also variations)."
832 #: ../src/guestfs.pod:414
834 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
835 "shell globs, redirections, etc will work."
839 #: ../src/guestfs.pod:417
840 msgid "CONFIGURATION FILES"
844 #: ../src/guestfs.pod:419
846 "To read and write configuration files in Linux guest filesystems, we "
847 "strongly recommend using Augeas. For example, Augeas understands how to "
848 "read and write, say, a Linux shadow password file or X.org configuration "
849 "file, and so avoids you having to write that code."
853 #: ../src/guestfs.pod:424
855 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
856 "document Augeas itself here because there is excellent documentation on the "
857 "L<http://augeas.net/> website."
861 #: ../src/guestfs.pod:428
863 "If you don't want to use Augeas (you fool!) then try calling "
864 "L</guestfs_read_lines> to get the file as a list of lines which you can "
869 #: ../src/guestfs.pod:432
874 #: ../src/guestfs.pod:434
876 "We support SELinux guests. To ensure that labeling happens correctly in "
877 "SELinux guests, you need to enable SELinux and load the guest's policy:"
881 #: ../src/guestfs.pod:440
886 #: ../src/guestfs.pod:442
887 msgid "Before launching, do:"
891 #: ../src/guestfs.pod:444
894 " guestfs_set_selinux (g, 1);\n"
899 #: ../src/guestfs.pod:446
904 #: ../src/guestfs.pod:448
906 "After mounting the guest's filesystem(s), load the policy. This is best "
907 "done by running the L<load_policy(8)> command in the guest itself:"
911 #: ../src/guestfs.pod:452
914 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
919 #: ../src/guestfs.pod:454
921 "(Older versions of C<load_policy> require you to specify the name of the "
926 #: ../src/guestfs.pod:457
931 #: ../src/guestfs.pod:459
933 "Optionally, set the security context for the API. The correct security "
934 "context to use can only be known by inspecting the guest. As an example:"
938 #: ../src/guestfs.pod:463
941 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
946 #: ../src/guestfs.pod:467
947 msgid "This will work for running commands and editing existing files."
951 #: ../src/guestfs.pod:469
953 "When new files are created, you may need to label them explicitly, for "
954 "example by running the external command C<restorecon pathname>."
958 #: ../src/guestfs.pod:473
963 #: ../src/guestfs.pod:475
965 "Certain calls are affected by the current file mode creation mask (the "
966 "\"umask\"). In particular ones which create files or directories, such as "
967 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
968 "either the default mode that the file is created with or modifies the mode "
973 #: ../src/guestfs.pod:481
975 "The default umask is C<022>, so files are created with modes such as C<0644> "
976 "and directories with C<0755>."
980 #: ../src/guestfs.pod:484
982 "There are two ways to avoid being affected by umask. Either set umask to 0 "
983 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
984 "L</guestfs_chmod> after creating each file or directory."
988 #: ../src/guestfs.pod:488
989 msgid "For more information about umask, see L<umask(2)>."
993 #: ../src/guestfs.pod:490 ../fish/guestfish.pod:630
994 msgid "ENCRYPTED DISKS"
998 #: ../src/guestfs.pod:492
1000 "Libguestfs allows you to access Linux guests which have been encrypted using "
1001 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1002 "standard. This includes nearly all whole disk encryption systems used by "
1003 "modern Linux guests."
1007 #: ../src/guestfs.pod:498
1009 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1010 "returns the string C<crypto_LUKS>)."
1014 #: ../src/guestfs.pod:501
1016 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1017 "will require the passphrase!"
1021 #: ../src/guestfs.pod:504
1023 "Opening a LUKS device creates a new device mapper device called "
1024 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
1025 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
1026 "decrypted from and encrypted to the underlying block device respectively."
1030 #: ../src/guestfs.pod:510
1032 "LVM volume groups on the device can be made visible by calling "
1033 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
1034 "volume(s) can now be mounted in the usual way."
1038 #: ../src/guestfs.pod:514
1040 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1041 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1042 "[\"/dev/VG\"])>. Then close the mapper device by calling "
1043 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1044 "underlying encrypted block device)."
1048 #: ../src/guestfs.pod:521
1053 #: ../src/guestfs.pod:523
1055 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1056 "contains operating systems. (These APIs used to be in a separate Perl-only "
1057 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1058 "frequently used part of this library has been rewritten in C and moved into "
1063 #: ../src/guestfs.pod:529
1065 "Add all disks belonging to the unknown virtual machine and call "
1066 "L</guestfs_launch> in the usual way."
1070 #: ../src/guestfs.pod:532
1072 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1073 "and certain heuristics, and returns a list of operating systems that were "
1074 "found. An empty list means none were found. A single element is the root "
1075 "filesystem of the operating system. For dual- or multi-boot guests, "
1076 "multiple roots can be returned, each one corresponding to a separate "
1077 "operating system. (Multi-boot virtual machines are extremely rare in the "
1078 "world of virtualization, but since this scenario can happen, we have built "
1079 "libguestfs to deal with it.)"
1083 #: ../src/guestfs.pod:541
1085 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1086 "to get additional details about that operating system. For example, call "
1087 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1088 "Windows and Linux-based operating systems respectively."
1092 #: ../src/guestfs.pod:547
1094 "Un*x-like and Linux-based operating systems usually consist of several "
1095 "filesystems which are mounted at boot time (for example, a separate boot "
1096 "partition mounted on C</boot>). The inspection rules are able to detect how "
1097 "filesystems correspond to mount points. Call "
1098 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1099 "hash table like this example:"
1103 #: ../src/guestfs.pod:554
1106 " /boot => /dev/sda1\n"
1107 " / => /dev/vg_guest/lv_root\n"
1108 " /usr => /dev/vg_guest/lv_usr\n"
1113 #: ../src/guestfs.pod:558
1115 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1116 "filesystems as suggested."
1120 #: ../src/guestfs.pod:561
1122 "Be careful to mount filesystems in the right order (eg. C</> before "
1123 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1128 #: ../src/guestfs.pod:565
1130 "Inspection currently only works for some common operating systems. "
1131 "Contributors are welcome to send patches for other operating systems that we "
1132 "currently cannot detect."
1136 #: ../src/guestfs.pod:569
1138 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1139 "for more details. The L</guestfs_inspect_os> function just ignores any "
1140 "encrypted devices."
1144 #: ../src/guestfs.pod:573
1146 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1147 "inspection and caches the results in the guest handle. Subsequent calls to "
1148 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1149 "re-read the disks. If you change the content of the guest disks, you can "
1150 "redo inspection by calling L</guestfs_inspect_os> again."
1154 #: ../src/guestfs.pod:580
1155 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1159 #: ../src/guestfs.pod:582
1161 "Libguestfs can mount NTFS partitions. It does this using the "
1162 "L<http://www.ntfs-3g.org/> driver."
1166 #: ../src/guestfs.pod:585
1168 "DOS and Windows still use drive letters, and the filesystems are always "
1169 "treated as case insensitive by Windows itself, and therefore you might find "
1170 "a Windows configuration file referring to a path like "
1171 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1172 "that directory might be referred to as C</WINDOWS/System32>."
1176 #: ../src/guestfs.pod:591
1178 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1179 "libguestfs to read the appropriate Windows Registry and configuration files, "
1180 "to determine yourself how drives are mapped (see also L<hivex(3)> and "
1181 "L<virt-inspector(1)>)."
1185 #: ../src/guestfs.pod:596
1187 "Replacing backslash characters with forward slash characters is also outside "
1188 "the scope of libguestfs, but something that you can easily do."
1192 #: ../src/guestfs.pod:599
1194 "Where we can help is in resolving the case insensitivity of paths. For "
1195 "this, call L</guestfs_case_sensitive_path>."
1199 #: ../src/guestfs.pod:602
1201 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1202 "files, through the library C<hivex> which is part of the libguestfs project "
1203 "although ships as a separate tarball. You have to locate and download the "
1204 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1205 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1206 "L<virt-win-reg(1)> for more help on this issue."
1210 #: ../src/guestfs.pod:610
1211 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1215 #: ../src/guestfs.pod:612
1217 "Although we don't want to discourage you from using the C API, we will "
1218 "mention here that the same API is also available in other languages."
1222 #: ../src/guestfs.pod:615
1224 "The API is broadly identical in all supported languages. This means that "
1225 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, "
1226 "C<g.mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1227 "words, a straightforward, predictable isomorphism between each language."
1231 #: ../src/guestfs.pod:621
1233 "Error messages are automatically transformed into exceptions if the language "
1238 #: ../src/guestfs.pod:624
1240 "We don't try to \"object orientify\" parts of the API in OO languages, "
1241 "although contributors are welcome to write higher level APIs above what we "
1242 "provide in their favourite languages if they wish."
1246 #: ../src/guestfs.pod:630
1251 #: ../src/guestfs.pod:632
1253 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1254 "identical to the C API. C++ classes and exceptions are not used."
1258 #: ../src/guestfs.pod:636
1263 #: ../src/guestfs.pod:638
1265 "The C# bindings are highly experimental. Please read the warnings at the "
1266 "top of C<csharp/Libguestfs.cs>."
1270 #: ../src/guestfs.pod:641
1275 #: ../src/guestfs.pod:643
1277 "This is the only language binding that is working but incomplete. Only "
1278 "calls which return simple integers have been bound in Haskell, and we are "
1279 "looking for help to complete this binding."
1283 #: ../src/guestfs.pod:647
1288 #: ../src/guestfs.pod:649
1290 "Full documentation is contained in the Javadoc which is distributed with "
1295 #: ../src/guestfs.pod:652
1300 #: ../src/guestfs.pod:654
1301 msgid "For documentation see the file C<guestfs.mli>."
1305 #: ../src/guestfs.pod:656
1310 #: ../src/guestfs.pod:658
1311 msgid "For documentation see L<Sys::Guestfs(3)>."
1315 #: ../src/guestfs.pod:660
1320 #: ../src/guestfs.pod:662
1322 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1323 "the php-libguestfs package for your distribution."
1327 #: ../src/guestfs.pod:665
1328 msgid "The PHP binding only works correctly on 64 bit machines."
1332 #: ../src/guestfs.pod:667
1337 #: ../src/guestfs.pod:669
1338 msgid "For documentation do:"
1342 #: ../src/guestfs.pod:671
1346 " >>> import guestfs\n"
1347 " >>> help (guestfs)\n"
1352 #: ../src/guestfs.pod:675
1357 #: ../src/guestfs.pod:677
1359 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1360 "can find examples written in Ruby in the libguestfs source."
1364 #: ../src/guestfs.pod:680
1365 msgid "B<shell scripts>"
1369 #: ../src/guestfs.pod:682
1370 msgid "For documentation see L<guestfish(1)>."
1374 #: ../src/guestfs.pod:686
1375 msgid "LIBGUESTFS GOTCHAS"
1379 #: ../src/guestfs.pod:688
1381 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1382 "system [...] that works in the way it is documented but is counterintuitive "
1383 "and almost invites mistakes.\""
1387 #: ../src/guestfs.pod:692
1389 "Since we developed libguestfs and the associated tools, there are several "
1390 "things we would have designed differently, but are now stuck with for "
1391 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1392 "release, you can expect these to change. Beware of them."
1396 #: ../src/guestfs.pod:700
1397 msgid "Autosync / forgetting to sync."
1401 #: ../src/guestfs.pod:702
1403 "When modifying a filesystem from C or another language, you B<must> unmount "
1404 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1405 "libguestfs handle. You can also call:"
1409 #: ../src/guestfs.pod:706
1412 " guestfs_set_autosync (g, 1);\n"
1417 #: ../src/guestfs.pod:708
1419 "to have the unmount/sync done automatically for you when the handle 'g' is "
1420 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1425 #: ../src/guestfs.pod:712
1427 "If you forget to do this, then it is entirely possible that your changes "
1428 "won't be written out, or will be partially written, or (very rarely) that "
1429 "you'll get disk corruption."
1433 #: ../src/guestfs.pod:716
1435 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1436 "guestfish scripts that forget to sync will work just fine, which can make "
1437 "this very puzzling if you are trying to debug a problem."
1441 #: ../src/guestfs.pod:720
1443 "Update: Autosync is enabled by default for all API users starting from "
1444 "libguestfs 1.5.24."
1448 #: ../src/guestfs.pod:723
1449 msgid "Mount option C<-o sync> should not be the default."
1453 #: ../src/guestfs.pod:725
1455 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1456 "However C<-o sync> does not add any reliability benefit, but does have a "
1457 "very large performance impact."
1461 #: ../src/guestfs.pod:729
1463 "The work around is to use L</guestfs_mount_options> and set the mount "
1464 "options that you actually want to use."
1468 #: ../src/guestfs.pod:732
1469 msgid "Read-only should be the default."
1473 #: ../src/guestfs.pod:734
1475 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1476 "specify I<--rw> if you want to make changes to the image."
1480 #: ../src/guestfs.pod:737
1481 msgid "This would reduce the potential to corrupt live VM images."
1485 #: ../src/guestfs.pod:739
1487 "Note that many filesystems change the disk when you just mount and unmount, "
1488 "even if you didn't perform any writes. You need to use "
1489 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1493 #: ../src/guestfs.pod:743
1494 msgid "guestfish command line is hard to use."
1498 #: ../src/guestfs.pod:745
1500 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1501 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1502 "exist, so it fails. In earlier versions of guestfish the error message was "
1503 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1504 "we should have used C<guestfish -c command> to run commands."
1508 #: ../src/guestfs.pod:752
1509 msgid "guestfish megabyte modifiers don't work right on all commands"
1513 #: ../src/guestfs.pod:754
1515 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1516 "other modifiers). What guestfish actually does is to multiply the number "
1517 "part by the modifier part and pass the result to the C API. However this "
1518 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1519 "expecting some other unit (eg. megabytes)."
1523 #: ../src/guestfs.pod:761
1524 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1528 #: ../src/guestfs.pod:763
1531 " lvcreate LV VG 100M\n"
1536 #: ../src/guestfs.pod:765
1538 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1539 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1540 "megabytes * megabytes) logical volume. The error message you get from this "
1541 "is also a little obscure."
1545 #: ../src/guestfs.pod:770
1547 "This could be fixed in the generator by specially marking parameters and "
1548 "return values which take bytes or other units."
1552 #: ../src/guestfs.pod:773
1553 msgid "Library should return errno with error messages."
1557 #: ../src/guestfs.pod:775
1559 "It would be a nice-to-have to be able to get the original value of 'errno' "
1560 "from inside the appliance along error paths (where set). Currently "
1561 "L<guestmount(1)> goes through hoops to try to reverse the error message "
1562 "string into an errno, see the function error() in fuse/guestmount.c."
1566 #: ../src/guestfs.pod:781
1568 "In libguestfs 1.5.4, the protocol was changed so that the Linux errno is "
1569 "sent back from the daemon."
1573 #: ../src/guestfs.pod:784
1574 msgid "Ambiguity between devices and paths"
1578 #: ../src/guestfs.pod:786
1580 "There is a subtle ambiguity in the API between a device name "
1581 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
1582 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1586 #: ../src/guestfs.pod:791
1588 "In the current API we usually resolve this ambiguity by having two separate "
1589 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1590 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1591 "detecting if the path supplied begins with C</dev/>."
1595 #: ../src/guestfs.pod:797
1597 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1598 "make paths/devices into structured names. One way to do this would be to "
1599 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1600 "aspect of grub. Another way would be to use a structured type, equivalent "
1601 "to this OCaml type:"
1605 #: ../src/guestfs.pod:803
1608 " type path = Path of string | Device of int | Partition of int * int\n"
1613 #: ../src/guestfs.pod:805
1614 msgid "which would allow you to pass arguments like:"
1618 #: ../src/guestfs.pod:807
1621 " Path \"/foo/bar\"\n"
1622 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1623 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1624 " Path \"/dev/sdb2\" (* not a device *)\n"
1629 #: ../src/guestfs.pod:812
1631 "As you can see there are still problems to resolve even with this "
1632 "representation. Also consider how it might work in guestfish."
1636 #: ../src/guestfs.pod:817
1637 msgid "PROTOCOL LIMITS"
1641 #: ../src/guestfs.pod:819
1643 "Internally libguestfs uses a message-based protocol to pass API calls and "
1644 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1645 "plenty more detail about this). The maximum message size used by the "
1646 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1647 "aware of this limit. The API calls which may be affected are individually "
1648 "documented, with a link back to this section of the documentation."
1652 #: ../src/guestfs.pod:827
1654 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1655 "a simple string. Because this string is at some point internally encoded as "
1656 "a message, the maximum size that it can return is slightly under 4 MB. If "
1657 "the requested file is larger than this then you will get an error."
1661 #: ../src/guestfs.pod:833
1663 "In order to transfer large files into and out of the guest filesystem, you "
1664 "need to use particular calls that support this. The sections L</UPLOADING> "
1665 "and L</DOWNLOADING> document how to do this."
1669 #: ../src/guestfs.pod:837
1671 "You might also consider mounting the disk image using our FUSE filesystem "
1672 "support (L<guestmount(1)>)."
1676 #: ../src/guestfs.pod:840
1677 msgid "KEYS AND PASSPHRASES"
1681 #: ../src/guestfs.pod:842
1683 "Certain libguestfs calls take a parameter that contains sensitive key "
1684 "material, passed in as a C string."
1688 #: ../src/guestfs.pod:845
1690 "In the future we would hope to change the libguestfs implementation so that "
1691 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1692 "swap. However this is I<not> done at the moment, because of the complexity "
1693 "of such an implementation."
1697 #: ../src/guestfs.pod:850
1699 "Therefore you should be aware that any key parameter you pass to libguestfs "
1700 "might end up being written out to the swap partition. If this is a concern, "
1701 "scrub the swap partition or don't use libguestfs on encrypted devices."
1705 #: ../src/guestfs.pod:855
1706 msgid "CONNECTION MANAGEMENT"
1710 #: ../src/guestfs.pod:857
1715 #: ../src/guestfs.pod:859
1717 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1718 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1719 "handle and release all resources used."
1723 #: ../src/guestfs.pod:863
1725 "For information on using multiple handles and threads, see the section "
1726 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1730 #: ../src/guestfs.pod:866
1731 msgid "guestfs_create"
1735 #: ../src/guestfs.pod:868
1738 " guestfs_h *guestfs_create (void);\n"
1743 #: ../src/guestfs.pod:870
1744 msgid "Create a connection handle."
1748 #: ../src/guestfs.pod:872
1750 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
1751 "on the handle at least once."
1755 #: ../src/guestfs.pod:875
1757 "This function returns a non-NULL pointer to a handle on success or NULL on "
1762 #: ../src/guestfs.pod:878
1763 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1767 #: ../src/guestfs.pod:880
1769 "You may also want to configure error handling for the handle. See L</ERROR "
1770 "HANDLING> section below."
1774 #: ../src/guestfs.pod:883
1775 msgid "guestfs_close"
1779 #: ../src/guestfs.pod:885
1782 " void guestfs_close (guestfs_h *g);\n"
1787 #: ../src/guestfs.pod:887
1788 msgid "This closes the connection handle and frees up all resources used."
1792 #: ../src/guestfs.pod:889
1793 msgid "ERROR HANDLING"
1797 #: ../src/guestfs.pod:891
1799 "The convention in all functions that return C<int> is that they return C<-1> "
1800 "to indicate an error. You can get additional information on errors by "
1801 "calling L</guestfs_last_error> and/or by setting up an error handler with "
1802 "L</guestfs_set_error_handler>."
1806 #: ../src/guestfs.pod:896
1807 msgid "The default error handler prints the information string to C<stderr>."
1811 #: ../src/guestfs.pod:898
1813 "Out of memory errors are handled differently. The default action is to call "
1814 "L<abort(3)>. If this is undesirable, then you can set a handler using "
1815 "L</guestfs_set_out_of_memory_handler>."
1819 #: ../src/guestfs.pod:902
1820 msgid "guestfs_last_error"
1824 #: ../src/guestfs.pod:904
1827 " const char *guestfs_last_error (guestfs_h *g);\n"
1832 #: ../src/guestfs.pod:906
1834 "This returns the last error message that happened on C<g>. If there has not "
1835 "been an error since the handle was created, then this returns C<NULL>."
1839 #: ../src/guestfs.pod:910
1841 "The lifetime of the returned string is until the next error occurs, or "
1842 "L</guestfs_close> is called."
1846 #: ../src/guestfs.pod:913
1848 "The error string is not localized (ie. is always in English), because this "
1849 "makes searching for error messages in search engines give the largest number "
1854 #: ../src/guestfs.pod:917
1855 msgid "guestfs_set_error_handler"
1859 #: ../src/guestfs.pod:919
1862 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1864 " const char *msg);\n"
1865 " void guestfs_set_error_handler (guestfs_h *g,\n"
1866 " guestfs_error_handler_cb cb,\n"
1872 #: ../src/guestfs.pod:926
1874 "The callback C<cb> will be called if there is an error. The parameters "
1875 "passed to the callback are an opaque data pointer and the error message "
1880 #: ../src/guestfs.pod:930
1882 "Note that the message string C<msg> is freed as soon as the callback "
1883 "function returns, so if you want to stash it somewhere you must make your "
1888 #: ../src/guestfs.pod:934
1889 msgid "The default handler prints messages on C<stderr>."
1893 #: ../src/guestfs.pod:936
1894 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
1898 #: ../src/guestfs.pod:938
1899 msgid "guestfs_get_error_handler"
1903 #: ../src/guestfs.pod:940
1906 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
1907 " void **opaque_rtn);\n"
1912 #: ../src/guestfs.pod:943
1913 msgid "Returns the current error handler callback."
1917 #: ../src/guestfs.pod:945
1918 msgid "guestfs_set_out_of_memory_handler"
1922 #: ../src/guestfs.pod:947
1925 " typedef void (*guestfs_abort_cb) (void);\n"
1926 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
1927 " guestfs_abort_cb);\n"
1932 #: ../src/guestfs.pod:951
1934 "The callback C<cb> will be called if there is an out of memory situation. "
1935 "I<Note this callback must not return>."
1939 #: ../src/guestfs.pod:954
1940 msgid "The default is to call L<abort(3)>."
1944 #: ../src/guestfs.pod:956
1945 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
1949 #: ../src/guestfs.pod:959
1950 msgid "guestfs_get_out_of_memory_handler"
1954 #: ../src/guestfs.pod:961
1957 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
1962 #: ../src/guestfs.pod:963
1963 msgid "This returns the current out of memory handler."
1967 #: ../src/guestfs.pod:965
1972 #: ../src/guestfs.pod:967
1974 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1979 #: ../src/guestfs.pod:970
1981 "By default it looks for these in the directory C<$libdir/guestfs> "
1982 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1986 #: ../src/guestfs.pod:973
1988 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1989 "to change the directories that libguestfs will search in. The value is a "
1990 "colon-separated list of paths. The current directory is I<not> searched "
1991 "unless the path contains an empty element or C<.>. For example "
1992 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1993 "then C</usr/lib/guestfs>."
1997 #: ../src/guestfs.pod:980
1998 msgid "HIGH-LEVEL API ACTIONS"
2002 #: ../src/guestfs.pod:982
2003 msgid "ABI GUARANTEE"
2007 #: ../src/guestfs.pod:984
2009 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2010 "actions as outlined in this section. Although we will deprecate some "
2011 "actions, for example if they get replaced by newer calls, we will keep the "
2012 "old actions forever. This allows you the developer to program in confidence "
2013 "against the libguestfs API."
2017 #: ../src/guestfs.pod:990 ../fish/guestfish.pod:860
2022 #: ../src/guestfs.pod:992
2027 #: ../src/guestfs.pod:994
2032 #: ../src/guestfs.pod:996
2033 msgid "AVAILABILITY"
2037 #: ../src/guestfs.pod:998
2038 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2042 #: ../src/guestfs.pod:1000
2044 "Using L</guestfs_available> you can test availability of the following "
2045 "groups of functions. This test queries the appliance to see if the "
2046 "appliance you are currently using supports the functionality."
2050 #: ../src/guestfs.pod:1005
2051 msgid "@AVAILABILITY@"
2055 #: ../src/guestfs.pod:1007
2056 msgid "GUESTFISH supported COMMAND"
2060 #: ../src/guestfs.pod:1009
2062 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2063 "prints out the available groups and whether they are supported by this build "
2064 "of libguestfs. Note however that you have to do C<run> first."
2068 #: ../src/guestfs.pod:1014
2069 msgid "SINGLE CALLS AT COMPILE TIME"
2073 #: ../src/guestfs.pod:1016
2075 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2076 "function, such as:"
2080 #: ../src/guestfs.pod:1019
2083 " #define LIBGUESTFS_HAVE_DD 1\n"
2088 #: ../src/guestfs.pod:1021
2089 msgid "if L</guestfs_dd> is available."
2093 #: ../src/guestfs.pod:1023
2095 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2096 "function is available at compile time, we recommended using build tools such "
2097 "as autoconf or cmake. For example in autotools you could use:"
2101 #: ../src/guestfs.pod:1028
2104 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2105 " AC_CHECK_FUNCS([guestfs_dd])\n"
2110 #: ../src/guestfs.pod:1031
2112 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2117 #: ../src/guestfs.pod:1034
2118 msgid "SINGLE CALLS AT RUN TIME"
2122 #: ../src/guestfs.pod:1036
2124 "Testing at compile time doesn't guarantee that a function really exists in "
2125 "the library. The reason is that you might be dynamically linked against a "
2126 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2127 "This situation unfortunately results in a segmentation fault, which is a "
2128 "shortcoming of the C dynamic linking system itself."
2132 #: ../src/guestfs.pod:1043
2134 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2135 "in this example program (note that you still need the compile time check as "
2140 #: ../src/guestfs.pod:1047
2143 " #include <stdio.h>\n"
2144 " #include <stdlib.h>\n"
2145 " #include <unistd.h>\n"
2146 " #include <dlfcn.h>\n"
2147 " #include <guestfs.h>\n"
2152 #: ../src/guestfs.pod:1053
2157 " #ifdef LIBGUESTFS_HAVE_DD\n"
2159 " int has_function;\n"
2164 #: ../src/guestfs.pod:1059
2167 " /* Test if the function guestfs_dd is really available. */\n"
2168 " dl = dlopen (NULL, RTLD_LAZY);\n"
2170 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2171 " exit (EXIT_FAILURE);\n"
2173 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2179 #: ../src/guestfs.pod:1068
2182 " if (!has_function)\n"
2183 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2185 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2186 " /* Now it's safe to call\n"
2187 " guestfs_dd (g, \"foo\", \"bar\");\n"
2191 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2198 #: ../src/guestfs.pod:1081
2200 "You may think the above is an awful lot of hassle, and it is. There are "
2201 "other ways outside of the C linking system to ensure that this kind of "
2202 "incompatibility never arises, such as using package versioning:"
2206 #: ../src/guestfs.pod:1086
2209 " Requires: libguestfs >= 1.0.80\n"
2214 #: ../src/guestfs.pod:1088
2215 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2219 #: ../src/guestfs.pod:1090
2221 "A recent feature of the API is the introduction of calls which take optional "
2222 "arguments. In C these are declared 3 ways. The main way is as a call which "
2223 "takes variable arguments (ie. C<...>), as in this example:"
2227 #: ../src/guestfs.pod:1095
2230 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2235 #: ../src/guestfs.pod:1097
2237 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2238 "call with no optional arguments specified:"
2242 #: ../src/guestfs.pod:1100
2245 " guestfs_add_drive_opts (g, filename, -1);\n"
2250 #: ../src/guestfs.pod:1102
2251 msgid "With a single optional argument:"
2255 #: ../src/guestfs.pod:1104
2258 " guestfs_add_drive_opts (g, filename,\n"
2259 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2265 #: ../src/guestfs.pod:1108
2270 #: ../src/guestfs.pod:1110
2273 " guestfs_add_drive_opts (g, filename,\n"
2274 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2275 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2281 #: ../src/guestfs.pod:1115
2283 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2288 #: ../src/guestfs.pod:1118
2289 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2293 #: ../src/guestfs.pod:1120
2295 "The second variant has the same name with the suffix C<_va>, which works the "
2296 "same way but takes a C<va_list>. See the C manual for details. For the "
2297 "example function, this is declared:"
2301 #: ../src/guestfs.pod:1124
2304 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2310 #: ../src/guestfs.pod:1127
2311 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2315 #: ../src/guestfs.pod:1129
2317 "The third variant is useful where you need to construct these calls. You "
2318 "pass in a structure where you fill in the optional fields. The structure "
2319 "has a bitmask as the first element which you must set to indicate which "
2320 "fields you have filled in. For our example function the structure and call "
2325 #: ../src/guestfs.pod:1135
2328 " struct guestfs_add_drive_opts_argv {\n"
2329 " uint64_t bitmask;\n"
2331 " const char *format;\n"
2334 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
2335 " const struct guestfs_add_drive_opts_argv *optargs);\n"
2340 #: ../src/guestfs.pod:1144
2341 msgid "You could call it like this:"
2345 #: ../src/guestfs.pod:1146
2348 " struct guestfs_add_drive_opts_argv optargs = {\n"
2349 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
2350 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
2352 " .format = \"qcow2\"\n"
2358 #: ../src/guestfs.pod:1153
2361 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
2366 #: ../src/guestfs.pod:1155 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:1582 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1244
2371 #: ../src/guestfs.pod:1161
2372 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
2376 #: ../src/guestfs.pod:1166
2377 msgid "You do not need to fill in all fields of the structure."
2381 #: ../src/guestfs.pod:1170
2383 "There must be a one-to-one correspondence between fields of the structure "
2384 "that are filled in, and bits set in the bitmask."
2388 #: ../src/guestfs.pod:1175
2389 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
2393 #: ../src/guestfs.pod:1177
2395 "In other languages, optional arguments are expressed in the way that is "
2396 "natural for that language. We refer you to the language-specific "
2397 "documentation for more details on that."
2401 #: ../src/guestfs.pod:1181
2402 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
2406 #: ../src/guestfs.pod:1183 ../src/guestfs.pod:1188
2411 #: ../src/guestfs.pod:1185
2413 "<!-- old anchor for the next section --> <a "
2414 "name=\"state_machine_and_low_level_event_api\"/>"
2418 #: ../src/guestfs.pod:1190
2419 msgid "ARCHITECTURE"
2423 #: ../src/guestfs.pod:1192
2425 "Internally, libguestfs is implemented by running an appliance (a special "
2426 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2427 "process of the main program."
2431 #: ../src/guestfs.pod:1196
2434 " ___________________\n"
2436 " | main program |\n"
2438 " | | child process / appliance\n"
2439 " | | __________________________\n"
2441 " +-------------------+ RPC | +-----------------+ |\n"
2442 " | libguestfs <--------------------> guestfsd | |\n"
2443 " | | | +-----------------+ |\n"
2444 " \\___________________/ | | Linux kernel | |\n"
2445 " | +--^--------------+ |\n"
2446 " \\_________|________________/\n"
2452 " \\______________/\n"
2457 #: ../src/guestfs.pod:1216
2459 "The library, linked to the main program, creates the child process and hence "
2460 "the appliance in the L</guestfs_launch> function."
2464 #: ../src/guestfs.pod:1219
2466 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2467 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2468 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2469 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2470 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2471 "attached to the qemu process which translates device access by the "
2472 "appliance's Linux kernel into accesses to the image."
2476 #: ../src/guestfs.pod:1228
2478 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2479 "Although the disk image you are attached to might also be used by some "
2480 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2481 "care if both libguestfs's qemu process and your virtual machine are trying "
2482 "to update the disk image at the same time, since these usually results in "
2483 "massive disk corruption)."
2487 #: ../src/guestfs.pod:1235
2488 msgid "STATE MACHINE"
2492 #: ../src/guestfs.pod:1237
2493 msgid "libguestfs uses a state machine to model the child process:"
2497 #: ../src/guestfs.pod:1239
2509 " / | \\ \\ guestfs_launch\n"
2510 " / | _\\__V______\n"
2512 " / | | LAUNCHING |\n"
2513 " / | \\___________/\n"
2515 " / | guestfs_launch\n"
2517 " ______ / __|____V\n"
2518 " / \\ ------> / \\\n"
2519 " | BUSY | | READY |\n"
2520 " \\______/ <------ \\________/\n"
2525 #: ../src/guestfs.pod:1261
2527 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2528 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2529 "(3) alternating between READY and BUSY as commands are issued to, and "
2530 "carried out by, the child process."
2534 #: ../src/guestfs.pod:1266
2536 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2537 "asynchronously at any time (eg. due to some internal error), and that causes "
2538 "the state to transition back to CONFIG."
2542 #: ../src/guestfs.pod:1270
2544 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2545 "issued when in the CONFIG state."
2549 #: ../src/guestfs.pod:1273
2551 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2552 "L</guestfs_launch> blocks until the child process is READY to accept "
2553 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2554 "moves the state from CONFIG to LAUNCHING while it is running."
2558 #: ../src/guestfs.pod:1279
2560 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2561 "state. These API calls block waiting for the command to be carried out "
2562 "(ie. the state to transition to BUSY and then back to READY). There are no "
2563 "non-blocking versions, and no way to issue more than one command per handle "
2568 #: ../src/guestfs.pod:1285
2570 "Finally, the child process sends asynchronous messages back to the main "
2571 "program, such as kernel log messages. You can register a callback to "
2572 "receive these messages."
2576 #: ../src/guestfs.pod:1289
2577 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2581 #: ../src/guestfs.pod:1291
2583 "The child process generates events in some situations. Current events "
2584 "include: receiving a log message, the child process exits."
2588 #: ../src/guestfs.pod:1294
2590 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2595 #: ../src/guestfs.pod:1297
2597 "Only I<one callback of each type> can be registered for each handle. "
2598 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2599 "that type. Cancel all callbacks of this type by calling this function with "
2600 "C<cb> set to C<NULL>."
2604 #: ../src/guestfs.pod:1302
2605 msgid "guestfs_set_log_message_callback"
2609 #: ../src/guestfs.pod:1304
2612 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2613 " char *buf, int len);\n"
2614 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2615 " guestfs_log_message_cb cb,\n"
2621 #: ../src/guestfs.pod:1310
2623 "The callback function C<cb> will be called whenever qemu or the guest writes "
2624 "anything to the console."
2628 #: ../src/guestfs.pod:1313
2629 msgid "Use this function to capture kernel messages and similar."
2633 #: ../src/guestfs.pod:1315
2635 "Normally there is no log message handler, and log messages are just "
2640 #: ../src/guestfs.pod:1318
2641 msgid "guestfs_set_subprocess_quit_callback"
2645 #: ../src/guestfs.pod:1320
2648 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2649 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2650 " guestfs_subprocess_quit_cb cb,\n"
2656 #: ../src/guestfs.pod:1325
2658 "The callback function C<cb> will be called when the child process quits, "
2659 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2660 "corresponds to a transition from any state to the CONFIG state)."
2664 #: ../src/guestfs.pod:1330
2665 msgid "guestfs_set_launch_done_callback"
2669 #: ../src/guestfs.pod:1332
2672 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2673 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2674 " guestfs_launch_done_cb cb,\n"
2680 #: ../src/guestfs.pod:1337
2682 "The callback function C<cb> will be called when the child process becomes "
2683 "ready first time after it has been launched. (This corresponds to a "
2684 "transition from LAUNCHING to the READY state)."
2688 #: ../src/guestfs.pod:1341
2689 msgid "guestfs_set_close_callback"
2693 #: ../src/guestfs.pod:1343
2696 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2697 " void guestfs_set_close_callback (guestfs_h *g,\n"
2698 " guestfs_close_cb cb,\n"
2704 #: ../src/guestfs.pod:1348
2706 "The callback function C<cb> will be called while the handle is being closed "
2707 "(synchronously from L</guestfs_close>)."
2711 #: ../src/guestfs.pod:1351
2713 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2714 "handles that are open when the program exits. This means that this callback "
2715 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2716 "problems in higher-level languages (eg. if your HLL interpreter has already "
2717 "been cleaned up by the time this is called, and if your callback then jumps "
2718 "into some HLL function)."
2722 #: ../src/guestfs.pod:1359
2723 msgid "guestfs_set_progress_callback"
2727 #: ../src/guestfs.pod:1361
2730 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2731 " int proc_nr, int serial,\n"
2732 " uint64_t position, uint64_t total);\n"
2733 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2734 " guestfs_progress_cb cb,\n"
2740 #: ../src/guestfs.pod:1368
2742 "Some long-running operations can generate progress messages. If this "
2743 "callback is registered, then it will be called each time a progress message "
2744 "is generated (usually two seconds after the operation started, and three "
2745 "times per second thereafter until it completes, although the frequency may "
2746 "change in future versions)."
2750 #: ../src/guestfs.pod:1374
2752 "The callback receives two numbers: C<position> and C<total>. The units of "
2753 "C<total> are not defined, although for some operations C<total> may relate "
2754 "in some way to the amount of data to be transferred (eg. in bytes or "
2755 "megabytes), and C<position> may be the portion which has been transferred."
2759 #: ../src/guestfs.pod:1380
2760 msgid "The only defined and stable parts of the API are:"
2764 #: ../src/guestfs.pod:1386
2766 "The callback can display to the user some type of progress bar or indicator "
2767 "which shows the ratio of C<position>:C<total>."
2771 #: ../src/guestfs.pod:1391
2772 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2776 #: ../src/guestfs.pod:1395
2778 "If any progress notification is sent during a call, then a final progress "
2779 "notification is always sent when C<position> = C<total>."
2783 #: ../src/guestfs.pod:1398
2785 "This is to simplify caller code, so callers can easily set the progress "
2786 "indicator to \"100%\" at the end of the operation, without requiring special "
2787 "code to detect this case."
2791 #: ../src/guestfs.pod:1404
2793 "The callback also receives the procedure number and serial number of the "
2794 "call. These are only useful for debugging protocol issues, and the callback "
2795 "can normally ignore them. The callback may want to print these numbers in "
2796 "error messages or debugging messages."
2800 #: ../src/guestfs.pod:1409
2801 msgid "PRIVATE DATA AREA"
2805 #: ../src/guestfs.pod:1411
2807 "You can attach named pieces of private data to the libguestfs handle, and "
2808 "fetch them by name for the lifetime of the handle. This is called the "
2809 "private data area and is only available from the C API."
2813 #: ../src/guestfs.pod:1415
2814 msgid "To attach a named piece of data, use the following call:"
2818 #: ../src/guestfs.pod:1417
2821 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2826 #: ../src/guestfs.pod:1419
2828 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2829 "pointer (which can be C<NULL>). Any previous item with the same name is "
2834 #: ../src/guestfs.pod:1423
2836 "You can use any C<key> you want, but names beginning with an underscore "
2837 "character are reserved for internal libguestfs purposes (for implementing "
2838 "language bindings). It is recommended to prefix the name with some unique "
2839 "string to avoid collisions with other users."
2843 #: ../src/guestfs.pod:1428
2844 msgid "To retrieve the pointer, use:"
2848 #: ../src/guestfs.pod:1430
2851 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2856 #: ../src/guestfs.pod:1432
2858 "This function returns C<NULL> if either no data is found associated with "
2859 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2864 #: ../src/guestfs.pod:1436
2866 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2867 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2868 "all. In particular, libguestfs does I<not> try to free the data when the "
2869 "handle is closed. If the data must be freed, then the caller must either "
2870 "free it before calling L</guestfs_close> or must set up a close callback to "
2871 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2872 "can be registered for a handle)."
2876 #: ../src/guestfs.pod:1444
2878 "The private data area is implemented using a hash table, and should be "
2879 "reasonably efficient for moderate numbers of keys."
2883 #: ../src/guestfs.pod:1447
2884 msgid "BLOCK DEVICE NAMING"
2888 #: ../src/guestfs.pod:1449
2890 "In the kernel there is now quite a profusion of schemata for naming block "
2891 "devices (in this context, by I<block device> I mean a physical or virtual "
2892 "hard drive). The original Linux IDE driver used names starting with "
2893 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
2894 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
2895 "replacement for the old IDE driver (particularly for SATA devices) those "
2896 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
2897 "machines with paravirtualized drivers. This has created several different "
2898 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
2903 #: ../src/guestfs.pod:1461
2905 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2906 "Linux kernel to access block devices. We can run a variety of appliances "
2907 "based on a variety of Linux kernels."
2911 #: ../src/guestfs.pod:1465
2913 "This causes a problem for libguestfs because many API calls use device or "
2914 "partition names. Working scripts and the recipe (example) scripts that we "
2915 "make available over the internet could fail if the naming scheme changes."
2919 #: ../src/guestfs.pod:1470
2921 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2922 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2923 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2924 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2928 #: ../src/guestfs.pod:1476
2930 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2931 "L</guestfs_list_partitions> and similar calls return the true names of the "
2932 "devices and partitions as known to the appliance."
2936 #: ../src/guestfs.pod:1481
2937 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2941 #: ../src/guestfs.pod:1483
2943 "Usually this translation is transparent. However in some (very rare) cases "
2944 "you may need to know the exact algorithm. Such cases include where you use "
2945 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
2946 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
2951 #: ../src/guestfs.pod:1489
2953 "The algorithm is applied only to I<parameters> which are known to be either "
2954 "device or partition names. Return values from functions such as "
2955 "L</guestfs_list_devices> are never changed."
2959 #: ../src/guestfs.pod:1497
2960 msgid "Is the string a parameter which is a device or partition name?"
2964 #: ../src/guestfs.pod:1501
2965 msgid "Does the string begin with C</dev/sd>?"
2969 #: ../src/guestfs.pod:1505
2971 "Does the named device exist? If so, we use that device. However if I<not> "
2972 "then we continue with this algorithm."
2976 #: ../src/guestfs.pod:1510
2977 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2981 #: ../src/guestfs.pod:1512
2982 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2986 #: ../src/guestfs.pod:1514
2987 msgid "If that named device exists, use it. If not, continue."
2991 #: ../src/guestfs.pod:1518
2992 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2996 #: ../src/guestfs.pod:1520
2997 msgid "If that named device exists, use it. If not, return an error."
3001 #: ../src/guestfs.pod:1524
3002 msgid "PORTABILITY CONCERNS"
3006 #: ../src/guestfs.pod:1526
3008 "Although the standard naming scheme and automatic translation is useful for "
3009 "simple programs and guestfish scripts, for larger programs it is best not to "
3010 "rely on this mechanism."
3014 #: ../src/guestfs.pod:1530
3016 "Where possible for maximum future portability programs using libguestfs "
3017 "should use these future-proof techniques:"
3021 #: ../src/guestfs.pod:1537
3023 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
3024 "device names, and then use those names directly."
3028 #: ../src/guestfs.pod:1540
3029 msgid "Since those device names exist by definition, they will never be translated."
3033 #: ../src/guestfs.pod:1545
3035 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
3036 "filesystem labels."
3040 #: ../src/guestfs.pod:1550
3045 #: ../src/guestfs.pod:1552
3046 msgid "COMMUNICATION PROTOCOL"
3050 #: ../src/guestfs.pod:1554
3052 "Don't rely on using this protocol directly. This section documents how it "
3053 "currently works, but it may change at any time."
3057 #: ../src/guestfs.pod:1557
3059 "The protocol used to talk between the library and the daemon running inside "
3060 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3061 "1014, RFC 1832, RFC 4506)."
3065 #: ../src/guestfs.pod:1561
3067 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3068 "this file is automatically generated)."
3072 #: ../src/guestfs.pod:1564
3074 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3075 "and C<FileOut> parameters, which are handled with very simple request/reply "
3076 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3077 "parameters, which use the same request and reply messages, but they may also "
3078 "be followed by files sent using a chunked encoding."
3082 #: ../src/guestfs.pod:1571
3083 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3087 #: ../src/guestfs.pod:1573
3088 msgid "For ordinary functions, the request message is:"
3092 #: ../src/guestfs.pod:1575
3095 " total length (header + arguments,\n"
3096 " but not including the length word itself)\n"
3097 " struct guestfs_message_header (encoded as XDR)\n"
3098 " struct guestfs_<foo>_args (encoded as XDR)\n"
3103 #: ../src/guestfs.pod:1580
3105 "The total length field allows the daemon to allocate a fixed size buffer "
3106 "into which it slurps the rest of the message. As a result, the total length "
3107 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3108 "effective size of any request is limited to somewhere under this size."
3112 #: ../src/guestfs.pod:1586
3114 "Note also that many functions don't take any arguments, in which case the "
3115 "C<guestfs_I<foo>_args> is completely omitted."
3119 #: ../src/guestfs.pod:1589
3121 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3122 "receiver knows what type of args structure to expect, or none at all."
3126 #: ../src/guestfs.pod:1593
3127 msgid "The reply message for ordinary functions is:"
3131 #: ../src/guestfs.pod:1595
3134 " total length (header + ret,\n"
3135 " but not including the length word itself)\n"
3136 " struct guestfs_message_header (encoded as XDR)\n"
3137 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3142 #: ../src/guestfs.pod:1600
3144 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3145 "functions that return no formal return values."
3149 #: ../src/guestfs.pod:1603
3150 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3154 #: ../src/guestfs.pod:1606
3156 "In the case of an error, a flag is set in the header, and the reply message "
3157 "is slightly changed:"
3161 #: ../src/guestfs.pod:1609
3164 " total length (header + error,\n"
3165 " but not including the length word itself)\n"
3166 " struct guestfs_message_header (encoded as XDR)\n"
3167 " struct guestfs_message_error (encoded as XDR)\n"
3172 #: ../src/guestfs.pod:1614
3174 "The C<guestfs_message_error> structure contains the error message as a "
3179 #: ../src/guestfs.pod:1617
3180 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3184 #: ../src/guestfs.pod:1619
3186 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3187 "The normal request message is sent (see above). However this is followed by "
3188 "a sequence of file chunks."
3192 #: ../src/guestfs.pod:1623
3195 " total length (header + arguments,\n"
3196 " but not including the length word itself,\n"
3197 " and not including the chunks)\n"
3198 " struct guestfs_message_header (encoded as XDR)\n"
3199 " struct guestfs_<foo>_args (encoded as XDR)\n"
3200 " sequence of chunks for FileIn param #0\n"
3201 " sequence of chunks for FileIn param #1 etc.\n"
3206 #: ../src/guestfs.pod:1631
3207 msgid "The \"sequence of chunks\" is:"
3211 #: ../src/guestfs.pod:1633
3214 " length of chunk (not including length word itself)\n"
3215 " struct guestfs_chunk (encoded as XDR)\n"
3216 " length of chunk\n"
3217 " struct guestfs_chunk (encoded as XDR)\n"
3219 " length of chunk\n"
3220 " struct guestfs_chunk (with data.data_len == 0)\n"
3225 #: ../src/guestfs.pod:1641
3227 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3228 "is set in the final chunk to indicate either successful completion or early "
3233 #: ../src/guestfs.pod:1645
3235 "At time of writing there are no functions that have more than one FileIn "
3236 "parameter. However this is (theoretically) supported, by sending the "
3237 "sequence of chunks for each FileIn parameter one after another (from left to "
3242 #: ../src/guestfs.pod:1650
3244 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3245 "transfer. The library does this by sending a chunk with a special flag set "
3246 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3247 "RPC, does I<not> send any reply, and goes back to reading the next request."
3251 #: ../src/guestfs.pod:1656
3253 "The daemon may also cancel. It does this by writing a special word "
3254 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3255 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3256 "cancel chunk). The special word is chosen so that even if cancellation "
3257 "happens right at the end of the transfer (after the library has finished "
3258 "writing and has started listening for the reply), the \"spurious\" cancel "
3259 "flag will not be confused with the reply message."
3263 #: ../src/guestfs.pod:1665
3265 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3266 "limit), and also files where the size is not known in advance (eg. from "
3267 "pipes or sockets). However the chunks are rather small "
3268 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3269 "to keep much in memory."
3273 #: ../src/guestfs.pod:1671
3274 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3278 #: ../src/guestfs.pod:1673
3280 "The protocol for FileOut parameters is exactly the same as for FileIn "
3281 "parameters, but with the roles of daemon and library reversed."
3285 #: ../src/guestfs.pod:1676
3288 " total length (header + ret,\n"
3289 " but not including the length word itself,\n"
3290 " and not including the chunks)\n"
3291 " struct guestfs_message_header (encoded as XDR)\n"
3292 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3293 " sequence of chunks for FileOut param #0\n"
3294 " sequence of chunks for FileOut param #1 etc.\n"
3299 #: ../src/guestfs.pod:1684
3300 msgid "INITIAL MESSAGE"
3304 #: ../src/guestfs.pod:1686
3306 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3307 "which indicates that the guest and daemon is alive. This is what "
3308 "L</guestfs_launch> waits for."
3312 #: ../src/guestfs.pod:1690
3313 msgid "PROGRESS NOTIFICATION MESSAGES"
3317 #: ../src/guestfs.pod:1692
3319 "The daemon may send progress notification messages at any time. These are "
3320 "distinguished by the normal length word being replaced by "
3321 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3325 #: ../src/guestfs.pod:1696
3327 "The library turns them into progress callbacks (see "
3328 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3329 "discards them if not."
3333 #: ../src/guestfs.pod:1700
3335 "The daemon self-limits the frequency of progress messages it sends (see "
3336 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3341 #: ../src/guestfs.pod:1704
3342 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3346 #: ../src/guestfs.pod:1706
3348 "All high-level libguestfs actions are synchronous. If you want to use "
3349 "libguestfs asynchronously then you must create a thread."
3353 #: ../src/guestfs.pod:1709
3355 "Only use the handle from a single thread. Either use the handle exclusively "
3356 "from one thread, or provide your own mutex so that two threads cannot issue "
3357 "calls on the same handle at the same time."
3361 #: ../src/guestfs.pod:1713
3363 "See the graphical program guestfs-browser for one possible architecture for "
3364 "multithreaded programs using libvirt and libguestfs."
3368 #: ../src/guestfs.pod:1716
3369 msgid "QEMU WRAPPERS"
3373 #: ../src/guestfs.pod:1718
3375 "If you want to compile your own qemu, run qemu from a non-standard location, "
3376 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3381 #: ../src/guestfs.pod:1722
3383 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3384 "last command in the shell script (so that qemu replaces the shell and "
3385 "becomes the direct child of the libguestfs-using program). If you don't do "
3386 "this, then the qemu process won't be cleaned up correctly."
3390 #: ../src/guestfs.pod:1727
3392 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3397 #: ../src/guestfs.pod:1730
3401 " qemudir=/home/rjones/d/qemu\n"
3402 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
3408 #: ../src/guestfs.pod:1734
3410 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3411 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3416 #: ../src/guestfs.pod:1738
3419 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3424 #: ../src/guestfs.pod:1740
3426 "Note that libguestfs also calls qemu with the -help and -version options in "
3427 "order to determine features."
3431 #: ../src/guestfs.pod:1743
3432 msgid "LIBGUESTFS VERSION NUMBERS"
3436 #: ../src/guestfs.pod:1745
3438 "Since April 2010, libguestfs has started to make separate development and "
3439 "stable releases, along with corresponding branches in our git repository. "
3440 "These separate releases can be identified by version number:"
3444 #: ../src/guestfs.pod:1750
3447 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3448 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3454 " | `-------- sub-version\n"
3456 " `------ always '1' because we don't change the ABI\n"
3461 #: ../src/guestfs.pod:1761
3462 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3466 #: ../src/guestfs.pod:1763
3468 "As time passes we cherry pick fixes from the development branch and backport "
3469 "those into the stable branch, the effect being that the stable branch should "
3470 "get more stable and less buggy over time. So the stable releases are ideal "
3471 "for people who don't need new features but would just like the software to "
3476 #: ../src/guestfs.pod:1769
3477 msgid "Our criteria for backporting changes are:"
3481 #: ../src/guestfs.pod:1775
3483 "Documentation changes which don't affect any code are backported unless the "
3484 "documentation refers to a future feature which is not in stable."
3488 #: ../src/guestfs.pod:1781
3490 "Bug fixes which are not controversial, fix obvious problems, and have been "
3491 "well tested are backported."
3495 #: ../src/guestfs.pod:1786
3497 "Simple rearrangements of code which shouldn't affect how it works get "
3498 "backported. This is so that the code in the two branches doesn't get too "
3499 "far out of step, allowing us to backport future fixes more easily."
3503 #: ../src/guestfs.pod:1792
3505 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3506 "exceptional case: the new feature is required in order to implement an "
3507 "important bug fix."
3511 #: ../src/guestfs.pod:1798
3513 "A new stable branch starts when we think the new features in development are "
3514 "substantial and compelling enough over the current stable branch to warrant "
3515 "it. When that happens we create new stable and development versions 1.N.0 "
3516 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3517 "stable at this point, but by backporting fixes from development, that branch "
3518 "will stabilize over time."
3522 #: ../src/guestfs.pod:1806 ../fish/guestfish.pod:867 ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330 ../tools/virt-rescue.pl:255
3523 msgid "ENVIRONMENT VARIABLES"
3527 #: ../src/guestfs.pod:1810 ../fish/guestfish.pod:893
3528 msgid "LIBGUESTFS_APPEND"
3532 #: ../src/guestfs.pod:1812 ../fish/guestfish.pod:895
3533 msgid "Pass additional options to the guest kernel."
3537 #: ../src/guestfs.pod:1814 ../fish/guestfish.pod:897
3538 msgid "LIBGUESTFS_DEBUG"
3542 #: ../src/guestfs.pod:1816
3544 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3545 "effect as calling C<guestfs_set_verbose (g, 1)>."
3549 #: ../src/guestfs.pod:1819 ../fish/guestfish.pod:902
3550 msgid "LIBGUESTFS_MEMSIZE"
3554 #: ../src/guestfs.pod:1821 ../fish/guestfish.pod:904
3555 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
3559 #: ../src/guestfs.pod:1824 ../fish/guestfish.pod:907
3562 " LIBGUESTFS_MEMSIZE=700\n"
3567 #: ../src/guestfs.pod:1826 ../fish/guestfish.pod:909
3568 msgid "LIBGUESTFS_PATH"
3572 #: ../src/guestfs.pod:1828
3574 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3575 "the discussion of paths in section PATH above."
3579 #: ../src/guestfs.pod:1831 ../fish/guestfish.pod:914
3580 msgid "LIBGUESTFS_QEMU"
3584 #: ../src/guestfs.pod:1833 ../fish/guestfish.pod:916
3586 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3587 "which was found at compile time by the configure script is used."
3591 #: ../src/guestfs.pod:1837
3592 msgid "See also L</QEMU WRAPPERS> above."
3596 #: ../src/guestfs.pod:1839 ../fish/guestfish.pod:920
3597 msgid "LIBGUESTFS_TRACE"
3601 #: ../src/guestfs.pod:1841
3603 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3604 "effect as calling C<guestfs_set_trace (g, 1)>."
3608 #: ../src/guestfs.pod:1844 ../fish/guestfish.pod:929
3613 #: ../src/guestfs.pod:1846 ../fish/guestfish.pod:931
3614 msgid "Location of temporary directory, defaults to C</tmp>."
3618 #: ../src/guestfs.pod:1848 ../fish/guestfish.pod:933
3620 "If libguestfs was compiled to use the supermin appliance then the real "
3621 "appliance is cached in this directory, shared between all handles belonging "
3622 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
3623 "use in case C</tmp> is not large enough."
3627 #: ../src/guestfs.pod:1856 ../fish/guestfish.pod:991 ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:214 ../inspector/virt-inspector.pl:357 ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:484 ../tools/virt-df.pl:640 ../tools/virt-ls.pl:232 ../tools/virt-resize.pl:1486 ../tools/virt-list-filesystems.pl:186 ../tools/virt-cat.pl:185 ../tools/virt-tar.pl:281 ../tools/virt-rescue.pl:267 ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:254
3632 #: ../src/guestfs.pod:1858
3634 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
3635 "L<virt-edit(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
3636 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
3637 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
3638 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
3642 #: ../src/guestfs.pod:1876
3644 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
3645 "L<lvm(8)>, L<disktype(1)>."
3649 #: ../src/guestfs.pod:1883 ../tools/virt-win-reg.pl:499 ../tools/virt-make-fs.pl:548
3654 #: ../src/guestfs.pod:1885
3655 msgid "To get a list of bugs against libguestfs use this link:"
3659 #: ../src/guestfs.pod:1887
3660 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
3664 #: ../src/guestfs.pod:1889
3665 msgid "To report a new bug against libguestfs use this link:"
3669 #: ../src/guestfs.pod:1891
3670 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
3674 #: ../src/guestfs.pod:1893
3675 msgid "When reporting a bug, please check:"
3679 #: ../src/guestfs.pod:1899
3680 msgid "That the bug hasn't been reported already."
3684 #: ../src/guestfs.pod:1903
3685 msgid "That you are testing a recent version."
3689 #: ../src/guestfs.pod:1907
3690 msgid "Describe the bug accurately, and give a way to reproduce it."
3694 #: ../src/guestfs.pod:1911
3696 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3701 #: ../src/guestfs.pod:1916 ../fish/guestfish.pod:1008 ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:225 ../inspector/virt-inspector.pl:366
3706 #: ../src/guestfs.pod:1918 ../fish/guestfish.pod:1010 ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:227
3707 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3711 #: ../src/guestfs.pod:1920 ../fish/guestfish.pod:1012 ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:229 ../inspector/virt-inspector.pl:380 ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:514 ../tools/virt-df.pl:653 ../tools/virt-ls.pl:247 ../tools/virt-resize.pl:1512 ../tools/virt-list-filesystems.pl:202 ../tools/virt-cat.pl:199 ../tools/virt-tar.pl:296 ../tools/virt-rescue.pl:281 ../tools/virt-make-fs.pl:563 ../tools/virt-list-partitions.pl:269
3716 #: ../src/guestfs.pod:1922 ../fish/guestfish.pod:1014 ../fuse/guestmount.pod:231
3717 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3721 #: ../src/guestfs.pod:1925
3723 "This library is free software; you can redistribute it and/or modify it "
3724 "under the terms of the GNU Lesser General Public License as published by the "
3725 "Free Software Foundation; either version 2 of the License, or (at your "
3726 "option) any later version."
3730 #: ../src/guestfs.pod:1930
3732 "This library is distributed in the hope that it will be useful, but WITHOUT "
3733 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3734 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3739 #: ../src/guestfs.pod:1935
3741 "You should have received a copy of the GNU Lesser General Public License "
3742 "along with this library; if not, write to the Free Software Foundation, "
3743 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3747 #: ../src/guestfs-actions.pod:1
3748 msgid "guestfs_add_cdrom"
3752 #: ../src/guestfs-actions.pod:3
3755 " int guestfs_add_cdrom (guestfs_h *g,\n"
3756 "\t\tconst char *filename);\n"
3761 #: ../src/guestfs-actions.pod:6 ../fish/guestfish-actions.pod:5
3762 msgid "This function adds a virtual CD-ROM disk image to the guest."
3766 #: ../src/guestfs-actions.pod:8 ../fish/guestfish-actions.pod:7
3767 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3771 #: ../src/guestfs-actions.pod:16
3773 "This call checks for the existence of C<filename>. This stops you from "
3774 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3775 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3780 #: ../src/guestfs-actions.pod:23
3782 "If you just want to add an ISO file (often you use this as an efficient way "
3783 "to transfer large files into the guest), then you should probably use "
3784 "C<guestfs_add_drive_ro> instead."
3788 #: ../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:2525 ../src/guestfs-actions.pod:2537 ../src/guestfs-actions.pod:2554 ../src/guestfs-actions.pod:2662 ../src/guestfs-actions.pod:2673 ../src/guestfs-actions.pod:2683 ../src/guestfs-actions.pod:2694 ../src/guestfs-actions.pod:2706 ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:2800 ../src/guestfs-actions.pod:2817 ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:2851 ../src/guestfs-actions.pod:2871 ../src/guestfs-actions.pod:2900 ../src/guestfs-actions.pod:2916 ../src/guestfs-actions.pod:2932 ../src/guestfs-actions.pod:2961 ../src/guestfs-actions.pod:2970 ../src/guestfs-actions.pod:3003 ../src/guestfs-actions.pod:3016 ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3038 ../src/guestfs-actions.pod:3052 ../src/guestfs-actions.pod:3132 ../src/guestfs-actions.pod:3149 ../src/guestfs-actions.pod:3159 ../src/guestfs-actions.pod:3204 ../src/guestfs-actions.pod:3219 ../src/guestfs-actions.pod:3234 ../src/guestfs-actions.pod:3247 ../src/guestfs-actions.pod:3258 ../src/guestfs-actions.pod:3269 ../src/guestfs-actions.pod:3283 ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3312 ../src/guestfs-actions.pod:3358 ../src/guestfs-actions.pod:3386 ../src/guestfs-actions.pod:3402 ../src/guestfs-actions.pod:3418 ../src/guestfs-actions.pod:3427 ../src/guestfs-actions.pod:3441 ../src/guestfs-actions.pod:3451 ../src/guestfs-actions.pod:3463 ../src/guestfs-actions.pod:3475 ../src/guestfs-actions.pod:3507 ../src/guestfs-actions.pod:3519 ../src/guestfs-actions.pod:3536 ../src/guestfs-actions.pod:3547 ../src/guestfs-actions.pod:3561 ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3632 ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:3668 ../src/guestfs-actions.pod:3682 ../src/guestfs-actions.pod:3697 ../src/guestfs-actions.pod:3819 ../src/guestfs-actions.pod:3871 ../src/guestfs-actions.pod:3890 ../src/guestfs-actions.pod:3905 ../src/guestfs-actions.pod:3931 ../src/guestfs-actions.pod:3988 ../src/guestfs-actions.pod:4002 ../src/guestfs-actions.pod:4012 ../src/guestfs-actions.pod:4023 ../src/guestfs-actions.pod:4278 ../src/guestfs-actions.pod:4294 ../src/guestfs-actions.pod:4305 ../src/guestfs-actions.pod:4314 ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:4334 ../src/guestfs-actions.pod:4345 ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:4392 ../src/guestfs-actions.pod:4408 ../src/guestfs-actions.pod:4423 ../src/guestfs-actions.pod:4443 ../src/guestfs-actions.pod:4458 ../src/guestfs-actions.pod:4474 ../src/guestfs-actions.pod:4492 ../src/guestfs-actions.pod:4508 ../src/guestfs-actions.pod:4522 ../src/guestfs-actions.pod:4547 ../src/guestfs-actions.pod:4568 ../src/guestfs-actions.pod:4584 ../src/guestfs-actions.pod:4605 ../src/guestfs-actions.pod:4617 ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4645 ../src/guestfs-actions.pod:4679 ../src/guestfs-actions.pod:4699 ../src/guestfs-actions.pod:4722 ../src/guestfs-actions.pod:4812 ../src/guestfs-actions.pod:4918 ../src/guestfs-actions.pod:4927 ../src/guestfs-actions.pod:4937 ../src/guestfs-actions.pod:4947 ../src/guestfs-actions.pod:4966 ../src/guestfs-actions.pod:4976 ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:4996 ../src/guestfs-actions.pod:5008 ../src/guestfs-actions.pod:5058 ../src/guestfs-actions.pod:5072 ../src/guestfs-actions.pod:5085 ../src/guestfs-actions.pod:5098 ../src/guestfs-actions.pod:5112 ../src/guestfs-actions.pod:5122 ../src/guestfs-actions.pod:5139 ../src/guestfs-actions.pod:5169 ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5215 ../src/guestfs-actions.pod:5225 ../src/guestfs-actions.pod:5240 ../src/guestfs-actions.pod:5266 ../src/guestfs-actions.pod:5294 ../src/guestfs-actions.pod:5398 ../src/guestfs-actions.pod:5413 ../src/guestfs-actions.pod:5424 ../src/guestfs-actions.pod:5470 ../src/guestfs-actions.pod:5480 ../src/guestfs-actions.pod:5517 ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5586 ../src/guestfs-actions.pod:5609 ../src/guestfs-actions.pod:5666 ../src/guestfs-actions.pod:5682 ../src/guestfs-actions.pod:5708
3789 msgid "This function returns 0 on success or -1 on error."
3793 #: ../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
3795 "This function is deprecated. In new code, use the C<add_drive_opts> call "
3800 #: ../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:5617 ../src/guestfs-actions.pod:5762 ../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:4333 ../fish/guestfish-actions.pod:4430
3802 "Deprecated functions will not be removed from the API, but the fact that "
3803 "they are deprecated indicates that there are problems with correct use of "
3808 #: ../src/guestfs-actions.pod:38
3809 msgid "guestfs_add_drive"
3813 #: ../src/guestfs-actions.pod:40
3816 " int guestfs_add_drive (guestfs_h *g,\n"
3817 "\t\tconst char *filename);\n"
3822 #: ../src/guestfs-actions.pod:43
3824 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
3825 "optional parameters, so the disk is added writable, with the format being "
3826 "detected automatically."
3830 #: ../src/guestfs-actions.pod:47
3832 "Automatic detection of the format opens you up to a potential security hole "
3833 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3834 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
3835 "you should think about replacing calls to this function with calls to "
3836 "C<guestfs_add_drive_opts>, and specifying the format."
3840 #: ../src/guestfs-actions.pod:56
3841 msgid "guestfs_add_drive_opts"
3845 #: ../src/guestfs-actions.pod:58
3848 " int guestfs_add_drive_opts (guestfs_h *g,\n"
3849 "\t\tconst char *filename,\n"
3855 #: ../src/guestfs-actions.pod:62
3857 "You may supply a list of optional arguments to this call. Use zero or more "
3858 "of the following pairs of parameters, and terminate the list with C<-1> on "
3859 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
3863 #: ../src/guestfs-actions.pod:67
3866 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
3867 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
3868 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
3873 #: ../src/guestfs-actions.pod:71 ../fish/guestfish-actions.pod:56
3875 "This function adds a virtual machine disk image C<filename> to libguestfs. "
3876 "The first time you call this function, the disk appears as C</dev/sda>, the "
3877 "second time as C</dev/sdb>, and so on."
3881 #: ../src/guestfs-actions.pod:76 ../fish/guestfish-actions.pod:61
3883 "You don't necessarily need to be root when using libguestfs. However you "
3884 "obviously do need sufficient permissions to access the filename for whatever "
3885 "operations you want to perform (ie. read access if you just want to read the "
3886 "image or write access if you want to modify the image)."
3890 #: ../src/guestfs-actions.pod:82 ../fish/guestfish-actions.pod:67
3891 msgid "This call checks that C<filename> exists."
3895 #: ../src/guestfs-actions.pod:84 ../fish/guestfish-actions.pod:69
3896 msgid "The optional arguments are:"
3900 #: ../src/guestfs-actions.pod:88 ../fish/guestfish-actions.pod:73
3905 #: ../src/guestfs-actions.pod:90 ../fish/guestfish-actions.pod:75
3907 "If true then the image is treated as read-only. Writes are still allowed, "
3908 "but they are stored in a temporary snapshot overlay which is discarded at "
3909 "the end. The disk that you add is not modified."
3913 #: ../src/guestfs-actions.pod:94 ../fish/guestfish-actions.pod:79
3918 #: ../src/guestfs-actions.pod:96
3920 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
3921 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
3922 "Possible formats include C<raw> and C<qcow2>."
3926 #: ../src/guestfs-actions.pod:100 ../fish/guestfish-actions.pod:85
3928 "Automatic detection of the format opens you up to a potential security hole "
3929 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
3930 "RHBZ#642934. Specifying the format closes this security hole."
3934 #: ../src/guestfs-actions.pod:105 ../fish/guestfish-actions.pod:90
3939 #: ../src/guestfs-actions.pod:107
3941 "This rarely-used option lets you emulate the behaviour of the deprecated "
3942 "C<guestfs_add_drive_with_if> call (q.v.)"
3946 #: ../src/guestfs-actions.pod:114
3947 msgid "guestfs_add_drive_opts_va"
3951 #: ../src/guestfs-actions.pod:116
3954 " int guestfs_add_drive_opts_va (guestfs_h *g,\n"
3955 "\t\tconst char *filename,\n"
3956 "\t\tva_list args);\n"
3961 #: ../src/guestfs-actions.pod:120
3962 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
3966 #: ../src/guestfs-actions.pod:122 ../src/guestfs-actions.pod:132
3967 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
3971 #: ../src/guestfs-actions.pod:124
3972 msgid "guestfs_add_drive_opts_argv"
3976 #: ../src/guestfs-actions.pod:126
3979 " int guestfs_add_drive_opts_argv (guestfs_h *g,\n"
3980 "\t\tconst char *filename,\n"
3981 "\t\tconst struct guestfs_add_drive_opts_argv *optargs);\n"
3986 #: ../src/guestfs-actions.pod:130
3987 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
3991 #: ../src/guestfs-actions.pod:134
3992 msgid "guestfs_add_drive_ro"
3996 #: ../src/guestfs-actions.pod:136
3999 " int guestfs_add_drive_ro (guestfs_h *g,\n"
4000 "\t\tconst char *filename);\n"
4005 #: ../src/guestfs-actions.pod:139
4007 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4008 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4009 "disk is added read-only, with the format being detected automatically."
4013 #: ../src/guestfs-actions.pod:146
4014 msgid "guestfs_add_drive_ro_with_if"
4018 #: ../src/guestfs-actions.pod:148
4021 " int guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4022 "\t\tconst char *filename,\n"
4023 "\t\tconst char *iface);\n"
4028 #: ../src/guestfs-actions.pod:152
4030 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4031 "QEMU interface emulation to use at run time."
4035 #: ../src/guestfs-actions.pod:164
4036 msgid "guestfs_add_drive_with_if"
4040 #: ../src/guestfs-actions.pod:166
4043 " int guestfs_add_drive_with_if (guestfs_h *g,\n"
4044 "\t\tconst char *filename,\n"
4045 "\t\tconst char *iface);\n"
4050 #: ../src/guestfs-actions.pod:170
4052 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4053 "QEMU interface emulation to use at run time."
4057 #: ../src/guestfs-actions.pod:182
4058 msgid "guestfs_aug_clear"
4062 #: ../src/guestfs-actions.pod:184
4065 " int guestfs_aug_clear (guestfs_h *g,\n"
4066 "\t\tconst char *augpath);\n"
4071 #: ../src/guestfs-actions.pod:187 ../fish/guestfish-actions.pod:142
4073 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4074 "L<augtool(1)> C<clear> command."
4078 #: ../src/guestfs-actions.pod:192
4079 msgid "guestfs_aug_close"
4083 #: ../src/guestfs-actions.pod:194
4086 " int guestfs_aug_close (guestfs_h *g);\n"
4091 #: ../src/guestfs-actions.pod:196
4093 "Close the current Augeas handle and free up any resources used by it. After "
4094 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4095 "any other Augeas functions."
4099 #: ../src/guestfs-actions.pod:203
4100 msgid "guestfs_aug_defnode"
4104 #: ../src/guestfs-actions.pod:205
4107 " struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,\n"
4108 "\t\tconst char *name,\n"
4109 "\t\tconst char *expr,\n"
4110 "\t\tconst char *val);\n"
4115 #: ../src/guestfs-actions.pod:210 ../fish/guestfish-actions.pod:158
4116 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4120 #: ../src/guestfs-actions.pod:213
4122 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4123 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4124 "containing that single node."
4128 #: ../src/guestfs-actions.pod:217 ../fish/guestfish-actions.pod:165
4130 "On success this returns a pair containing the number of nodes in the "
4131 "nodeset, and a boolean flag if a node was created."
4135 #: ../src/guestfs-actions.pod:221
4137 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4138 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4142 #: ../src/guestfs-actions.pod:225
4143 msgid "guestfs_aug_defvar"
4147 #: ../src/guestfs-actions.pod:227
4150 " int guestfs_aug_defvar (guestfs_h *g,\n"
4151 "\t\tconst char *name,\n"
4152 "\t\tconst char *expr);\n"
4157 #: ../src/guestfs-actions.pod:231 ../fish/guestfish-actions.pod:173
4159 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4160 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4164 #: ../src/guestfs-actions.pod:235 ../fish/guestfish-actions.pod:177
4166 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4167 "evaluates to something which is not a nodeset."
4171 #: ../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:3621 ../src/guestfs-actions.pod:3728 ../src/guestfs-actions.pod:4082 ../src/guestfs-actions.pod:4105 ../src/guestfs-actions.pod:5204 ../src/guestfs-actions.pod:5554 ../src/guestfs-actions.pod:5564 ../src/guestfs-actions.pod:5574
4172 msgid "On error this function returns -1."
4176 #: ../src/guestfs-actions.pod:240
4177 msgid "guestfs_aug_get"
4181 #: ../src/guestfs-actions.pod:242
4184 " char *guestfs_aug_get (guestfs_h *g,\n"
4185 "\t\tconst char *augpath);\n"
4190 #: ../src/guestfs-actions.pod:245 ../fish/guestfish-actions.pod:184
4192 "Look up the value associated with C<path>. If C<path> matches exactly one "
4193 "node, the C<value> is returned."
4197 #: ../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:2336 ../src/guestfs-actions.pod:2651 ../src/guestfs-actions.pod:2948 ../src/guestfs-actions.pod:3089 ../src/guestfs-actions.pod:3185 ../src/guestfs-actions.pod:3743 ../src/guestfs-actions.pod:3919 ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4221 ../src/guestfs-actions.pod:4264 ../src/guestfs-actions.pod:4740 ../src/guestfs-actions.pod:4753 ../src/guestfs-actions.pod:4767 ../src/guestfs-actions.pod:4788 ../src/guestfs-actions.pod:5347 ../src/guestfs-actions.pod:5363 ../src/guestfs-actions.pod:5378 ../src/guestfs-actions.pod:5526 ../src/guestfs-actions.pod:5756
4199 "This function returns a string, or NULL on error. I<The caller must free "
4200 "the returned string after use>."
4204 #: ../src/guestfs-actions.pod:251
4205 msgid "guestfs_aug_init"
4209 #: ../src/guestfs-actions.pod:253
4212 " int guestfs_aug_init (guestfs_h *g,\n"
4213 "\t\tconst char *root,\n"
4219 #: ../src/guestfs-actions.pod:257 ../fish/guestfish-actions.pod:191
4221 "Create a new Augeas handle for editing configuration files. If there was "
4222 "any previous Augeas handle associated with this guestfs session, then it is "
4227 #: ../src/guestfs-actions.pod:261
4228 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4232 #: ../src/guestfs-actions.pod:264 ../fish/guestfish-actions.pod:198
4233 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4237 #: ../src/guestfs-actions.pod:267 ../fish/guestfish-actions.pod:201
4239 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4240 "logical I<or> of the following integers:"
4244 #: ../src/guestfs-actions.pod:273 ../fish/guestfish-actions.pod:207
4245 msgid "C<AUG_SAVE_BACKUP> = 1"
4249 #: ../src/guestfs-actions.pod:275 ../fish/guestfish-actions.pod:209
4250 msgid "Keep the original file with a C<.augsave> extension."
4254 #: ../src/guestfs-actions.pod:277 ../fish/guestfish-actions.pod:211
4255 msgid "C<AUG_SAVE_NEWFILE> = 2"
4259 #: ../src/guestfs-actions.pod:279 ../fish/guestfish-actions.pod:213
4261 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4262 "original. Overrides C<AUG_SAVE_BACKUP>."
4266 #: ../src/guestfs-actions.pod:282 ../fish/guestfish-actions.pod:216
4267 msgid "C<AUG_TYPE_CHECK> = 4"
4271 #: ../src/guestfs-actions.pod:284 ../fish/guestfish-actions.pod:218
4272 msgid "Typecheck lenses (can be expensive)."
4276 #: ../src/guestfs-actions.pod:286 ../fish/guestfish-actions.pod:220
4277 msgid "C<AUG_NO_STDINC> = 8"
4281 #: ../src/guestfs-actions.pod:288 ../fish/guestfish-actions.pod:222
4282 msgid "Do not use standard load path for modules."
4286 #: ../src/guestfs-actions.pod:290 ../fish/guestfish-actions.pod:224
4287 msgid "C<AUG_SAVE_NOOP> = 16"
4291 #: ../src/guestfs-actions.pod:292 ../fish/guestfish-actions.pod:226
4292 msgid "Make save a no-op, just record what would have been changed."
4296 #: ../src/guestfs-actions.pod:294 ../fish/guestfish-actions.pod:228
4297 msgid "C<AUG_NO_LOAD> = 32"
4301 #: ../src/guestfs-actions.pod:296
4302 msgid "Do not load the tree in C<guestfs_aug_init>."
4306 #: ../src/guestfs-actions.pod:300
4307 msgid "To close the handle, you can call C<guestfs_aug_close>."
4311 #: ../src/guestfs-actions.pod:302 ../fish/guestfish-actions.pod:236
4312 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4316 #: ../src/guestfs-actions.pod:306
4317 msgid "guestfs_aug_insert"
4321 #: ../src/guestfs-actions.pod:308
4324 " int guestfs_aug_insert (guestfs_h *g,\n"
4325 "\t\tconst char *augpath,\n"
4326 "\t\tconst char *label,\n"
4327 "\t\tint before);\n"
4332 #: ../src/guestfs-actions.pod:313 ../fish/guestfish-actions.pod:242
4334 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4335 "or after C<path> (depending on the boolean flag C<before>)."
4339 #: ../src/guestfs-actions.pod:317 ../fish/guestfish-actions.pod:246
4341 "C<path> must match exactly one existing node in the tree, and C<label> must "
4342 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4346 #: ../src/guestfs-actions.pod:323
4347 msgid "guestfs_aug_load"
4351 #: ../src/guestfs-actions.pod:325
4354 " int guestfs_aug_load (guestfs_h *g);\n"
4359 #: ../src/guestfs-actions.pod:327 ../fish/guestfish-actions.pod:254
4360 msgid "Load files into the tree."
4364 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:256
4365 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4369 #: ../src/guestfs-actions.pod:334
4370 msgid "guestfs_aug_ls"
4374 #: ../src/guestfs-actions.pod:336
4377 " char **guestfs_aug_ls (guestfs_h *g,\n"
4378 "\t\tconst char *augpath);\n"
4383 #: ../src/guestfs-actions.pod:339
4385 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
4386 "sorting the resulting nodes into alphabetical order."
4390 #: ../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:2375 ../src/guestfs-actions.pod:2580 ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:3066 ../src/guestfs-actions.pod:3588 ../src/guestfs-actions.pod:4037 ../src/guestfs-actions.pod:4146 ../src/guestfs-actions.pod:4252 ../src/guestfs-actions.pod:4801 ../src/guestfs-actions.pod:4850 ../src/guestfs-actions.pod:4902 ../src/guestfs-actions.pod:5018 ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5439 ../src/guestfs-actions.pod:5456 ../src/guestfs-actions.pod:5494 ../src/guestfs-actions.pod:5630 ../src/guestfs-actions.pod:5646 ../src/guestfs-actions.pod:5719 ../src/guestfs-actions.pod:5735 ../src/guestfs-actions.pod:5775 ../src/guestfs-actions.pod:5791
4392 "This function returns a NULL-terminated array of strings (like "
4393 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
4394 "strings and the array after use>."
4398 #: ../src/guestfs-actions.pod:346
4399 msgid "guestfs_aug_match"
4403 #: ../src/guestfs-actions.pod:348
4406 " char **guestfs_aug_match (guestfs_h *g,\n"
4407 "\t\tconst char *augpath);\n"
4412 #: ../src/guestfs-actions.pod:351 ../fish/guestfish-actions.pod:270
4414 "Returns a list of paths which match the path expression C<path>. The "
4415 "returned paths are sufficiently qualified so that they match exactly one "
4416 "node in the current tree."
4420 #: ../src/guestfs-actions.pod:359
4421 msgid "guestfs_aug_mv"
4425 #: ../src/guestfs-actions.pod:361
4428 " int guestfs_aug_mv (guestfs_h *g,\n"
4429 "\t\tconst char *src,\n"
4430 "\t\tconst char *dest);\n"
4435 #: ../src/guestfs-actions.pod:365 ../fish/guestfish-actions.pod:278
4437 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4438 "C<dest> is overwritten if it exists."
4442 #: ../src/guestfs-actions.pod:370
4443 msgid "guestfs_aug_rm"
4447 #: ../src/guestfs-actions.pod:372
4450 " int guestfs_aug_rm (guestfs_h *g,\n"
4451 "\t\tconst char *augpath);\n"
4456 #: ../src/guestfs-actions.pod:375 ../fish/guestfish-actions.pod:285
4457 msgid "Remove C<path> and all of its children."
4461 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:287
4462 msgid "On success this returns the number of entries which were removed."
4466 #: ../src/guestfs-actions.pod:381
4467 msgid "guestfs_aug_save"
4471 #: ../src/guestfs-actions.pod:383
4474 " int guestfs_aug_save (guestfs_h *g);\n"
4479 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:293
4480 msgid "This writes all pending changes to disk."
4484 #: ../src/guestfs-actions.pod:387
4486 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4491 #: ../src/guestfs-actions.pod:392
4492 msgid "guestfs_aug_set"
4496 #: ../src/guestfs-actions.pod:394
4499 " int guestfs_aug_set (guestfs_h *g,\n"
4500 "\t\tconst char *augpath,\n"
4501 "\t\tconst char *val);\n"
4506 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:302
4507 msgid "Set the value associated with C<path> to C<val>."
4511 #: ../src/guestfs-actions.pod:400
4513 "In the Augeas API, it is possible to clear a node by setting the value to "
4514 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4515 "this call. Instead you must use the C<guestfs_aug_clear> call."
4519 #: ../src/guestfs-actions.pod:407
4520 msgid "guestfs_available"
4524 #: ../src/guestfs-actions.pod:409
4527 " int guestfs_available (guestfs_h *g,\n"
4528 "\t\tchar *const *groups);\n"
4533 #: ../src/guestfs-actions.pod:412 ../fish/guestfish-actions.pod:313
4535 "This command is used to check the availability of some groups of "
4536 "functionality in the appliance, which not all builds of the libguestfs "
4537 "appliance will be able to provide."
4541 #: ../src/guestfs-actions.pod:416
4543 "The libguestfs groups, and the functions that those groups correspond to, "
4544 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4545 "runtime by calling C<guestfs_available_all_groups>."
4549 #: ../src/guestfs-actions.pod:421 ../fish/guestfish-actions.pod:322
4551 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4552 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4553 "and Augeas (configuration file editing) functions."
4557 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:327
4558 msgid "The command returns no error if I<all> requested groups are available."
4562 #: ../src/guestfs-actions.pod:428 ../fish/guestfish-actions.pod:329
4564 "It fails with an error if one or more of the requested groups is unavailable "
4569 #: ../src/guestfs-actions.pod:431 ../fish/guestfish-actions.pod:332
4571 "If an unknown group name is included in the list of groups then an error is "
4576 #: ../src/guestfs-actions.pod:434 ../fish/guestfish-actions.pod:335
4581 #: ../src/guestfs-actions.pod:440
4582 msgid "You must call C<guestfs_launch> before calling this function."
4586 #: ../src/guestfs-actions.pod:442 ../fish/guestfish-actions.pod:343
4588 "The reason is because we don't know what groups are supported by the "
4589 "appliance/daemon until it is running and can be queried."
4593 #: ../src/guestfs-actions.pod:448 ../fish/guestfish-actions.pod:349
4595 "If a group of functions is available, this does not necessarily mean that "
4596 "they will work. You still have to check for errors when calling individual "
4597 "API functions even if they are available."
4601 #: ../src/guestfs-actions.pod:455 ../fish/guestfish-actions.pod:356
4603 "It is usually the job of distro packagers to build complete functionality "
4604 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4605 "with all requirements satisfied, will support everything."
4609 #: ../src/guestfs-actions.pod:462
4611 "This call was added in version C<1.0.80>. In previous versions of "
4612 "libguestfs all you could do would be to speculatively execute a command to "
4613 "find out if the daemon implemented it. See also C<guestfs_version>."
4617 #: ../src/guestfs-actions.pod:471
4618 msgid "guestfs_available_all_groups"
4622 #: ../src/guestfs-actions.pod:473
4625 " char **guestfs_available_all_groups (guestfs_h *g);\n"
4630 #: ../src/guestfs-actions.pod:475
4632 "This command returns a list of all optional groups that this daemon knows "
4633 "about. Note this returns both supported and unsupported groups. To find "
4634 "out which ones the daemon can actually support you have to call "
4635 "C<guestfs_available> on each member of the returned list."
4639 #: ../src/guestfs-actions.pod:481
4640 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4644 #: ../src/guestfs-actions.pod:487
4645 msgid "guestfs_base64_in"
4649 #: ../src/guestfs-actions.pod:489
4652 " int guestfs_base64_in (guestfs_h *g,\n"
4653 "\t\tconst char *base64file,\n"
4654 "\t\tconst char *filename);\n"
4659 #: ../src/guestfs-actions.pod:493 ../fish/guestfish-actions.pod:386
4660 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4664 #: ../src/guestfs-actions.pod:498
4665 msgid "guestfs_base64_out"
4669 #: ../src/guestfs-actions.pod:500
4672 " int guestfs_base64_out (guestfs_h *g,\n"
4673 "\t\tconst char *filename,\n"
4674 "\t\tconst char *base64file);\n"
4679 #: ../src/guestfs-actions.pod:504 ../fish/guestfish-actions.pod:395
4681 "This command downloads the contents of C<filename>, writing it out to local "
4682 "file C<base64file> encoded as base64."
4686 #: ../src/guestfs-actions.pod:509
4687 msgid "guestfs_blockdev_flushbufs"
4691 #: ../src/guestfs-actions.pod:511
4694 " int guestfs_blockdev_flushbufs (guestfs_h *g,\n"
4695 "\t\tconst char *device);\n"
4700 #: ../src/guestfs-actions.pod:514 ../fish/guestfish-actions.pod:404
4701 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4705 #: ../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
4706 msgid "This uses the L<blockdev(8)> command."
4710 #: ../src/guestfs-actions.pod:521
4711 msgid "guestfs_blockdev_getbsz"
4715 #: ../src/guestfs-actions.pod:523
4718 " int guestfs_blockdev_getbsz (guestfs_h *g,\n"
4719 "\t\tconst char *device);\n"
4724 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:413
4725 msgid "This returns the block size of a device."
4729 #: ../src/guestfs-actions.pod:528 ../src/guestfs-actions.pod:610 ../fish/guestfish-actions.pod:415 ../fish/guestfish-actions.pod:478
4731 "(Note this is different from both I<size in blocks> and I<filesystem block "
4736 #: ../src/guestfs-actions.pod:535
4737 msgid "guestfs_blockdev_getro"
4741 #: ../src/guestfs-actions.pod:537
4744 " int guestfs_blockdev_getro (guestfs_h *g,\n"
4745 "\t\tconst char *device);\n"
4750 #: ../src/guestfs-actions.pod:540 ../fish/guestfish-actions.pod:424
4752 "Returns a boolean indicating if the block device is read-only (true if "
4753 "read-only, false if not)."
4757 #: ../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:2389 ../src/guestfs-actions.pod:2400 ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2436 ../src/guestfs-actions.pod:2448 ../src/guestfs-actions.pod:2461 ../src/guestfs-actions.pod:2472 ../src/guestfs-actions.pod:2482 ../src/guestfs-actions.pod:2493 ../src/guestfs-actions.pod:2505 ../src/guestfs-actions.pod:2517 ../src/guestfs-actions.pod:3713
4758 msgid "This function returns a C truth value on success or -1 on error."
4762 #: ../src/guestfs-actions.pod:547
4763 msgid "guestfs_blockdev_getsize64"
4767 #: ../src/guestfs-actions.pod:549
4770 " int64_t guestfs_blockdev_getsize64 (guestfs_h *g,\n"
4771 "\t\tconst char *device);\n"
4776 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:433
4777 msgid "This returns the size of the device in bytes."
4781 #: ../src/guestfs-actions.pod:554
4782 msgid "See also C<guestfs_blockdev_getsz>."
4786 #: ../src/guestfs-actions.pod:560
4787 msgid "guestfs_blockdev_getss"
4791 #: ../src/guestfs-actions.pod:562
4794 " int guestfs_blockdev_getss (guestfs_h *g,\n"
4795 "\t\tconst char *device);\n"
4800 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:443
4802 "This returns the size of sectors on a block device. Usually 512, but can be "
4803 "larger for modern devices."
4807 #: ../src/guestfs-actions.pod:568
4809 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
4814 #: ../src/guestfs-actions.pod:575
4815 msgid "guestfs_blockdev_getsz"
4819 #: ../src/guestfs-actions.pod:577
4822 " int64_t guestfs_blockdev_getsz (guestfs_h *g,\n"
4823 "\t\tconst char *device);\n"
4828 #: ../src/guestfs-actions.pod:580 ../fish/guestfish-actions.pod:455
4830 "This returns the size of the device in units of 512-byte sectors (even if "
4831 "the sectorsize isn't 512 bytes ... weird)."
4835 #: ../src/guestfs-actions.pod:583
4837 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
4838 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
4842 #: ../src/guestfs-actions.pod:591
4843 msgid "guestfs_blockdev_rereadpt"
4847 #: ../src/guestfs-actions.pod:593
4850 " int guestfs_blockdev_rereadpt (guestfs_h *g,\n"
4851 "\t\tconst char *device);\n"
4856 #: ../src/guestfs-actions.pod:596 ../fish/guestfish-actions.pod:468
4857 msgid "Reread the partition table on C<device>."
4861 #: ../src/guestfs-actions.pod:602
4862 msgid "guestfs_blockdev_setbsz"
4866 #: ../src/guestfs-actions.pod:604
4869 " int guestfs_blockdev_setbsz (guestfs_h *g,\n"
4870 "\t\tconst char *device,\n"
4871 "\t\tint blocksize);\n"
4876 #: ../src/guestfs-actions.pod:608 ../fish/guestfish-actions.pod:476
4877 msgid "This sets the block size of a device."
4881 #: ../src/guestfs-actions.pod:617
4882 msgid "guestfs_blockdev_setro"
4886 #: ../src/guestfs-actions.pod:619
4889 " int guestfs_blockdev_setro (guestfs_h *g,\n"
4890 "\t\tconst char *device);\n"
4895 #: ../src/guestfs-actions.pod:622 ../fish/guestfish-actions.pod:487
4896 msgid "Sets the block device named C<device> to read-only."
4900 #: ../src/guestfs-actions.pod:628
4901 msgid "guestfs_blockdev_setrw"
4905 #: ../src/guestfs-actions.pod:630
4908 " int guestfs_blockdev_setrw (guestfs_h *g,\n"
4909 "\t\tconst char *device);\n"
4914 #: ../src/guestfs-actions.pod:633 ../fish/guestfish-actions.pod:495
4915 msgid "Sets the block device named C<device> to read-write."
4919 #: ../src/guestfs-actions.pod:639
4920 msgid "guestfs_case_sensitive_path"
4924 #: ../src/guestfs-actions.pod:641
4927 " char *guestfs_case_sensitive_path (guestfs_h *g,\n"
4928 "\t\tconst char *path);\n"
4933 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:503
4935 "This can be used to resolve case insensitive paths on a filesystem which is "
4936 "case sensitive. The use case is to resolve paths which you have read from "
4937 "Windows configuration files or the Windows Registry, to the true path."
4941 #: ../src/guestfs-actions.pod:649 ../fish/guestfish-actions.pod:508
4943 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4944 "(and probably others), which is that although the underlying filesystem is "
4945 "case-insensitive, the driver exports the filesystem to Linux as "
4950 #: ../src/guestfs-actions.pod:654 ../fish/guestfish-actions.pod:513
4952 "One consequence of this is that special directories such as C<c:\\windows> "
4953 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4954 "precise details of how they were created. In Windows itself this would not "
4959 #: ../src/guestfs-actions.pod:660 ../fish/guestfish-actions.pod:519
4961 "Bug or feature? You decide: "
4962 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
4966 #: ../src/guestfs-actions.pod:663 ../fish/guestfish-actions.pod:522
4968 "This function resolves the true case of each element in the path and returns "
4969 "the case-sensitive path."
4973 #: ../src/guestfs-actions.pod:666
4975 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
4976 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4977 "how the directories were originally created under Windows)."
4981 #: ../src/guestfs-actions.pod:671 ../fish/guestfish-actions.pod:530
4982 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4986 #: ../src/guestfs-actions.pod:674
4987 msgid "See also C<guestfs_realpath>."
4991 #: ../src/guestfs-actions.pod:679
4996 #: ../src/guestfs-actions.pod:681
4999 " char *guestfs_cat (guestfs_h *g,\n"
5000 "\t\tconst char *path);\n"
5005 #: ../src/guestfs-actions.pod:684 ../src/guestfs-actions.pod:4136 ../fish/guestfish-actions.pod:539 ../fish/guestfish-actions.pod:3177
5006 msgid "Return the contents of the file named C<path>."
5010 #: ../src/guestfs-actions.pod:686
5012 "Note that this function cannot correctly handle binary files (specifically, "
5013 "files containing C<\\0> character which is treated as end of string). For "
5014 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5015 "functions which have a more complex interface."
5019 #: ../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:3953 ../src/guestfs-actions.pod:3976 ../src/guestfs-actions.pod:4084 ../src/guestfs-actions.pod:4107 ../src/guestfs-actions.pod:4128 ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:4906 ../src/guestfs-actions.pod:5022 ../src/guestfs-actions.pod:5043 ../src/guestfs-actions.pod:5588 ../src/guestfs-actions.pod:5611 ../src/guestfs-actions.pod:5634 ../src/guestfs-actions.pod:5650 ../src/guestfs-actions.pod:5723 ../src/guestfs-actions.pod:5739 ../src/guestfs-actions.pod:5779 ../src/guestfs-actions.pod:5795 ../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:3047 ../fish/guestfish-actions.pod:3062 ../fish/guestfish-actions.pod:3138 ../fish/guestfish-actions.pod:3155 ../fish/guestfish-actions.pod:3170 ../fish/guestfish-actions.pod:3753 ../fish/guestfish-actions.pod:3799 ../fish/guestfish-actions.pod:3884 ../fish/guestfish-actions.pod:3899 ../fish/guestfish-actions.pod:4309 ../fish/guestfish-actions.pod:4327 ../fish/guestfish-actions.pod:4344 ../fish/guestfish-actions.pod:4354 ../fish/guestfish-actions.pod:4402 ../fish/guestfish-actions.pod:4412 ../fish/guestfish-actions.pod:4441 ../fish/guestfish-actions.pod:4451
5021 "Because of the message protocol, there is a transfer limit of somewhere "
5022 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5026 #: ../src/guestfs-actions.pod:697
5027 msgid "guestfs_checksum"
5031 #: ../src/guestfs-actions.pod:699
5034 " char *guestfs_checksum (guestfs_h *g,\n"
5035 "\t\tconst char *csumtype,\n"
5036 "\t\tconst char *path);\n"
5041 #: ../src/guestfs-actions.pod:703 ../fish/guestfish-actions.pod:553
5042 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5046 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:556
5048 "The type of checksum to compute is given by the C<csumtype> parameter which "
5049 "must have one of the following values:"
5053 #: ../src/guestfs-actions.pod:711 ../fish/guestfish-actions.pod:561
5058 #: ../src/guestfs-actions.pod:713 ../fish/guestfish-actions.pod:563
5060 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5065 #: ../src/guestfs-actions.pod:716 ../fish/guestfish-actions.pod:566
5070 #: ../src/guestfs-actions.pod:718 ../fish/guestfish-actions.pod:568
5071 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5075 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:570
5080 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:572
5081 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5085 #: ../src/guestfs-actions.pod:724 ../fish/guestfish-actions.pod:574
5090 #: ../src/guestfs-actions.pod:726 ../fish/guestfish-actions.pod:576
5091 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5095 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:578
5100 #: ../src/guestfs-actions.pod:730 ../fish/guestfish-actions.pod:580
5101 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5105 #: ../src/guestfs-actions.pod:732 ../fish/guestfish-actions.pod:582
5110 #: ../src/guestfs-actions.pod:734 ../fish/guestfish-actions.pod:584
5111 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5115 #: ../src/guestfs-actions.pod:736 ../fish/guestfish-actions.pod:586
5120 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:588
5121 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5125 #: ../src/guestfs-actions.pod:742 ../fish/guestfish-actions.pod:592
5126 msgid "The checksum is returned as a printable string."
5130 #: ../src/guestfs-actions.pod:744
5131 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
5135 #: ../src/guestfs-actions.pod:746
5136 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
5140 #: ../src/guestfs-actions.pod:751
5141 msgid "guestfs_checksum_device"
5145 #: ../src/guestfs-actions.pod:753
5148 " char *guestfs_checksum_device (guestfs_h *g,\n"
5149 "\t\tconst char *csumtype,\n"
5150 "\t\tconst char *device);\n"
5155 #: ../src/guestfs-actions.pod:757
5157 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5158 "device named C<device>. For the types of checksums supported see the "
5159 "C<guestfs_checksum> command."
5163 #: ../src/guestfs-actions.pod:764
5164 msgid "guestfs_checksums_out"
5168 #: ../src/guestfs-actions.pod:766
5171 " int guestfs_checksums_out (guestfs_h *g,\n"
5172 "\t\tconst char *csumtype,\n"
5173 "\t\tconst char *directory,\n"
5174 "\t\tconst char *sumsfile);\n"
5179 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:610
5181 "This command computes the checksums of all regular files in C<directory> and "
5182 "then emits a list of those checksums to the local output file C<sumsfile>."
5186 #: ../src/guestfs-actions.pod:775 ../fish/guestfish-actions.pod:614
5188 "This can be used for verifying the integrity of a virtual machine. However "
5189 "to be properly secure you should pay attention to the output of the checksum "
5190 "command (it uses the ones from GNU coreutils). In particular when the "
5191 "filename is not printable, coreutils uses a special backslash syntax. For "
5192 "more information, see the GNU coreutils info file."
5196 #: ../src/guestfs-actions.pod:785
5197 msgid "guestfs_chmod"
5201 #: ../src/guestfs-actions.pod:787
5204 " int guestfs_chmod (guestfs_h *g,\n"
5206 "\t\tconst char *path);\n"
5211 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:628
5213 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5218 #: ../src/guestfs-actions.pod:794 ../fish/guestfish-actions.pod:631
5220 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5221 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5226 #: ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:3281 ../src/guestfs-actions.pod:3384 ../src/guestfs-actions.pod:3400 ../src/guestfs-actions.pod:3416 ../fish/guestfish-actions.pod:635 ../fish/guestfish-actions.pod:2537 ../fish/guestfish-actions.pod:2622 ../fish/guestfish-actions.pod:2632 ../fish/guestfish-actions.pod:2642
5227 msgid "The mode actually set is affected by the umask."
5231 #: ../src/guestfs-actions.pod:802
5232 msgid "guestfs_chown"
5236 #: ../src/guestfs-actions.pod:804
5239 " int guestfs_chown (guestfs_h *g,\n"
5242 "\t\tconst char *path);\n"
5247 #: ../src/guestfs-actions.pod:809 ../fish/guestfish-actions.pod:641
5248 msgid "Change the file owner to C<owner> and group to C<group>."
5252 #: ../src/guestfs-actions.pod:811 ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:643 ../fish/guestfish-actions.pod:2015
5254 "Only numeric uid and gid are supported. If you want to use names, you will "
5255 "need to locate and parse the password file yourself (Augeas support makes "
5256 "this relatively easy)."
5260 #: ../src/guestfs-actions.pod:817
5261 msgid "guestfs_command"
5265 #: ../src/guestfs-actions.pod:819
5268 " char *guestfs_command (guestfs_h *g,\n"
5269 "\t\tchar *const *arguments);\n"
5274 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:651
5276 "This call runs a command from the guest filesystem. The filesystem must be "
5277 "mounted, and must contain a compatible operating system (ie. something "
5278 "Linux, with the same or compatible processor architecture)."
5282 #: ../src/guestfs-actions.pod:827
5284 "The single parameter is an argv-style list of arguments. The first element "
5285 "is the name of the program to run. Subsequent elements are parameters. The "
5286 "list must be non-empty (ie. must contain a program name). Note that the "
5287 "command runs directly, and is I<not> invoked via the shell (see "
5292 #: ../src/guestfs-actions.pod:834 ../fish/guestfish-actions.pod:663
5293 msgid "The return value is anything printed to I<stdout> by the command."
5297 #: ../src/guestfs-actions.pod:837 ../fish/guestfish-actions.pod:666
5299 "If the command returns a non-zero exit status, then this function returns an "
5300 "error message. The error message string is the content of I<stderr> from "
5305 #: ../src/guestfs-actions.pod:841 ../fish/guestfish-actions.pod:670
5307 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
5308 "C</bin>. If you require a program from another location, you should provide "
5309 "the full path in the first parameter."
5313 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:675
5315 "Shared libraries and data files required by the program must be available on "
5316 "filesystems which are mounted in the correct places. It is the caller's "
5317 "responsibility to ensure all filesystems that are needed are mounted at the "
5322 #: ../src/guestfs-actions.pod:858
5323 msgid "guestfs_command_lines"
5327 #: ../src/guestfs-actions.pod:860
5330 " char **guestfs_command_lines (guestfs_h *g,\n"
5331 "\t\tchar *const *arguments);\n"
5336 #: ../src/guestfs-actions.pod:863
5338 "This is the same as C<guestfs_command>, but splits the result into a list of "
5343 #: ../src/guestfs-actions.pod:866
5344 msgid "See also: C<guestfs_sh_lines>"
5348 #: ../src/guestfs-actions.pod:875
5349 msgid "guestfs_config"
5353 #: ../src/guestfs-actions.pod:877
5356 " int guestfs_config (guestfs_h *g,\n"
5357 "\t\tconst char *qemuparam,\n"
5358 "\t\tconst char *qemuvalue);\n"
5363 #: ../src/guestfs-actions.pod:881 ../fish/guestfish-actions.pod:700
5365 "This can be used to add arbitrary qemu command line parameters of the form "
5366 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
5367 "setting some parameters which would interfere with parameters that we use."
5371 #: ../src/guestfs-actions.pod:886 ../fish/guestfish-actions.pod:705
5372 msgid "The first character of C<param> string must be a C<-> (dash)."
5376 #: ../src/guestfs-actions.pod:888 ../fish/guestfish-actions.pod:707
5377 msgid "C<value> can be NULL."
5381 #: ../src/guestfs-actions.pod:892
5382 msgid "guestfs_copy_size"
5386 #: ../src/guestfs-actions.pod:894
5389 " int guestfs_copy_size (guestfs_h *g,\n"
5390 "\t\tconst char *src,\n"
5391 "\t\tconst char *dest,\n"
5392 "\t\tint64_t size);\n"
5397 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:713
5399 "This command copies exactly C<size> bytes from one source device or file "
5400 "C<src> to another destination device or file C<dest>."
5404 #: ../src/guestfs-actions.pod:902 ../fish/guestfish-actions.pod:716
5406 "Note this will fail if the source is too short or if the destination is not "
5411 #: ../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:5668 ../src/guestfs-actions.pod:5684
5413 "This long-running command can generate progress notification messages so "
5414 "that the caller can display a progress bar or indicator. To receive these "
5415 "messages, the caller must register a progress callback. See "
5416 "L<guestfs(3)/guestfs_set_progress_callback>."
5420 #: ../src/guestfs-actions.pod:912
5425 #: ../src/guestfs-actions.pod:914
5428 " int guestfs_cp (guestfs_h *g,\n"
5429 "\t\tconst char *src,\n"
5430 "\t\tconst char *dest);\n"
5435 #: ../src/guestfs-actions.pod:918 ../fish/guestfish-actions.pod:723
5437 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5438 "destination filename or destination directory."
5442 #: ../src/guestfs-actions.pod:923
5443 msgid "guestfs_cp_a"
5447 #: ../src/guestfs-actions.pod:925
5450 " int guestfs_cp_a (guestfs_h *g,\n"
5451 "\t\tconst char *src,\n"
5452 "\t\tconst char *dest);\n"
5457 #: ../src/guestfs-actions.pod:929 ../fish/guestfish-actions.pod:730
5459 "This copies a file or directory from C<src> to C<dest> recursively using the "
5464 #: ../src/guestfs-actions.pod:934
5469 #: ../src/guestfs-actions.pod:936
5472 " int guestfs_dd (guestfs_h *g,\n"
5473 "\t\tconst char *src,\n"
5474 "\t\tconst char *dest);\n"
5479 #: ../src/guestfs-actions.pod:940 ../fish/guestfish-actions.pod:737
5481 "This command copies from one source device or file C<src> to another "
5482 "destination device or file C<dest>. Normally you would use this to copy to "
5483 "or from a device or partition, for example to duplicate a filesystem."
5487 #: ../src/guestfs-actions.pod:945
5489 "If the destination is a device, it must be as large or larger than the "
5490 "source file or device, otherwise the copy will fail. This command cannot do "
5491 "partial copies (see C<guestfs_copy_size>)."
5495 #: ../src/guestfs-actions.pod:951
5496 msgid "guestfs_debug"
5500 #: ../src/guestfs-actions.pod:953
5503 " char *guestfs_debug (guestfs_h *g,\n"
5504 "\t\tconst char *subcmd,\n"
5505 "\t\tchar *const *extraargs);\n"
5510 #: ../src/guestfs-actions.pod:957
5512 "The C<guestfs_debug> command exposes some internals of C<guestfsd> (the "
5513 "guestfs daemon) that runs inside the qemu subprocess."
5517 #: ../src/guestfs-actions.pod:961 ../fish/guestfish-actions.pod:754
5519 "There is no comprehensive help for this command. You have to look at the "
5520 "file C<daemon/debug.c> in the libguestfs source to find out what you can do."
5524 #: ../src/guestfs-actions.pod:968
5525 msgid "guestfs_debug_upload"
5529 #: ../src/guestfs-actions.pod:970
5532 " int guestfs_debug_upload (guestfs_h *g,\n"
5533 "\t\tconst char *filename,\n"
5534 "\t\tconst char *tmpname,\n"
5540 #: ../src/guestfs-actions.pod:975
5542 "The C<guestfs_debug_upload> command uploads a file to the libguestfs "
5547 #: ../src/guestfs-actions.pod:978 ../fish/guestfish-actions.pod:765
5549 "There is no comprehensive help for this command. You have to look at the "
5550 "file C<daemon/debug.c> in the libguestfs source to find out what it is for."
5554 #: ../src/guestfs-actions.pod:984
5559 #: ../src/guestfs-actions.pod:986
5562 " char *guestfs_df (guestfs_h *g);\n"
5567 #: ../src/guestfs-actions.pod:988 ../fish/guestfish-actions.pod:775
5568 msgid "This command runs the C<df> command to report disk space used."
5572 #: ../src/guestfs-actions.pod:990 ../src/guestfs-actions.pod:1004 ../fish/guestfish-actions.pod:777 ../fish/guestfish-actions.pod:788
5574 "This command is mostly useful for interactive sessions. It is I<not> "
5575 "intended that you try to parse the output string. Use C<statvfs> from "
5580 #: ../src/guestfs-actions.pod:997
5581 msgid "guestfs_df_h"
5585 #: ../src/guestfs-actions.pod:999
5588 " char *guestfs_df_h (guestfs_h *g);\n"
5593 #: ../src/guestfs-actions.pod:1001 ../fish/guestfish-actions.pod:785
5595 "This command runs the C<df -h> command to report disk space used in "
5596 "human-readable format."
5600 #: ../src/guestfs-actions.pod:1011
5601 msgid "guestfs_dmesg"
5605 #: ../src/guestfs-actions.pod:1013
5608 " char *guestfs_dmesg (guestfs_h *g);\n"
5613 #: ../src/guestfs-actions.pod:1015 ../fish/guestfish-actions.pod:796
5615 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5616 "This is sometimes useful for extended debugging of problems."
5620 #: ../src/guestfs-actions.pod:1019
5622 "Another way to get the same information is to enable verbose messages with "
5623 "C<guestfs_set_verbose> or by setting the environment variable "
5624 "C<LIBGUESTFS_DEBUG=1> before running the program."
5628 #: ../src/guestfs-actions.pod:1027
5629 msgid "guestfs_download"
5633 #: ../src/guestfs-actions.pod:1029
5636 " int guestfs_download (guestfs_h *g,\n"
5637 "\t\tconst char *remotefilename,\n"
5638 "\t\tconst char *filename);\n"
5643 #: ../src/guestfs-actions.pod:1033 ../src/guestfs-actions.pod:1055 ../fish/guestfish-actions.pod:809 ../fish/guestfish-actions.pod:822
5645 "Download file C<remotefilename> and save it as C<filename> on the local "
5650 #: ../src/guestfs-actions.pod:1036 ../src/guestfs-actions.pod:5236 ../fish/guestfish-actions.pod:812 ../fish/guestfish-actions.pod:4057
5651 msgid "C<filename> can also be a named pipe."
5655 #: ../src/guestfs-actions.pod:1038
5656 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5660 #: ../src/guestfs-actions.pod:1047
5661 msgid "guestfs_download_offset"
5665 #: ../src/guestfs-actions.pod:1049
5668 " int guestfs_download_offset (guestfs_h *g,\n"
5669 "\t\tconst char *remotefilename,\n"
5670 "\t\tconst char *filename,\n"
5671 "\t\tint64_t offset,\n"
5672 "\t\tint64_t size);\n"
5677 #: ../src/guestfs-actions.pod:1058 ../fish/guestfish-actions.pod:825
5679 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5680 "region must be within the file or device)."
5684 #: ../src/guestfs-actions.pod:1061
5686 "Note that there is no limit on the amount of data that can be downloaded "
5687 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
5688 "full amount unless an error occurs."
5692 #: ../src/guestfs-actions.pod:1066
5693 msgid "See also C<guestfs_download>, C<guestfs_pread>."
5697 #: ../src/guestfs-actions.pod:1075
5698 msgid "guestfs_drop_caches"
5702 #: ../src/guestfs-actions.pod:1077
5705 " int guestfs_drop_caches (guestfs_h *g,\n"
5706 "\t\tint whattodrop);\n"
5711 #: ../src/guestfs-actions.pod:1080 ../fish/guestfish-actions.pod:841
5713 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5714 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5715 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5719 #: ../src/guestfs-actions.pod:1085 ../fish/guestfish-actions.pod:846
5720 msgid "Setting C<whattodrop> to 3 should drop everything."
5724 #: ../src/guestfs-actions.pod:1087 ../fish/guestfish-actions.pod:848
5726 "This automatically calls L<sync(2)> before the operation, so that the "
5727 "maximum guest memory is freed."
5731 #: ../src/guestfs-actions.pod:1092
5736 #: ../src/guestfs-actions.pod:1094
5739 " int64_t guestfs_du (guestfs_h *g,\n"
5740 "\t\tconst char *path);\n"
5745 #: ../src/guestfs-actions.pod:1097 ../fish/guestfish-actions.pod:855
5747 "This command runs the C<du -s> command to estimate file space usage for "
5752 #: ../src/guestfs-actions.pod:1100 ../fish/guestfish-actions.pod:858
5754 "C<path> can be a file or a directory. If C<path> is a directory then the "
5755 "estimate includes the contents of the directory and all subdirectories "
5760 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:862
5761 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5765 #: ../src/guestfs-actions.pod:1109
5766 msgid "guestfs_e2fsck_f"
5770 #: ../src/guestfs-actions.pod:1111
5773 " int guestfs_e2fsck_f (guestfs_h *g,\n"
5774 "\t\tconst char *device);\n"
5779 #: ../src/guestfs-actions.pod:1114 ../fish/guestfish-actions.pod:869
5781 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5782 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
5787 #: ../src/guestfs-actions.pod:1118
5789 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
5790 "Normally you should use C<guestfs_fsck>."
5794 #: ../src/guestfs-actions.pod:1123
5795 msgid "guestfs_echo_daemon"
5799 #: ../src/guestfs-actions.pod:1125
5802 " char *guestfs_echo_daemon (guestfs_h *g,\n"
5803 "\t\tchar *const *words);\n"
5808 #: ../src/guestfs-actions.pod:1128 ../fish/guestfish-actions.pod:880
5810 "This command concatenates the list of C<words> passed with single spaces "
5811 "between them and returns the resulting string."
5815 #: ../src/guestfs-actions.pod:1131 ../fish/guestfish-actions.pod:883
5816 msgid "You can use this command to test the connection through to the daemon."
5820 #: ../src/guestfs-actions.pod:1133
5821 msgid "See also C<guestfs_ping_daemon>."
5825 #: ../src/guestfs-actions.pod:1138
5826 msgid "guestfs_egrep"
5830 #: ../src/guestfs-actions.pod:1140
5833 " char **guestfs_egrep (guestfs_h *g,\n"
5834 "\t\tconst char *regex,\n"
5835 "\t\tconst char *path);\n"
5840 #: ../src/guestfs-actions.pod:1144 ../fish/guestfish-actions.pod:891
5841 msgid "This calls the external C<egrep> program and returns the matching lines."
5845 #: ../src/guestfs-actions.pod:1154
5846 msgid "guestfs_egrepi"
5850 #: ../src/guestfs-actions.pod:1156
5853 " char **guestfs_egrepi (guestfs_h *g,\n"
5854 "\t\tconst char *regex,\n"
5855 "\t\tconst char *path);\n"
5860 #: ../src/guestfs-actions.pod:1160 ../fish/guestfish-actions.pod:901
5861 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5865 #: ../src/guestfs-actions.pod:1170
5866 msgid "guestfs_equal"
5870 #: ../src/guestfs-actions.pod:1172
5873 " int guestfs_equal (guestfs_h *g,\n"
5874 "\t\tconst char *file1,\n"
5875 "\t\tconst char *file2);\n"
5880 #: ../src/guestfs-actions.pod:1176 ../fish/guestfish-actions.pod:911
5882 "This compares the two files C<file1> and C<file2> and returns true if their "
5883 "content is exactly equal, or false otherwise."
5887 #: ../src/guestfs-actions.pod:1179 ../fish/guestfish-actions.pod:914
5888 msgid "The external L<cmp(1)> program is used for the comparison."
5892 #: ../src/guestfs-actions.pod:1183
5893 msgid "guestfs_exists"
5897 #: ../src/guestfs-actions.pod:1185
5900 " int guestfs_exists (guestfs_h *g,\n"
5901 "\t\tconst char *path);\n"
5906 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:920
5908 "This returns C<true> if and only if there is a file, directory (or anything) "
5909 "with the given C<path> name."
5913 #: ../src/guestfs-actions.pod:1191
5914 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
5918 #: ../src/guestfs-actions.pod:1195
5919 msgid "guestfs_fallocate"
5923 #: ../src/guestfs-actions.pod:1197
5926 " int guestfs_fallocate (guestfs_h *g,\n"
5927 "\t\tconst char *path,\n"
5933 #: ../src/guestfs-actions.pod:1201 ../src/guestfs-actions.pod:1224 ../fish/guestfish-actions.pod:929 ../fish/guestfish-actions.pod:948
5935 "This command preallocates a file (containing zero bytes) named C<path> of "
5936 "size C<len> bytes. If the file exists already, it is overwritten."
5940 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:933
5942 "Do not confuse this with the guestfish-specific C<alloc> command which "
5943 "allocates a file in the host and attaches it as a device."
5947 #: ../src/guestfs-actions.pod:1211 ../fish/guestfish-actions.pod:937
5949 "This function is deprecated. In new code, use the C<fallocate64> call "
5954 #: ../src/guestfs-actions.pod:1218
5955 msgid "guestfs_fallocate64"
5959 #: ../src/guestfs-actions.pod:1220
5962 " int guestfs_fallocate64 (guestfs_h *g,\n"
5963 "\t\tconst char *path,\n"
5964 "\t\tint64_t len);\n"
5969 #: ../src/guestfs-actions.pod:1228
5971 "Note that this call allocates disk blocks for the file. To create a sparse "
5972 "file use C<guestfs_truncate_size> instead."
5976 #: ../src/guestfs-actions.pod:1231
5978 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
5979 "oversight it only allowed 30 bit lengths to be specified, effectively "
5980 "limiting the maximum size of files created through that call to 1GB."
5984 #: ../src/guestfs-actions.pod:1236 ../fish/guestfish-actions.pod:960
5986 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5987 "commands which create a file in the host and attach it as a device."
5991 #: ../src/guestfs-actions.pod:1242
5992 msgid "guestfs_fgrep"
5996 #: ../src/guestfs-actions.pod:1244
5999 " char **guestfs_fgrep (guestfs_h *g,\n"
6000 "\t\tconst char *pattern,\n"
6001 "\t\tconst char *path);\n"
6006 #: ../src/guestfs-actions.pod:1248 ../fish/guestfish-actions.pod:968
6007 msgid "This calls the external C<fgrep> program and returns the matching lines."
6011 #: ../src/guestfs-actions.pod:1258
6012 msgid "guestfs_fgrepi"
6016 #: ../src/guestfs-actions.pod:1260
6019 " char **guestfs_fgrepi (guestfs_h *g,\n"
6020 "\t\tconst char *pattern,\n"
6021 "\t\tconst char *path);\n"
6026 #: ../src/guestfs-actions.pod:1264 ../fish/guestfish-actions.pod:978
6027 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
6031 #: ../src/guestfs-actions.pod:1274
6032 msgid "guestfs_file"
6036 #: ../src/guestfs-actions.pod:1276
6039 " char *guestfs_file (guestfs_h *g,\n"
6040 "\t\tconst char *path);\n"
6045 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:988
6047 "This call uses the standard L<file(1)> command to determine the type or "
6048 "contents of the file."
6052 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:991
6054 "This call will also transparently look inside various types of compressed "
6059 #: ../src/guestfs-actions.pod:1285 ../fish/guestfish-actions.pod:994
6061 "The exact command which runs is C<file -zb path>. Note in particular that "
6062 "the filename is not prepended to the output (the C<-b> option)."
6066 #: ../src/guestfs-actions.pod:1289
6068 "This command can also be used on C</dev/> devices (and partitions, LV "
6069 "names). You can for example use this to determine if a device contains a "
6070 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
6074 #: ../src/guestfs-actions.pod:1294 ../fish/guestfish-actions.pod:1003
6076 "If the C<path> does not begin with C</dev/> then this command only works for "
6077 "the content of regular files. For other file types (directory, symbolic "
6078 "link etc) it will just return the string C<directory> etc."
6082 #: ../src/guestfs-actions.pod:1302
6083 msgid "guestfs_file_architecture"
6087 #: ../src/guestfs-actions.pod:1304
6090 " char *guestfs_file_architecture (guestfs_h *g,\n"
6091 "\t\tconst char *filename);\n"
6096 #: ../src/guestfs-actions.pod:1307 ../fish/guestfish-actions.pod:1012
6098 "This detects the architecture of the binary C<filename>, and returns it if "
6103 #: ../src/guestfs-actions.pod:1310 ../fish/guestfish-actions.pod:1015
6104 msgid "Currently defined architectures are:"
6108 #: ../src/guestfs-actions.pod:1314 ../fish/guestfish-actions.pod:1019
6113 #: ../src/guestfs-actions.pod:1316 ../fish/guestfish-actions.pod:1021
6115 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6116 "irrespective of the precise processor requirements of the binary."
6120 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:1024
6125 #: ../src/guestfs-actions.pod:1321 ../fish/guestfish-actions.pod:1026
6126 msgid "64 bit x86-64."
6130 #: ../src/guestfs-actions.pod:1323 ../fish/guestfish-actions.pod:1028
6135 #: ../src/guestfs-actions.pod:1325 ../fish/guestfish-actions.pod:1030
6136 msgid "32 bit SPARC."
6140 #: ../src/guestfs-actions.pod:1327 ../fish/guestfish-actions.pod:1032
6145 #: ../src/guestfs-actions.pod:1329 ../fish/guestfish-actions.pod:1034
6146 msgid "64 bit SPARC V9 and above."
6150 #: ../src/guestfs-actions.pod:1331 ../fish/guestfish-actions.pod:1036
6155 #: ../src/guestfs-actions.pod:1333 ../fish/guestfish-actions.pod:1038
6156 msgid "Intel Itanium."
6160 #: ../src/guestfs-actions.pod:1335 ../fish/guestfish-actions.pod:1040
6165 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:1042
6166 msgid "32 bit Power PC."
6170 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:1044
6175 #: ../src/guestfs-actions.pod:1341 ../fish/guestfish-actions.pod:1046
6176 msgid "64 bit Power PC."
6180 #: ../src/guestfs-actions.pod:1345 ../fish/guestfish-actions.pod:1050
6181 msgid "Libguestfs may return other architecture strings in future."
6185 #: ../src/guestfs-actions.pod:1347 ../fish/guestfish-actions.pod:1052
6186 msgid "The function works on at least the following types of files:"
6190 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:1058
6191 msgid "many types of Un*x and Linux binary"
6195 #: ../src/guestfs-actions.pod:1357 ../fish/guestfish-actions.pod:1062
6196 msgid "many types of Un*x and Linux shared library"
6200 #: ../src/guestfs-actions.pod:1361 ../fish/guestfish-actions.pod:1066
6201 msgid "Windows Win32 and Win64 binaries"
6205 #: ../src/guestfs-actions.pod:1365 ../fish/guestfish-actions.pod:1070
6206 msgid "Windows Win32 and Win64 DLLs"
6210 #: ../src/guestfs-actions.pod:1367 ../fish/guestfish-actions.pod:1072
6211 msgid "Win32 binaries and DLLs return C<i386>."
6215 #: ../src/guestfs-actions.pod:1369 ../fish/guestfish-actions.pod:1074
6216 msgid "Win64 binaries and DLLs return C<x86_64>."
6220 #: ../src/guestfs-actions.pod:1373 ../fish/guestfish-actions.pod:1078
6221 msgid "Linux kernel modules"
6225 #: ../src/guestfs-actions.pod:1377 ../fish/guestfish-actions.pod:1082
6226 msgid "Linux new-style initrd images"
6230 #: ../src/guestfs-actions.pod:1381 ../fish/guestfish-actions.pod:1086
6231 msgid "some non-x86 Linux vmlinuz kernels"
6235 #: ../src/guestfs-actions.pod:1385 ../fish/guestfish-actions.pod:1090
6236 msgid "What it can't do currently:"
6240 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:1096
6241 msgid "static libraries (libfoo.a)"
6245 #: ../src/guestfs-actions.pod:1395 ../fish/guestfish-actions.pod:1100
6246 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6250 #: ../src/guestfs-actions.pod:1399 ../fish/guestfish-actions.pod:1104
6251 msgid "x86 Linux vmlinuz kernels"
6255 #: ../src/guestfs-actions.pod:1401 ../fish/guestfish-actions.pod:1106
6257 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6258 "compressed code, and are horribly hard to unpack. If you want to find the "
6259 "architecture of a kernel, use the architecture of the associated initrd or "
6260 "kernel module(s) instead."
6264 #: ../src/guestfs-actions.pod:1411
6265 msgid "guestfs_filesize"
6269 #: ../src/guestfs-actions.pod:1413
6272 " int64_t guestfs_filesize (guestfs_h *g,\n"
6273 "\t\tconst char *file);\n"
6278 #: ../src/guestfs-actions.pod:1416 ../fish/guestfish-actions.pod:1117
6279 msgid "This command returns the size of C<file> in bytes."
6283 #: ../src/guestfs-actions.pod:1418
6285 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
6286 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
6287 "devices, use C<guestfs_blockdev_getsize64>."
6291 #: ../src/guestfs-actions.pod:1424
6292 msgid "guestfs_fill"
6296 #: ../src/guestfs-actions.pod:1426
6299 " int guestfs_fill (guestfs_h *g,\n"
6302 "\t\tconst char *path);\n"
6307 #: ../src/guestfs-actions.pod:1431 ../fish/guestfish-actions.pod:1127
6309 "This command creates a new file called C<path>. The initial content of the "
6310 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
6315 #: ../src/guestfs-actions.pod:1435
6317 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6318 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
6319 "bytes use C<guestfs_fill_pattern>."
6323 #: ../src/guestfs-actions.pod:1447
6324 msgid "guestfs_fill_pattern"
6328 #: ../src/guestfs-actions.pod:1449
6331 " int guestfs_fill_pattern (guestfs_h *g,\n"
6332 "\t\tconst char *pattern,\n"
6334 "\t\tconst char *path);\n"
6339 #: ../src/guestfs-actions.pod:1454
6341 "This function is like C<guestfs_fill> except that it creates a new file of "
6342 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
6343 "pattern is truncated if necessary to ensure the length of the file is "
6344 "exactly C<len> bytes."
6348 #: ../src/guestfs-actions.pod:1466
6349 msgid "guestfs_find"
6353 #: ../src/guestfs-actions.pod:1468
6356 " char **guestfs_find (guestfs_h *g,\n"
6357 "\t\tconst char *directory);\n"
6362 #: ../src/guestfs-actions.pod:1471 ../fish/guestfish-actions.pod:1149
6364 "This command lists out all files and directories, recursively, starting at "
6365 "C<directory>. It is essentially equivalent to running the shell command "
6366 "C<find directory -print> but some post-processing happens on the output, "
6371 #: ../src/guestfs-actions.pod:1476 ../fish/guestfish-actions.pod:1154
6373 "This returns a list of strings I<without any prefix>. Thus if the directory "
6378 #: ../src/guestfs-actions.pod:1479 ../fish/guestfish-actions.pod:1157
6388 #: ../src/guestfs-actions.pod:1483
6389 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
6393 #: ../src/guestfs-actions.pod:1486 ../fish/guestfish-actions.pod:1164
6404 #: ../src/guestfs-actions.pod:1491 ../fish/guestfish-actions.pod:1169
6405 msgid "If C<directory> is not a directory, then this command returns an error."
6409 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:1172
6410 msgid "The returned list is sorted."
6414 #: ../src/guestfs-actions.pod:1496
6415 msgid "See also C<guestfs_find0>."
6419 #: ../src/guestfs-actions.pod:1505
6420 msgid "guestfs_find0"
6424 #: ../src/guestfs-actions.pod:1507
6427 " int guestfs_find0 (guestfs_h *g,\n"
6428 "\t\tconst char *directory,\n"
6429 "\t\tconst char *files);\n"
6434 #: ../src/guestfs-actions.pod:1511 ../fish/guestfish-actions.pod:1183
6436 "This command lists out all files and directories, recursively, starting at "
6437 "C<directory>, placing the resulting list in the external file called "
6442 #: ../src/guestfs-actions.pod:1515
6444 "This command works the same way as C<guestfs_find> with the following "
6449 #: ../src/guestfs-actions.pod:1522 ../fish/guestfish-actions.pod:1194
6450 msgid "The resulting list is written to an external file."
6454 #: ../src/guestfs-actions.pod:1526 ../fish/guestfish-actions.pod:1198
6456 "Items (filenames) in the result are separated by C<\\0> characters. See "
6457 "L<find(1)> option I<-print0>."
6461 #: ../src/guestfs-actions.pod:1531 ../fish/guestfish-actions.pod:1203
6462 msgid "This command is not limited in the number of names that it can return."
6466 #: ../src/guestfs-actions.pod:1536 ../fish/guestfish-actions.pod:1208
6467 msgid "The result list is not sorted."
6471 #: ../src/guestfs-actions.pod:1542
6472 msgid "guestfs_findfs_label"
6476 #: ../src/guestfs-actions.pod:1544
6479 " char *guestfs_findfs_label (guestfs_h *g,\n"
6480 "\t\tconst char *label);\n"
6485 #: ../src/guestfs-actions.pod:1547 ../fish/guestfish-actions.pod:1218
6487 "This command searches the filesystems and returns the one which has the "
6488 "given label. An error is returned if no such filesystem can be found."
6492 #: ../src/guestfs-actions.pod:1551
6493 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6497 #: ../src/guestfs-actions.pod:1556
6498 msgid "guestfs_findfs_uuid"
6502 #: ../src/guestfs-actions.pod:1558
6505 " char *guestfs_findfs_uuid (guestfs_h *g,\n"
6506 "\t\tconst char *uuid);\n"
6511 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1228
6513 "This command searches the filesystems and returns the one which has the "
6514 "given UUID. An error is returned if no such filesystem can be found."
6518 #: ../src/guestfs-actions.pod:1565
6519 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6523 #: ../src/guestfs-actions.pod:1570
6524 msgid "guestfs_fsck"
6528 #: ../src/guestfs-actions.pod:1572
6531 " int guestfs_fsck (guestfs_h *g,\n"
6532 "\t\tconst char *fstype,\n"
6533 "\t\tconst char *device);\n"
6538 #: ../src/guestfs-actions.pod:1576 ../fish/guestfish-actions.pod:1238
6540 "This runs the filesystem checker (fsck) on C<device> which should have "
6541 "filesystem type C<fstype>."
6545 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1241
6547 "The returned integer is the status. See L<fsck(8)> for the list of status "
6548 "codes from C<fsck>."
6552 #: ../src/guestfs-actions.pod:1588 ../fish/guestfish-actions.pod:1250
6553 msgid "Multiple status codes can be summed together."
6557 #: ../src/guestfs-actions.pod:1592 ../fish/guestfish-actions.pod:1254
6559 "A non-zero return code can mean \"success\", for example if errors have been "
6560 "corrected on the filesystem."
6564 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1259
6565 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6569 #: ../src/guestfs-actions.pod:1602 ../fish/guestfish-actions.pod:1264
6570 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6574 #: ../src/guestfs-actions.pod:1606
6575 msgid "guestfs_get_append"
6579 #: ../src/guestfs-actions.pod:1608
6582 " const char *guestfs_get_append (guestfs_h *g);\n"
6587 #: ../src/guestfs-actions.pod:1610 ../fish/guestfish-actions.pod:1270
6589 "Return the additional kernel options which are added to the guest kernel "
6594 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1273
6595 msgid "If C<NULL> then no options are added."
6599 #: ../src/guestfs-actions.pod:1615
6601 "This function returns a string which may be NULL. There is no way to return "
6602 "an error from this function. The string is owned by the guest handle and "
6603 "must I<not> be freed."
6607 #: ../src/guestfs-actions.pod:1619
6608 msgid "guestfs_get_autosync"
6612 #: ../src/guestfs-actions.pod:1621
6615 " int guestfs_get_autosync (guestfs_h *g);\n"
6620 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1279
6621 msgid "Get the autosync flag."
6625 #: ../src/guestfs-actions.pod:1627
6626 msgid "guestfs_get_direct"
6630 #: ../src/guestfs-actions.pod:1629
6633 " int guestfs_get_direct (guestfs_h *g);\n"
6638 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1285
6639 msgid "Return the direct appliance mode flag."
6643 #: ../src/guestfs-actions.pod:1635
6644 msgid "guestfs_get_e2label"
6648 #: ../src/guestfs-actions.pod:1637
6651 " char *guestfs_get_e2label (guestfs_h *g,\n"
6652 "\t\tconst char *device);\n"
6657 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1291
6658 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6662 #: ../src/guestfs-actions.pod:1646 ../fish/guestfish-actions.pod:1294
6664 "This function is deprecated. In new code, use the C<vfs_label> call "
6669 #: ../src/guestfs-actions.pod:1653
6670 msgid "guestfs_get_e2uuid"
6674 #: ../src/guestfs-actions.pod:1655
6677 " char *guestfs_get_e2uuid (guestfs_h *g,\n"
6678 "\t\tconst char *device);\n"
6683 #: ../src/guestfs-actions.pod:1658 ../fish/guestfish-actions.pod:1305
6684 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6688 #: ../src/guestfs-actions.pod:1664 ../fish/guestfish-actions.pod:1308
6689 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
6693 #: ../src/guestfs-actions.pod:1671
6694 msgid "guestfs_get_memsize"
6698 #: ../src/guestfs-actions.pod:1673
6701 " int guestfs_get_memsize (guestfs_h *g);\n"
6706 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1319
6707 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6711 #: ../src/guestfs-actions.pod:1678
6713 "If C<guestfs_set_memsize> was not called on this handle, and if "
6714 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6715 "value for memsize."
6719 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1745 ../src/guestfs-actions.pod:4489 ../src/guestfs-actions.pod:4581 ../fish/guestfish-actions.pod:1326 ../fish/guestfish-actions.pod:1377 ../fish/guestfish-actions.pod:3464 ../fish/guestfish-actions.pod:3551
6720 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6724 #: ../src/guestfs-actions.pod:1687
6725 msgid "guestfs_get_network"
6729 #: ../src/guestfs-actions.pod:1689
6732 " int guestfs_get_network (guestfs_h *g);\n"
6737 #: ../src/guestfs-actions.pod:1691 ../fish/guestfish-actions.pod:1333
6738 msgid "This returns the enable network flag."
6742 #: ../src/guestfs-actions.pod:1695
6743 msgid "guestfs_get_path"
6747 #: ../src/guestfs-actions.pod:1697
6750 " const char *guestfs_get_path (guestfs_h *g);\n"
6755 #: ../src/guestfs-actions.pod:1699 ../fish/guestfish-actions.pod:1339
6756 msgid "Return the current search path."
6760 #: ../src/guestfs-actions.pod:1701 ../fish/guestfish-actions.pod:1341
6762 "This is always non-NULL. If it wasn't set already, then this will return "
6767 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:1727
6769 "This function returns a string, or NULL on error. The string is owned by "
6770 "the guest handle and must I<not> be freed."
6774 #: ../src/guestfs-actions.pod:1707
6775 msgid "guestfs_get_pid"
6779 #: ../src/guestfs-actions.pod:1709
6782 " int guestfs_get_pid (guestfs_h *g);\n"
6787 #: ../src/guestfs-actions.pod:1711 ../fish/guestfish-actions.pod:1350
6789 "Return the process ID of the qemu subprocess. If there is no qemu "
6790 "subprocess, then this will return an error."
6794 #: ../src/guestfs-actions.pod:1714 ../fish/guestfish-actions.pod:1353
6795 msgid "This is an internal call used for debugging and testing."
6799 #: ../src/guestfs-actions.pod:1718
6800 msgid "guestfs_get_qemu"
6804 #: ../src/guestfs-actions.pod:1720
6807 " const char *guestfs_get_qemu (guestfs_h *g);\n"
6812 #: ../src/guestfs-actions.pod:1722 ../fish/guestfish-actions.pod:1359
6813 msgid "Return the current qemu binary."
6817 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1361
6819 "This is always non-NULL. If it wasn't set already, then this will return "
6820 "the default qemu binary name."
6824 #: ../src/guestfs-actions.pod:1730
6825 msgid "guestfs_get_recovery_proc"
6829 #: ../src/guestfs-actions.pod:1732
6832 " int guestfs_get_recovery_proc (guestfs_h *g);\n"
6837 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1368
6838 msgid "Return the recovery process enabled flag."
6842 #: ../src/guestfs-actions.pod:1738
6843 msgid "guestfs_get_selinux"
6847 #: ../src/guestfs-actions.pod:1740
6850 " int guestfs_get_selinux (guestfs_h *g);\n"
6855 #: ../src/guestfs-actions.pod:1742
6857 "This returns the current setting of the selinux flag which is passed to the "
6858 "appliance at boot time. See C<guestfs_set_selinux>."
6862 #: ../src/guestfs-actions.pod:1750
6863 msgid "guestfs_get_state"
6867 #: ../src/guestfs-actions.pod:1752
6870 " int guestfs_get_state (guestfs_h *g);\n"
6875 #: ../src/guestfs-actions.pod:1754 ../fish/guestfish-actions.pod:1384
6877 "This returns the current state as an opaque integer. This is only useful "
6878 "for printing debug and internal error messages."
6882 #: ../src/guestfs-actions.pod:1757 ../src/guestfs-actions.pod:2398 ../src/guestfs-actions.pod:2421 ../src/guestfs-actions.pod:2470 ../src/guestfs-actions.pod:2491 ../fish/guestfish-actions.pod:1387 ../fish/guestfish-actions.pod:1897 ../fish/guestfish-actions.pod:1915 ../fish/guestfish-actions.pod:1953 ../fish/guestfish-actions.pod:1969
6883 msgid "For more information on states, see L<guestfs(3)>."
6887 #: ../src/guestfs-actions.pod:1761
6888 msgid "guestfs_get_trace"
6892 #: ../src/guestfs-actions.pod:1763
6895 " int guestfs_get_trace (guestfs_h *g);\n"
6900 #: ../src/guestfs-actions.pod:1765 ../fish/guestfish-actions.pod:1393
6901 msgid "Return the command trace flag."
6905 #: ../src/guestfs-actions.pod:1769
6906 msgid "guestfs_get_umask"
6910 #: ../src/guestfs-actions.pod:1771
6913 " int guestfs_get_umask (guestfs_h *g);\n"
6918 #: ../src/guestfs-actions.pod:1773
6920 "Return the current umask. By default the umask is C<022> unless it has been "
6921 "set by calling C<guestfs_umask>."
6925 #: ../src/guestfs-actions.pod:1778
6926 msgid "guestfs_get_verbose"
6930 #: ../src/guestfs-actions.pod:1780
6933 " int guestfs_get_verbose (guestfs_h *g);\n"
6938 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1406
6939 msgid "This returns the verbose messages flag."
6943 #: ../src/guestfs-actions.pod:1786
6944 msgid "guestfs_getcon"
6948 #: ../src/guestfs-actions.pod:1788
6951 " char *guestfs_getcon (guestfs_h *g);\n"
6956 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1412
6957 msgid "This gets the SELinux security context of the daemon."
6961 #: ../src/guestfs-actions.pod:1792
6962 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
6966 #: ../src/guestfs-actions.pod:1798
6967 msgid "guestfs_getxattrs"
6971 #: ../src/guestfs-actions.pod:1800
6974 " struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,\n"
6975 "\t\tconst char *path);\n"
6980 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1421
6981 msgid "This call lists the extended attributes of the file or directory C<path>."
6985 #: ../src/guestfs-actions.pod:1806 ../fish/guestfish-actions.pod:1424
6987 "At the system call level, this is a combination of the L<listxattr(2)> and "
6988 "L<getxattr(2)> calls."
6992 #: ../src/guestfs-actions.pod:1809
6993 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
6997 #: ../src/guestfs-actions.pod:1811 ../src/guestfs-actions.pod:2565 ../src/guestfs-actions.pod:3120
6999 "This function returns a C<struct guestfs_xattr_list *> (see "
7000 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7001 "must call C<guestfs_free_xattr_list> after use>."
7005 #: ../src/guestfs-actions.pod:1816
7006 msgid "guestfs_glob_expand"
7010 #: ../src/guestfs-actions.pod:1818
7013 " char **guestfs_glob_expand (guestfs_h *g,\n"
7014 "\t\tconst char *pattern);\n"
7019 #: ../src/guestfs-actions.pod:1821 ../fish/guestfish-actions.pod:1433
7021 "This command searches for all the pathnames matching C<pattern> according to "
7022 "the wildcard expansion rules used by the shell."
7026 #: ../src/guestfs-actions.pod:1825 ../fish/guestfish-actions.pod:1437
7027 msgid "If no paths match, then this returns an empty list (note: not an error)."
7031 #: ../src/guestfs-actions.pod:1828 ../fish/guestfish-actions.pod:1440
7033 "It is just a wrapper around the C L<glob(3)> function with flags "
7034 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
7038 #: ../src/guestfs-actions.pod:1836
7039 msgid "guestfs_grep"
7043 #: ../src/guestfs-actions.pod:1838
7046 " char **guestfs_grep (guestfs_h *g,\n"
7047 "\t\tconst char *regex,\n"
7048 "\t\tconst char *path);\n"
7053 #: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:1448
7054 msgid "This calls the external C<grep> program and returns the matching lines."
7058 #: ../src/guestfs-actions.pod:1852
7059 msgid "guestfs_grepi"
7063 #: ../src/guestfs-actions.pod:1854
7066 " char **guestfs_grepi (guestfs_h *g,\n"
7067 "\t\tconst char *regex,\n"
7068 "\t\tconst char *path);\n"
7073 #: ../src/guestfs-actions.pod:1858 ../fish/guestfish-actions.pod:1458
7074 msgid "This calls the external C<grep -i> program and returns the matching lines."
7078 #: ../src/guestfs-actions.pod:1868
7079 msgid "guestfs_grub_install"
7083 #: ../src/guestfs-actions.pod:1870
7086 " int guestfs_grub_install (guestfs_h *g,\n"
7087 "\t\tconst char *root,\n"
7088 "\t\tconst char *device);\n"
7093 #: ../src/guestfs-actions.pod:1874 ../fish/guestfish-actions.pod:1468
7095 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
7096 "the root directory being C<root>."
7100 #: ../src/guestfs-actions.pod:1877 ../fish/guestfish-actions.pod:1471
7102 "Note: If grub-install reports the error \"No suitable drive was found in the "
7103 "generated device map.\" it may be that you need to create a "
7104 "C</boot/grub/device.map> file first that contains the mapping between grub "
7105 "device names and Linux device names. It is usually sufficient to create a "
7110 #: ../src/guestfs-actions.pod:1884 ../fish/guestfish-actions.pod:1478
7118 #: ../src/guestfs-actions.pod:1886 ../fish/guestfish-actions.pod:1480
7119 msgid "replacing C</dev/vda> with the name of the installation device."
7123 #: ../src/guestfs-actions.pod:1890
7124 msgid "guestfs_head"
7128 #: ../src/guestfs-actions.pod:1892
7131 " char **guestfs_head (guestfs_h *g,\n"
7132 "\t\tconst char *path);\n"
7137 #: ../src/guestfs-actions.pod:1895 ../fish/guestfish-actions.pod:1486
7139 "This command returns up to the first 10 lines of a file as a list of "
7144 #: ../src/guestfs-actions.pod:1905
7145 msgid "guestfs_head_n"
7149 #: ../src/guestfs-actions.pod:1907
7152 " char **guestfs_head_n (guestfs_h *g,\n"
7153 "\t\tint nrlines,\n"
7154 "\t\tconst char *path);\n"
7159 #: ../src/guestfs-actions.pod:1911 ../fish/guestfish-actions.pod:1496
7161 "If the parameter C<nrlines> is a positive number, this returns the first "
7162 "C<nrlines> lines of the file C<path>."
7166 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1499
7168 "If the parameter C<nrlines> is a negative number, this returns lines from "
7169 "the file C<path>, excluding the last C<nrlines> lines."
7173 #: ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:5037 ../fish/guestfish-actions.pod:1502 ../fish/guestfish-actions.pod:3897
7174 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7178 #: ../src/guestfs-actions.pod:1926
7179 msgid "guestfs_hexdump"
7183 #: ../src/guestfs-actions.pod:1928
7186 " char *guestfs_hexdump (guestfs_h *g,\n"
7187 "\t\tconst char *path);\n"
7192 #: ../src/guestfs-actions.pod:1931 ../fish/guestfish-actions.pod:1511
7194 "This runs C<hexdump -C> on the given C<path>. The result is the "
7195 "human-readable, canonical hex dump of the file."
7199 #: ../src/guestfs-actions.pod:1940
7200 msgid "guestfs_initrd_cat"
7204 #: ../src/guestfs-actions.pod:1942
7207 " char *guestfs_initrd_cat (guestfs_h *g,\n"
7208 "\t\tconst char *initrdpath,\n"
7209 "\t\tconst char *filename,\n"
7210 "\t\tsize_t *size_r);\n"
7215 #: ../src/guestfs-actions.pod:1947 ../fish/guestfish-actions.pod:1521
7217 "This command unpacks the file C<filename> from the initrd file called "
7218 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7223 #: ../src/guestfs-actions.pod:1951 ../fish/guestfish-actions.pod:1525
7225 "For example, in guestfish you could use the following command to examine the "
7226 "boot script (usually called C</init>) contained in a Linux initrd or "
7231 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1529
7234 " initrd-cat /boot/initrd-<version>.img init\n"
7239 #: ../src/guestfs-actions.pod:1957
7240 msgid "See also C<guestfs_initrd_list>."
7244 #: ../src/guestfs-actions.pod:1959 ../src/guestfs-actions.pod:3949 ../src/guestfs-actions.pod:3972 ../src/guestfs-actions.pod:4124
7246 "This function returns a buffer, or NULL on error. The size of the returned "
7247 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
7252 #: ../src/guestfs-actions.pod:1966
7253 msgid "guestfs_initrd_list"
7257 #: ../src/guestfs-actions.pod:1968
7260 " char **guestfs_initrd_list (guestfs_h *g,\n"
7261 "\t\tconst char *path);\n"
7266 #: ../src/guestfs-actions.pod:1971 ../fish/guestfish-actions.pod:1540
7267 msgid "This command lists out files contained in an initrd."
7271 #: ../src/guestfs-actions.pod:1973 ../fish/guestfish-actions.pod:1542
7273 "The files are listed without any initial C</> character. The files are "
7274 "listed in the order they appear (not necessarily alphabetical). Directory "
7275 "names are listed as separate items."
7279 #: ../src/guestfs-actions.pod:1977 ../fish/guestfish-actions.pod:1546
7281 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7282 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7287 #: ../src/guestfs-actions.pod:1985
7288 msgid "guestfs_inotify_add_watch"
7292 #: ../src/guestfs-actions.pod:1987
7295 " int64_t guestfs_inotify_add_watch (guestfs_h *g,\n"
7296 "\t\tconst char *path,\n"
7302 #: ../src/guestfs-actions.pod:1991 ../fish/guestfish-actions.pod:1554
7303 msgid "Watch C<path> for the events listed in C<mask>."
7307 #: ../src/guestfs-actions.pod:1993 ../fish/guestfish-actions.pod:1556
7309 "Note that if C<path> is a directory then events within that directory are "
7310 "watched, but this does I<not> happen recursively (in subdirectories)."
7314 #: ../src/guestfs-actions.pod:1997 ../fish/guestfish-actions.pod:1560
7316 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7317 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7321 #: ../src/guestfs-actions.pod:2003
7322 msgid "guestfs_inotify_close"
7326 #: ../src/guestfs-actions.pod:2005
7329 " int guestfs_inotify_close (guestfs_h *g);\n"
7334 #: ../src/guestfs-actions.pod:2007 ../fish/guestfish-actions.pod:1568
7336 "This closes the inotify handle which was previously opened by inotify_init. "
7337 "It removes all watches, throws away any pending events, and deallocates all "
7342 #: ../src/guestfs-actions.pod:2013
7343 msgid "guestfs_inotify_files"
7347 #: ../src/guestfs-actions.pod:2015
7350 " char **guestfs_inotify_files (guestfs_h *g);\n"
7355 #: ../src/guestfs-actions.pod:2017
7357 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
7358 "returns a list of pathnames of objects that were touched. The returned "
7359 "pathnames are sorted and deduplicated."
7363 #: ../src/guestfs-actions.pod:2025
7364 msgid "guestfs_inotify_init"
7368 #: ../src/guestfs-actions.pod:2027
7371 " int guestfs_inotify_init (guestfs_h *g,\n"
7372 "\t\tint maxevents);\n"
7377 #: ../src/guestfs-actions.pod:2030 ../fish/guestfish-actions.pod:1584
7379 "This command creates a new inotify handle. The inotify subsystem can be "
7380 "used to notify events which happen to objects in the guest filesystem."
7384 #: ../src/guestfs-actions.pod:2034
7386 "C<maxevents> is the maximum number of events which will be queued up between "
7387 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
7388 "passed as C<0>, then the kernel (or previously set) default is used. For "
7389 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
7390 "throws away events, but records the fact that it threw them away by setting "
7391 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
7392 "C<guestfs_inotify_read>)."
7396 #: ../src/guestfs-actions.pod:2044
7398 "Before any events are generated, you have to add some watches to the "
7399 "internal watch list. See: C<guestfs_inotify_add_watch>, "
7400 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
7404 #: ../src/guestfs-actions.pod:2050
7406 "Queued up events should be read periodically by calling "
7407 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
7408 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
7409 "often enough then you risk the internal queue overflowing."
7413 #: ../src/guestfs-actions.pod:2057
7415 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
7416 "This also removes any watches automatically."
7420 #: ../src/guestfs-actions.pod:2061 ../fish/guestfish-actions.pod:1615
7422 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7423 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7424 "that there is one global inotify handle per libguestfs instance."
7428 #: ../src/guestfs-actions.pod:2068
7429 msgid "guestfs_inotify_read"
7433 #: ../src/guestfs-actions.pod:2070
7436 " struct guestfs_inotify_event_list *guestfs_inotify_read (guestfs_h *g);\n"
7441 #: ../src/guestfs-actions.pod:2072 ../fish/guestfish-actions.pod:1624
7443 "Return the complete queue of events that have happened since the previous "
7448 #: ../src/guestfs-actions.pod:2075 ../fish/guestfish-actions.pod:1627
7449 msgid "If no events have happened, this returns an empty list."
7453 #: ../src/guestfs-actions.pod:2077 ../fish/guestfish-actions.pod:1629
7455 "I<Note>: In order to make sure that all events have been read, you must call "
7456 "this function repeatedly until it returns an empty list. The reason is that "
7457 "the call will read events up to the maximum appliance-to-host message size "
7458 "and leave remaining events in the queue."
7462 #: ../src/guestfs-actions.pod:2083
7464 "This function returns a C<struct guestfs_inotify_event_list *> (see "
7465 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7466 "must call C<guestfs_free_inotify_event_list> after use>."
7470 #: ../src/guestfs-actions.pod:2088
7471 msgid "guestfs_inotify_rm_watch"
7475 #: ../src/guestfs-actions.pod:2090
7478 " int guestfs_inotify_rm_watch (guestfs_h *g,\n"
7484 #: ../src/guestfs-actions.pod:2093
7486 "Remove a previously defined inotify watch. See "
7487 "C<guestfs_inotify_add_watch>."
7491 #: ../src/guestfs-actions.pod:2098
7492 msgid "guestfs_inspect_get_arch"
7496 #: ../src/guestfs-actions.pod:2100
7499 " char *guestfs_inspect_get_arch (guestfs_h *g,\n"
7500 "\t\tconst char *root);\n"
7505 #: ../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 ../src/guestfs-actions.pod:2324
7507 "This function should only be called with a root device string as returned by "
7508 "C<guestfs_inspect_os>."
7512 #: ../src/guestfs-actions.pod:2106
7514 "This returns the architecture of the inspected operating system. The "
7515 "possible return values are listed under C<guestfs_file_architecture>."
7519 #: ../src/guestfs-actions.pod:2110 ../fish/guestfish-actions.pod:1653
7521 "If the architecture could not be determined, then the string C<unknown> is "
7526 #: ../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:2334 ../src/guestfs-actions.pod:2371 ../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:1843 ../fish/guestfish-actions.pod:1877
7527 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7531 #: ../src/guestfs-actions.pod:2118
7532 msgid "guestfs_inspect_get_distro"
7536 #: ../src/guestfs-actions.pod:2120
7539 " char *guestfs_inspect_get_distro (guestfs_h *g,\n"
7540 "\t\tconst char *root);\n"
7545 #: ../src/guestfs-actions.pod:2126 ../fish/guestfish-actions.pod:1665
7546 msgid "This returns the distro (distribution) of the inspected operating system."
7550 #: ../src/guestfs-actions.pod:2129 ../fish/guestfish-actions.pod:1668
7551 msgid "Currently defined distros are:"
7555 #: ../src/guestfs-actions.pod:2133 ../fish/guestfish-actions.pod:1672
7560 #: ../src/guestfs-actions.pod:2135 ../fish/guestfish-actions.pod:1674
7561 msgid "Debian or a Debian-derived distro such as Ubuntu."
7565 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1676
7570 #: ../src/guestfs-actions.pod:2139 ../fish/guestfish-actions.pod:1678
7575 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1680
7576 msgid "\"redhat-based\""
7580 #: ../src/guestfs-actions.pod:2143 ../fish/guestfish-actions.pod:1682
7581 msgid "Some Red Hat-derived distro."
7585 #: ../src/guestfs-actions.pod:2145 ../fish/guestfish-actions.pod:1684
7590 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1686
7591 msgid "Red Hat Enterprise Linux and some derivatives."
7595 #: ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:2301 ../fish/guestfish-actions.pod:1688 ../fish/guestfish-actions.pod:1814
7600 #: ../src/guestfs-actions.pod:2151 ../fish/guestfish-actions.pod:1690
7602 "Windows does not have distributions. This string is returned if the OS type "
7607 #: ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:2305 ../fish/guestfish-actions.pod:1693 ../fish/guestfish-actions.pod:1818
7612 #: ../src/guestfs-actions.pod:2156 ../fish/guestfish-actions.pod:1695
7613 msgid "The distro could not be determined."
7617 #: ../src/guestfs-actions.pod:2160 ../src/guestfs-actions.pod:2311 ../fish/guestfish-actions.pod:1699 ../fish/guestfish-actions.pod:1824
7619 "Future versions of libguestfs may return other strings here. The caller "
7620 "should be prepared to handle any string."
7624 #: ../src/guestfs-actions.pod:2168
7625 msgid "guestfs_inspect_get_filesystems"
7629 #: ../src/guestfs-actions.pod:2170
7632 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
7633 "\t\tconst char *root);\n"
7638 #: ../src/guestfs-actions.pod:2176 ../fish/guestfish-actions.pod:1711
7640 "This returns a list of all the filesystems that we think are associated with "
7641 "this operating system. This includes the root filesystem, other ordinary "
7642 "filesystems, and non-mounted devices like swap partitions."
7646 #: ../src/guestfs-actions.pod:2181 ../fish/guestfish-actions.pod:1716
7648 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7649 "to be shared between operating systems."
7653 #: ../src/guestfs-actions.pod:2184
7655 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7656 "C<guestfs_inspect_get_mountpoints>."
7660 #: ../src/guestfs-actions.pod:2191
7661 msgid "guestfs_inspect_get_major_version"
7665 #: ../src/guestfs-actions.pod:2193
7668 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
7669 "\t\tconst char *root);\n"
7674 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1729
7675 msgid "This returns the major version number of the inspected operating system."
7679 #: ../src/guestfs-actions.pod:2202 ../fish/guestfish-actions.pod:1732
7681 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7682 "popular public names used by the operating system. Notably the operating "
7683 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7684 "1). You can find out the real versions corresponding to releases of Windows "
7685 "by consulting Wikipedia or MSDN."
7689 #: ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2226 ../fish/guestfish-actions.pod:1739 ../fish/guestfish-actions.pod:1753
7690 msgid "If the version could not be determined, then C<0> is returned."
7694 #: ../src/guestfs-actions.pod:2215
7695 msgid "guestfs_inspect_get_minor_version"
7699 #: ../src/guestfs-actions.pod:2217
7702 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
7703 "\t\tconst char *root);\n"
7708 #: ../src/guestfs-actions.pod:2223 ../fish/guestfish-actions.pod:1750
7709 msgid "This returns the minor version number of the inspected operating system."
7713 #: ../src/guestfs-actions.pod:2228
7715 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7716 "C<guestfs_inspect_get_major_version>."
7720 #: ../src/guestfs-actions.pod:2233
7721 msgid "guestfs_inspect_get_mountpoints"
7725 #: ../src/guestfs-actions.pod:2235
7728 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
7729 "\t\tconst char *root);\n"
7734 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1765
7736 "This returns a hash of where we think the filesystems associated with this "
7737 "operating system should be mounted. Callers should note that this is at "
7738 "best an educated guess made by reading configuration files such as "
7743 #: ../src/guestfs-actions.pod:2246 ../fish/guestfish-actions.pod:1770
7745 "Each element in the returned hashtable has a key which is the path of the "
7746 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7747 "mounted there (eg. C</dev/sda1>)."
7751 #: ../src/guestfs-actions.pod:2251 ../fish/guestfish-actions.pod:1775
7752 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
7756 #: ../src/guestfs-actions.pod:2254
7758 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7759 "C<guestfs_inspect_get_filesystems>."
7763 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:2617 ../src/guestfs-actions.pod:3571 ../src/guestfs-actions.pod:5154
7765 "This function returns a NULL-terminated array of strings, or NULL if there "
7766 "was an error. The array of strings will always have length C<2n+1>, where "
7767 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
7768 "caller must free the strings and the array after use>."
7772 #: ../src/guestfs-actions.pod:2263
7773 msgid "guestfs_inspect_get_product_name"
7777 #: ../src/guestfs-actions.pod:2265
7780 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
7781 "\t\tconst char *root);\n"
7786 #: ../src/guestfs-actions.pod:2271 ../fish/guestfish-actions.pod:1788
7788 "This returns the product name of the inspected operating system. The "
7789 "product name is generally some freeform string which can be displayed to the "
7790 "user, but should not be parsed by programs."
7794 #: ../src/guestfs-actions.pod:2276 ../fish/guestfish-actions.pod:1793
7796 "If the product name could not be determined, then the string C<unknown> is "
7801 #: ../src/guestfs-actions.pod:2284
7802 msgid "guestfs_inspect_get_type"
7806 #: ../src/guestfs-actions.pod:2286
7809 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
7810 "\t\tconst char *root);\n"
7815 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1805
7817 "This returns the type of the inspected operating system. Currently defined "
7822 #: ../src/guestfs-actions.pod:2297 ../fish/guestfish-actions.pod:1810
7827 #: ../src/guestfs-actions.pod:2299 ../fish/guestfish-actions.pod:1812
7828 msgid "Any Linux-based operating system."
7832 #: ../src/guestfs-actions.pod:2303 ../fish/guestfish-actions.pod:1816
7833 msgid "Any Microsoft Windows operating system."
7837 #: ../src/guestfs-actions.pod:2307 ../fish/guestfish-actions.pod:1820
7838 msgid "The operating system type could not be determined."
7842 #: ../src/guestfs-actions.pod:2319
7843 msgid "guestfs_inspect_get_windows_systemroot"
7847 #: ../src/guestfs-actions.pod:2321
7850 " char *guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
7851 "\t\tconst char *root);\n"
7856 #: ../src/guestfs-actions.pod:2327 ../fish/guestfish-actions.pod:1836
7858 "This returns the Windows systemroot of the inspected guest. The systemroot "
7859 "is a directory path such as C</WINDOWS>."
7863 #: ../src/guestfs-actions.pod:2330 ../fish/guestfish-actions.pod:1839
7865 "This call assumes that the guest is Windows and that the systemroot could be "
7866 "determined by inspection. If this is not the case then an error is "
7871 #: ../src/guestfs-actions.pod:2339
7872 msgid "guestfs_inspect_os"
7876 #: ../src/guestfs-actions.pod:2341
7879 " char **guestfs_inspect_os (guestfs_h *g);\n"
7884 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1849
7886 "This function uses other libguestfs functions and certain heuristics to "
7887 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
7888 "for operating systems."
7892 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1853
7893 msgid "The list returned is empty if no operating systems were found."
7897 #: ../src/guestfs-actions.pod:2349 ../fish/guestfish-actions.pod:1855
7899 "If one operating system was found, then this returns a list with a single "
7900 "element, which is the name of the root filesystem of this operating system. "
7901 "It is also possible for this function to return a list containing more than "
7902 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
7903 "element being the root filesystem of one of the operating systems."
7907 #: ../src/guestfs-actions.pod:2356
7909 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
7910 "functions in order to query further information about each operating system, "
7911 "such as the name and version."
7915 #: ../src/guestfs-actions.pod:2361
7917 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
7918 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
7919 "the contents. This should be called with no disks currently mounted. The "
7920 "function may also use Augeas, so any existing Augeas handle will be closed."
7924 #: ../src/guestfs-actions.pod:2367 ../fish/guestfish-actions.pod:1873
7926 "This function cannot decrypt encrypted disks. The caller must do that first "
7927 "(supplying the necessary keys) if the disk is encrypted."
7931 #: ../src/guestfs-actions.pod:2373 ../src/guestfs-actions.pod:2578 ../src/guestfs-actions.pod:2634
7932 msgid "See also C<guestfs_list_filesystems>."
7936 #: ../src/guestfs-actions.pod:2379
7937 msgid "guestfs_is_blockdev"
7941 #: ../src/guestfs-actions.pod:2381
7944 " int guestfs_is_blockdev (guestfs_h *g,\n"
7945 "\t\tconst char *path);\n"
7950 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1885
7952 "This returns C<true> if and only if there is a block device with the given "
7957 #: ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2410 ../src/guestfs-actions.pod:2434 ../src/guestfs-actions.pod:2446 ../src/guestfs-actions.pod:2459 ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2515
7958 msgid "See also C<guestfs_stat>."
7962 #: ../src/guestfs-actions.pod:2391
7963 msgid "guestfs_is_busy"
7967 #: ../src/guestfs-actions.pod:2393
7970 " int guestfs_is_busy (guestfs_h *g);\n"
7975 #: ../src/guestfs-actions.pod:2395 ../fish/guestfish-actions.pod:1894
7977 "This returns true iff this handle is busy processing a command (in the "
7982 #: ../src/guestfs-actions.pod:2402
7983 msgid "guestfs_is_chardev"
7987 #: ../src/guestfs-actions.pod:2404
7990 " int guestfs_is_chardev (guestfs_h *g,\n"
7991 "\t\tconst char *path);\n"
7996 #: ../src/guestfs-actions.pod:2407 ../fish/guestfish-actions.pod:1903
7998 "This returns C<true> if and only if there is a character device with the "
7999 "given C<path> name."
8003 #: ../src/guestfs-actions.pod:2414
8004 msgid "guestfs_is_config"
8008 #: ../src/guestfs-actions.pod:2416
8011 " int guestfs_is_config (guestfs_h *g);\n"
8016 #: ../src/guestfs-actions.pod:2418 ../fish/guestfish-actions.pod:1912
8018 "This returns true iff this handle is being configured (in the C<CONFIG> "
8023 #: ../src/guestfs-actions.pod:2425
8024 msgid "guestfs_is_dir"
8028 #: ../src/guestfs-actions.pod:2427
8031 " int guestfs_is_dir (guestfs_h *g,\n"
8032 "\t\tconst char *path);\n"
8037 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1921
8039 "This returns C<true> if and only if there is a directory with the given "
8040 "C<path> name. Note that it returns false for other objects like files."
8044 #: ../src/guestfs-actions.pod:2438
8045 msgid "guestfs_is_fifo"
8049 #: ../src/guestfs-actions.pod:2440
8052 " int guestfs_is_fifo (guestfs_h *g,\n"
8053 "\t\tconst char *path);\n"
8058 #: ../src/guestfs-actions.pod:2443 ../fish/guestfish-actions.pod:1931
8060 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
8061 "given C<path> name."
8065 #: ../src/guestfs-actions.pod:2450
8066 msgid "guestfs_is_file"
8070 #: ../src/guestfs-actions.pod:2452
8073 " int guestfs_is_file (guestfs_h *g,\n"
8074 "\t\tconst char *path);\n"
8079 #: ../src/guestfs-actions.pod:2455 ../fish/guestfish-actions.pod:1940
8081 "This returns C<true> if and only if there is a regular file with the given "
8082 "C<path> name. Note that it returns false for other objects like "
8087 #: ../src/guestfs-actions.pod:2463
8088 msgid "guestfs_is_launching"
8092 #: ../src/guestfs-actions.pod:2465
8095 " int guestfs_is_launching (guestfs_h *g);\n"
8100 #: ../src/guestfs-actions.pod:2467 ../fish/guestfish-actions.pod:1950
8102 "This returns true iff this handle is launching the subprocess (in the "
8103 "C<LAUNCHING> state)."
8107 #: ../src/guestfs-actions.pod:2474
8108 msgid "guestfs_is_lv"
8112 #: ../src/guestfs-actions.pod:2476
8115 " int guestfs_is_lv (guestfs_h *g,\n"
8116 "\t\tconst char *device);\n"
8121 #: ../src/guestfs-actions.pod:2479 ../fish/guestfish-actions.pod:1959
8123 "This command tests whether C<device> is a logical volume, and returns true "
8124 "iff this is the case."
8128 #: ../src/guestfs-actions.pod:2484
8129 msgid "guestfs_is_ready"
8133 #: ../src/guestfs-actions.pod:2486
8136 " int guestfs_is_ready (guestfs_h *g);\n"
8141 #: ../src/guestfs-actions.pod:2488 ../fish/guestfish-actions.pod:1966
8143 "This returns true iff this handle is ready to accept commands (in the "
8148 #: ../src/guestfs-actions.pod:2495
8149 msgid "guestfs_is_socket"
8153 #: ../src/guestfs-actions.pod:2497
8156 " int guestfs_is_socket (guestfs_h *g,\n"
8157 "\t\tconst char *path);\n"
8162 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1975
8164 "This returns C<true> if and only if there is a Unix domain socket with the "
8165 "given C<path> name."
8169 #: ../src/guestfs-actions.pod:2507
8170 msgid "guestfs_is_symlink"
8174 #: ../src/guestfs-actions.pod:2509
8177 " int guestfs_is_symlink (guestfs_h *g,\n"
8178 "\t\tconst char *path);\n"
8183 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1984
8185 "This returns C<true> if and only if there is a symbolic link with the given "
8190 #: ../src/guestfs-actions.pod:2519
8191 msgid "guestfs_kill_subprocess"
8195 #: ../src/guestfs-actions.pod:2521
8198 " int guestfs_kill_subprocess (guestfs_h *g);\n"
8203 #: ../src/guestfs-actions.pod:2523 ../fish/guestfish-actions.pod:1993
8204 msgid "This kills the qemu subprocess. You should never need to call this."
8208 #: ../src/guestfs-actions.pod:2527
8209 msgid "guestfs_launch"
8213 #: ../src/guestfs-actions.pod:2529
8216 " int guestfs_launch (guestfs_h *g);\n"
8221 #: ../src/guestfs-actions.pod:2531 ../fish/guestfish-actions.pod:2001
8223 "Internally libguestfs is implemented by running a virtual machine using "
8228 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:2004
8230 "You should call this after configuring the handle (eg. adding drives) but "
8231 "before performing any actions."
8235 #: ../src/guestfs-actions.pod:2539
8236 msgid "guestfs_lchown"
8240 #: ../src/guestfs-actions.pod:2541
8243 " int guestfs_lchown (guestfs_h *g,\n"
8246 "\t\tconst char *path);\n"
8251 #: ../src/guestfs-actions.pod:2546
8253 "Change the file owner to C<owner> and group to C<group>. This is like "
8254 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
8255 "changed, not the target."
8259 #: ../src/guestfs-actions.pod:2556
8260 msgid "guestfs_lgetxattrs"
8264 #: ../src/guestfs-actions.pod:2558
8267 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
8268 "\t\tconst char *path);\n"
8273 #: ../src/guestfs-actions.pod:2561
8275 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
8276 "then it returns the extended attributes of the link itself."
8280 #: ../src/guestfs-actions.pod:2570
8281 msgid "guestfs_list_devices"
8285 #: ../src/guestfs-actions.pod:2572
8288 " char **guestfs_list_devices (guestfs_h *g);\n"
8293 #: ../src/guestfs-actions.pod:2574 ../fish/guestfish-actions.pod:2031
8294 msgid "List all the block devices."
8298 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:2033
8299 msgid "The full block device names are returned, eg. C</dev/sda>."
8303 #: ../src/guestfs-actions.pod:2584
8304 msgid "guestfs_list_filesystems"
8308 #: ../src/guestfs-actions.pod:2586
8311 " char **guestfs_list_filesystems (guestfs_h *g);\n"
8316 #: ../src/guestfs-actions.pod:2588 ../fish/guestfish-actions.pod:2041
8318 "This inspection command looks for filesystems on partitions, block devices "
8319 "and logical volumes, returning a list of devices containing filesystems and "
8324 #: ../src/guestfs-actions.pod:2592 ../fish/guestfish-actions.pod:2045
8326 "The return value is a hash, where the keys are the devices containing "
8327 "filesystems, and the values are the filesystem types. For example:"
8331 #: ../src/guestfs-actions.pod:2596 ../fish/guestfish-actions.pod:2049
8334 " \"/dev/sda1\" => \"ntfs\"\n"
8335 " \"/dev/sda2\" => \"ext2\"\n"
8336 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
8337 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
8342 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:2054
8344 "The value can have the special value \"unknown\", meaning the content of the "
8345 "device is undetermined or empty. \"swap\" means a Linux swap partition."
8349 #: ../src/guestfs-actions.pod:2605
8351 "This command runs other libguestfs commands, which might include "
8352 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
8353 "soon after launch and only when nothing is mounted."
8357 #: ../src/guestfs-actions.pod:2609
8359 "Not all of the filesystems returned will be mountable. In particular, swap "
8360 "partitions are returned in the list. Also this command does not check that "
8361 "each filesystem found is valid and mountable, and some filesystems might be "
8362 "mountable but require special options. Filesystems may not all belong to a "
8363 "single logical operating system (use C<guestfs_inspect_os> to look for "
8368 #: ../src/guestfs-actions.pod:2623
8369 msgid "guestfs_list_partitions"
8373 #: ../src/guestfs-actions.pod:2625
8376 " char **guestfs_list_partitions (guestfs_h *g);\n"
8381 #: ../src/guestfs-actions.pod:2627 ../fish/guestfish-actions.pod:2074
8382 msgid "List all the partitions detected on all block devices."
8386 #: ../src/guestfs-actions.pod:2629 ../fish/guestfish-actions.pod:2076
8387 msgid "The full partition device names are returned, eg. C</dev/sda1>"
8391 #: ../src/guestfs-actions.pod:2631
8393 "This does not return logical volumes. For that you will need to call "
8398 #: ../src/guestfs-actions.pod:2640
8403 #: ../src/guestfs-actions.pod:2642
8406 " char *guestfs_ll (guestfs_h *g,\n"
8407 "\t\tconst char *directory);\n"
8412 #: ../src/guestfs-actions.pod:2645 ../fish/guestfish-actions.pod:2087
8414 "List the files in C<directory> (relative to the root directory, there is no "
8415 "cwd) in the format of 'ls -la'."
8419 #: ../src/guestfs-actions.pod:2648 ../fish/guestfish-actions.pod:2090
8421 "This command is mostly useful for interactive sessions. It is I<not> "
8422 "intended that you try to parse the output string."
8426 #: ../src/guestfs-actions.pod:2654
8431 #: ../src/guestfs-actions.pod:2656
8434 " int guestfs_ln (guestfs_h *g,\n"
8435 "\t\tconst char *target,\n"
8436 "\t\tconst char *linkname);\n"
8441 #: ../src/guestfs-actions.pod:2660 ../fish/guestfish-actions.pod:2097
8442 msgid "This command creates a hard link using the C<ln> command."
8446 #: ../src/guestfs-actions.pod:2664
8447 msgid "guestfs_ln_f"
8451 #: ../src/guestfs-actions.pod:2666
8454 " int guestfs_ln_f (guestfs_h *g,\n"
8455 "\t\tconst char *target,\n"
8456 "\t\tconst char *linkname);\n"
8461 #: ../src/guestfs-actions.pod:2670 ../fish/guestfish-actions.pod:2103
8463 "This command creates a hard link using the C<ln -f> command. The C<-f> "
8464 "option removes the link (C<linkname>) if it exists already."
8468 #: ../src/guestfs-actions.pod:2675
8469 msgid "guestfs_ln_s"
8473 #: ../src/guestfs-actions.pod:2677
8476 " int guestfs_ln_s (guestfs_h *g,\n"
8477 "\t\tconst char *target,\n"
8478 "\t\tconst char *linkname);\n"
8483 #: ../src/guestfs-actions.pod:2681 ../fish/guestfish-actions.pod:2110
8484 msgid "This command creates a symbolic link using the C<ln -s> command."
8488 #: ../src/guestfs-actions.pod:2685
8489 msgid "guestfs_ln_sf"
8493 #: ../src/guestfs-actions.pod:2687
8496 " int guestfs_ln_sf (guestfs_h *g,\n"
8497 "\t\tconst char *target,\n"
8498 "\t\tconst char *linkname);\n"
8503 #: ../src/guestfs-actions.pod:2691 ../fish/guestfish-actions.pod:2116
8505 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8506 "option removes the link (C<linkname>) if it exists already."
8510 #: ../src/guestfs-actions.pod:2696
8511 msgid "guestfs_lremovexattr"
8515 #: ../src/guestfs-actions.pod:2698
8518 " int guestfs_lremovexattr (guestfs_h *g,\n"
8519 "\t\tconst char *xattr,\n"
8520 "\t\tconst char *path);\n"
8525 #: ../src/guestfs-actions.pod:2702
8527 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8528 "link, then it removes an extended attribute of the link itself."
8532 #: ../src/guestfs-actions.pod:2708
8537 #: ../src/guestfs-actions.pod:2710
8540 " char **guestfs_ls (guestfs_h *g,\n"
8541 "\t\tconst char *directory);\n"
8546 #: ../src/guestfs-actions.pod:2713 ../fish/guestfish-actions.pod:2131
8548 "List the files in C<directory> (relative to the root directory, there is no "
8549 "cwd). The '.' and '..' entries are not returned, but hidden files are "
8554 #: ../src/guestfs-actions.pod:2717
8556 "This command is mostly useful for interactive sessions. Programs should "
8557 "probably use C<guestfs_readdir> instead."
8561 #: ../src/guestfs-actions.pod:2724
8562 msgid "guestfs_lsetxattr"
8566 #: ../src/guestfs-actions.pod:2726
8569 " int guestfs_lsetxattr (guestfs_h *g,\n"
8570 "\t\tconst char *xattr,\n"
8571 "\t\tconst char *val,\n"
8573 "\t\tconst char *path);\n"
8578 #: ../src/guestfs-actions.pod:2732
8580 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8581 "then it sets an extended attribute of the link itself."
8585 #: ../src/guestfs-actions.pod:2738
8586 msgid "guestfs_lstat"
8590 #: ../src/guestfs-actions.pod:2740
8593 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8594 "\t\tconst char *path);\n"
8599 #: ../src/guestfs-actions.pod:2743 ../src/guestfs-actions.pod:4819 ../fish/guestfish-actions.pod:2150 ../fish/guestfish-actions.pod:3732
8600 msgid "Returns file information for the given C<path>."
8604 #: ../src/guestfs-actions.pod:2745
8606 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8607 "link, then the link is stat-ed, not the file it refers to."
8611 #: ../src/guestfs-actions.pod:2749 ../fish/guestfish-actions.pod:2156
8612 msgid "This is the same as the C<lstat(2)> system call."
8616 #: ../src/guestfs-actions.pod:2751 ../src/guestfs-actions.pod:4823
8618 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8619 "error. I<The caller must call C<guestfs_free_stat> after use>."
8623 #: ../src/guestfs-actions.pod:2755
8624 msgid "guestfs_lstatlist"
8628 #: ../src/guestfs-actions.pod:2757
8631 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8632 "\t\tconst char *path,\n"
8633 "\t\tchar *const *names);\n"
8638 #: ../src/guestfs-actions.pod:2761
8640 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8641 "files, where all files are in the directory C<path>. C<names> is the list "
8642 "of files from this directory."
8646 #: ../src/guestfs-actions.pod:2765 ../fish/guestfish-actions.pod:2166
8648 "On return you get a list of stat structs, with a one-to-one correspondence "
8649 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8650 "then the C<ino> field of that structure is set to C<-1>."
8654 #: ../src/guestfs-actions.pod:2770
8656 "This call is intended for programs that want to efficiently list a directory "
8657 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
8658 "for a similarly efficient call for getting extended attributes. Very long "
8659 "directory listings might cause the protocol message size to be exceeded, "
8660 "causing this call to fail. The caller must split up such requests into "
8661 "smaller groups of names."
8665 #: ../src/guestfs-actions.pod:2778
8667 "This function returns a C<struct guestfs_stat_list *> (see "
8668 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
8669 "must call C<guestfs_free_stat_list> after use>."
8673 #: ../src/guestfs-actions.pod:2783
8674 msgid "guestfs_luks_add_key"
8678 #: ../src/guestfs-actions.pod:2785
8681 " int guestfs_luks_add_key (guestfs_h *g,\n"
8682 "\t\tconst char *device,\n"
8683 "\t\tconst char *key,\n"
8684 "\t\tconst char *newkey,\n"
8685 "\t\tint keyslot);\n"
8690 #: ../src/guestfs-actions.pod:2791 ../fish/guestfish-actions.pod:2183
8692 "This command adds a new key on LUKS device C<device>. C<key> is any "
8693 "existing key, and is used to access the device. C<newkey> is the new key to "
8694 "add. C<keyslot> is the key slot that will be replaced."
8698 #: ../src/guestfs-actions.pod:2796
8700 "Note that if C<keyslot> already contains a key, then this command will "
8701 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
8705 #: ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2836 ../src/guestfs-actions.pod:2856 ../src/guestfs-actions.pod:2873 ../src/guestfs-actions.pod:2902 ../src/guestfs-actions.pod:2918
8707 "This function takes a key or passphrase parameter which could contain "
8708 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
8713 #: ../src/guestfs-actions.pod:2806
8714 msgid "guestfs_luks_close"
8718 #: ../src/guestfs-actions.pod:2808
8721 " int guestfs_luks_close (guestfs_h *g,\n"
8722 "\t\tconst char *device);\n"
8727 #: ../src/guestfs-actions.pod:2811
8729 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
8730 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
8731 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
8732 "underlying block device."
8736 #: ../src/guestfs-actions.pod:2819
8737 msgid "guestfs_luks_format"
8741 #: ../src/guestfs-actions.pod:2821
8744 " int guestfs_luks_format (guestfs_h *g,\n"
8745 "\t\tconst char *device,\n"
8746 "\t\tconst char *key,\n"
8747 "\t\tint keyslot);\n"
8752 #: ../src/guestfs-actions.pod:2826 ../fish/guestfish-actions.pod:2209
8754 "This command erases existing data on C<device> and formats the device as a "
8755 "LUKS encrypted device. C<key> is the initial key, which is added to key "
8756 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
8760 #: ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2853 ../src/guestfs-actions.pod:2972 ../src/guestfs-actions.pod:3699 ../src/guestfs-actions.pod:4360 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4701 ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:5689 ../fish/guestfish-actions.pod:2217 ../fish/guestfish-actions.pod:2230 ../fish/guestfish-actions.pod:2314 ../fish/guestfish-actions.pod:2844 ../fish/guestfish-actions.pod:3351 ../fish/guestfish-actions.pod:3631 ../fish/guestfish-actions.pod:3647 ../fish/guestfish-actions.pod:3662 ../fish/guestfish-actions.pod:4377
8762 "B<This command is dangerous. Without careful use you can easily destroy all "
8767 #: ../src/guestfs-actions.pod:2840
8768 msgid "guestfs_luks_format_cipher"
8772 #: ../src/guestfs-actions.pod:2842
8775 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
8776 "\t\tconst char *device,\n"
8777 "\t\tconst char *key,\n"
8778 "\t\tint keyslot,\n"
8779 "\t\tconst char *cipher);\n"
8784 #: ../src/guestfs-actions.pod:2848
8786 "This command is the same as C<guestfs_luks_format> but it also allows you to "
8787 "set the C<cipher> used."
8791 #: ../src/guestfs-actions.pod:2860
8792 msgid "guestfs_luks_kill_slot"
8796 #: ../src/guestfs-actions.pod:2862
8799 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
8800 "\t\tconst char *device,\n"
8801 "\t\tconst char *key,\n"
8802 "\t\tint keyslot);\n"
8807 #: ../src/guestfs-actions.pod:2867 ../fish/guestfish-actions.pod:2237
8809 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
8810 "device C<device>. C<key> must be one of the I<other> keys."
8814 #: ../src/guestfs-actions.pod:2877
8815 msgid "guestfs_luks_open"
8819 #: ../src/guestfs-actions.pod:2879
8822 " int guestfs_luks_open (guestfs_h *g,\n"
8823 "\t\tconst char *device,\n"
8824 "\t\tconst char *key,\n"
8825 "\t\tconst char *mapname);\n"
8830 #: ../src/guestfs-actions.pod:2884 ../fish/guestfish-actions.pod:2248
8832 "This command opens a block device which has been encrypted according to the "
8833 "Linux Unified Key Setup (LUKS) standard."
8837 #: ../src/guestfs-actions.pod:2887 ../fish/guestfish-actions.pod:2251
8838 msgid "C<device> is the encrypted block device or partition."
8842 #: ../src/guestfs-actions.pod:2889 ../fish/guestfish-actions.pod:2253
8844 "The caller must supply one of the keys associated with the LUKS block "
8845 "device, in the C<key> parameter."
8849 #: ../src/guestfs-actions.pod:2892 ../fish/guestfish-actions.pod:2256
8851 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
8852 "writes to this block device are decrypted from and encrypted to the "
8853 "underlying C<device> respectively."
8857 #: ../src/guestfs-actions.pod:2896
8859 "If this block device contains LVM volume groups, then calling "
8860 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
8865 #: ../src/guestfs-actions.pod:2906
8866 msgid "guestfs_luks_open_ro"
8870 #: ../src/guestfs-actions.pod:2908
8873 " int guestfs_luks_open_ro (guestfs_h *g,\n"
8874 "\t\tconst char *device,\n"
8875 "\t\tconst char *key,\n"
8876 "\t\tconst char *mapname);\n"
8881 #: ../src/guestfs-actions.pod:2913
8883 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
8888 #: ../src/guestfs-actions.pod:2922
8889 msgid "guestfs_lvcreate"
8893 #: ../src/guestfs-actions.pod:2924
8896 " int guestfs_lvcreate (guestfs_h *g,\n"
8897 "\t\tconst char *logvol,\n"
8898 "\t\tconst char *volgroup,\n"
8899 "\t\tint mbytes);\n"
8904 #: ../src/guestfs-actions.pod:2929 ../fish/guestfish-actions.pod:2281
8906 "This creates an LVM logical volume called C<logvol> on the volume group "
8907 "C<volgroup>, with C<size> megabytes."
8911 #: ../src/guestfs-actions.pod:2934
8912 msgid "guestfs_lvm_canonical_lv_name"
8916 #: ../src/guestfs-actions.pod:2936
8919 " char *guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
8920 "\t\tconst char *lvname);\n"
8925 #: ../src/guestfs-actions.pod:2939 ../fish/guestfish-actions.pod:2288
8927 "This converts alternative naming schemes for LVs that you might find to the "
8928 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
8933 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2292
8935 "This command returns an error if the C<lvname> parameter does not refer to a "
8940 #: ../src/guestfs-actions.pod:2946
8941 msgid "See also C<guestfs_is_lv>."
8945 #: ../src/guestfs-actions.pod:2951
8946 msgid "guestfs_lvm_clear_filter"
8950 #: ../src/guestfs-actions.pod:2953
8953 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
8958 #: ../src/guestfs-actions.pod:2955
8960 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
8961 "see every block device."
8965 #: ../src/guestfs-actions.pod:2958 ../src/guestfs-actions.pod:2994 ../fish/guestfish-actions.pod:2304 ../fish/guestfish-actions.pod:2335
8966 msgid "This command also clears the LVM cache and performs a volume group scan."
8970 #: ../src/guestfs-actions.pod:2963
8971 msgid "guestfs_lvm_remove_all"
8975 #: ../src/guestfs-actions.pod:2965
8978 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
8983 #: ../src/guestfs-actions.pod:2967 ../fish/guestfish-actions.pod:2311
8985 "This command removes all LVM logical volumes, volume groups and physical "
8990 #: ../src/guestfs-actions.pod:2975
8991 msgid "guestfs_lvm_set_filter"
8995 #: ../src/guestfs-actions.pod:2977
8998 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
8999 "\t\tchar *const *devices);\n"
9004 #: ../src/guestfs-actions.pod:2980 ../fish/guestfish-actions.pod:2321
9006 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
9007 "block devices in the list C<devices>, and will ignore all other attached "
9012 #: ../src/guestfs-actions.pod:2984 ../fish/guestfish-actions.pod:2325
9014 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
9015 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
9016 "there are two types of duplication possible: either cloned PVs/VGs which "
9017 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
9018 "same name. In normal operation you cannot create this situation, but you "
9019 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
9020 "inside the LVM metadata."
9024 #: ../src/guestfs-actions.pod:2997 ../fish/guestfish-actions.pod:2338
9025 msgid "You can filter whole block devices or individual partitions."
9029 #: ../src/guestfs-actions.pod:2999 ../fish/guestfish-actions.pod:2340
9031 "You cannot use this if any VG is currently in use (eg. contains a mounted "
9032 "filesystem), even if you are not filtering out that VG."
9036 #: ../src/guestfs-actions.pod:3005
9037 msgid "guestfs_lvremove"
9041 #: ../src/guestfs-actions.pod:3007
9044 " int guestfs_lvremove (guestfs_h *g,\n"
9045 "\t\tconst char *device);\n"
9050 #: ../src/guestfs-actions.pod:3010 ../fish/guestfish-actions.pod:2348
9052 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
9053 "LV, such as C</dev/VG/LV>."
9057 #: ../src/guestfs-actions.pod:3013 ../fish/guestfish-actions.pod:2351
9059 "You can also remove all LVs in a volume group by specifying the VG name, "
9064 #: ../src/guestfs-actions.pod:3018
9065 msgid "guestfs_lvrename"
9069 #: ../src/guestfs-actions.pod:3020
9072 " int guestfs_lvrename (guestfs_h *g,\n"
9073 "\t\tconst char *logvol,\n"
9074 "\t\tconst char *newlogvol);\n"
9079 #: ../src/guestfs-actions.pod:3024 ../fish/guestfish-actions.pod:2358
9080 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
9084 #: ../src/guestfs-actions.pod:3028
9085 msgid "guestfs_lvresize"
9089 #: ../src/guestfs-actions.pod:3030
9092 " int guestfs_lvresize (guestfs_h *g,\n"
9093 "\t\tconst char *device,\n"
9094 "\t\tint mbytes);\n"
9099 #: ../src/guestfs-actions.pod:3034 ../fish/guestfish-actions.pod:2364
9101 "This resizes (expands or shrinks) an existing LVM logical volume to "
9102 "C<mbytes>. When reducing, data in the reduced part is lost."
9106 #: ../src/guestfs-actions.pod:3040
9107 msgid "guestfs_lvresize_free"
9111 #: ../src/guestfs-actions.pod:3042
9114 " int guestfs_lvresize_free (guestfs_h *g,\n"
9115 "\t\tconst char *lv,\n"
9116 "\t\tint percent);\n"
9121 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2372
9123 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
9124 "remaining free space in the volume group. Commonly you would call this with "
9125 "pc = 100 which expands the logical volume as much as possible, using all "
9126 "remaining free space in the volume group."
9130 #: ../src/guestfs-actions.pod:3054
9135 #: ../src/guestfs-actions.pod:3056
9138 " char **guestfs_lvs (guestfs_h *g);\n"
9143 #: ../src/guestfs-actions.pod:3058 ../fish/guestfish-actions.pod:2382
9145 "List all the logical volumes detected. This is the equivalent of the "
9146 "L<lvs(8)> command."
9150 #: ../src/guestfs-actions.pod:3061 ../fish/guestfish-actions.pod:2385
9152 "This returns a list of the logical volume device names "
9153 "(eg. C</dev/VolGroup00/LogVol00>)."
9157 #: ../src/guestfs-actions.pod:3064
9158 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
9162 #: ../src/guestfs-actions.pod:3070
9163 msgid "guestfs_lvs_full"
9167 #: ../src/guestfs-actions.pod:3072
9170 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
9175 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2394
9177 "List all the logical volumes detected. This is the equivalent of the "
9178 "L<lvs(8)> command. The \"full\" version includes all fields."
9182 #: ../src/guestfs-actions.pod:3077
9184 "This function returns a C<struct guestfs_lvm_lv_list *> (see "
9185 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
9186 "must call C<guestfs_free_lvm_lv_list> after use>."
9190 #: ../src/guestfs-actions.pod:3082
9191 msgid "guestfs_lvuuid"
9195 #: ../src/guestfs-actions.pod:3084
9198 " char *guestfs_lvuuid (guestfs_h *g,\n"
9199 "\t\tconst char *device);\n"
9204 #: ../src/guestfs-actions.pod:3087 ../fish/guestfish-actions.pod:2401
9205 msgid "This command returns the UUID of the LVM LV C<device>."
9209 #: ../src/guestfs-actions.pod:3092
9210 msgid "guestfs_lxattrlist"
9214 #: ../src/guestfs-actions.pod:3094
9217 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
9218 "\t\tconst char *path,\n"
9219 "\t\tchar *const *names);\n"
9224 #: ../src/guestfs-actions.pod:3098 ../fish/guestfish-actions.pod:2407
9226 "This call allows you to get the extended attributes of multiple files, where "
9227 "all files are in the directory C<path>. C<names> is the list of files from "
9232 #: ../src/guestfs-actions.pod:3102 ../fish/guestfish-actions.pod:2411
9234 "On return you get a flat list of xattr structs which must be interpreted "
9235 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
9236 "C<attrval> in this struct is zero-length to indicate there was an error "
9237 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
9238 "number (the number of following attributes for this file, which could be "
9239 "C<\"0\">). Then after the first xattr struct are the zero or more "
9240 "attributes for the first named file. This repeats for the second and "
9245 #: ../src/guestfs-actions.pod:3112
9247 "This call is intended for programs that want to efficiently list a directory "
9248 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
9249 "a similarly efficient call for getting standard stats. Very long directory "
9250 "listings might cause the protocol message size to be exceeded, causing this "
9251 "call to fail. The caller must split up such requests into smaller groups of "
9256 #: ../src/guestfs-actions.pod:3125
9257 msgid "guestfs_mkdir"
9261 #: ../src/guestfs-actions.pod:3127
9264 " int guestfs_mkdir (guestfs_h *g,\n"
9265 "\t\tconst char *path);\n"
9270 #: ../src/guestfs-actions.pod:3130 ../fish/guestfish-actions.pod:2433
9271 msgid "Create a directory named C<path>."
9275 #: ../src/guestfs-actions.pod:3134
9276 msgid "guestfs_mkdir_mode"
9280 #: ../src/guestfs-actions.pod:3136
9283 " int guestfs_mkdir_mode (guestfs_h *g,\n"
9284 "\t\tconst char *path,\n"
9290 #: ../src/guestfs-actions.pod:3140 ../fish/guestfish-actions.pod:2439
9292 "This command creates a directory, setting the initial permissions of the "
9293 "directory to C<mode>."
9297 #: ../src/guestfs-actions.pod:3143 ../fish/guestfish-actions.pod:2442
9299 "For common Linux filesystems, the actual mode which is set will be C<mode & "
9300 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
9305 #: ../src/guestfs-actions.pod:3147
9306 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
9310 #: ../src/guestfs-actions.pod:3151
9311 msgid "guestfs_mkdir_p"
9315 #: ../src/guestfs-actions.pod:3153
9318 " int guestfs_mkdir_p (guestfs_h *g,\n"
9319 "\t\tconst char *path);\n"
9324 #: ../src/guestfs-actions.pod:3156 ../fish/guestfish-actions.pod:2452
9326 "Create a directory named C<path>, creating any parent directories as "
9327 "necessary. This is like the C<mkdir -p> shell command."
9331 #: ../src/guestfs-actions.pod:3161
9332 msgid "guestfs_mkdtemp"
9336 #: ../src/guestfs-actions.pod:3163
9339 " char *guestfs_mkdtemp (guestfs_h *g,\n"
9340 "\t\tconst char *template);\n"
9345 #: ../src/guestfs-actions.pod:3166 ../fish/guestfish-actions.pod:2459
9347 "This command creates a temporary directory. The C<template> parameter "
9348 "should be a full pathname for the temporary directory name with the final "
9349 "six characters being \"XXXXXX\"."
9353 #: ../src/guestfs-actions.pod:3171 ../fish/guestfish-actions.pod:2464
9355 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
9356 "being suitable for Windows filesystems."
9360 #: ../src/guestfs-actions.pod:3174 ../fish/guestfish-actions.pod:2467
9361 msgid "The name of the temporary directory that was created is returned."
9365 #: ../src/guestfs-actions.pod:3177 ../fish/guestfish-actions.pod:2470
9366 msgid "The temporary directory is created with mode 0700 and is owned by root."
9370 #: ../src/guestfs-actions.pod:3180 ../fish/guestfish-actions.pod:2473
9372 "The caller is responsible for deleting the temporary directory and its "
9373 "contents after use."
9377 #: ../src/guestfs-actions.pod:3183 ../fish/guestfish-actions.pod:2476
9378 msgid "See also: L<mkdtemp(3)>"
9382 #: ../src/guestfs-actions.pod:3188
9383 msgid "guestfs_mke2fs_J"
9387 #: ../src/guestfs-actions.pod:3190
9390 " int guestfs_mke2fs_J (guestfs_h *g,\n"
9391 "\t\tconst char *fstype,\n"
9392 "\t\tint blocksize,\n"
9393 "\t\tconst char *device,\n"
9394 "\t\tconst char *journal);\n"
9399 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2482
9401 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9402 "C<journal>. It is equivalent to the command:"
9406 #: ../src/guestfs-actions.pod:3200 ../fish/guestfish-actions.pod:2486
9409 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
9414 #: ../src/guestfs-actions.pod:3202
9415 msgid "See also C<guestfs_mke2journal>."
9419 #: ../src/guestfs-actions.pod:3206
9420 msgid "guestfs_mke2fs_JL"
9424 #: ../src/guestfs-actions.pod:3208
9427 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
9428 "\t\tconst char *fstype,\n"
9429 "\t\tint blocksize,\n"
9430 "\t\tconst char *device,\n"
9431 "\t\tconst char *label);\n"
9436 #: ../src/guestfs-actions.pod:3214 ../fish/guestfish-actions.pod:2494
9438 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9439 "the journal labeled C<label>."
9443 #: ../src/guestfs-actions.pod:3217
9444 msgid "See also C<guestfs_mke2journal_L>."
9448 #: ../src/guestfs-actions.pod:3221
9449 msgid "guestfs_mke2fs_JU"
9453 #: ../src/guestfs-actions.pod:3223
9456 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
9457 "\t\tconst char *fstype,\n"
9458 "\t\tint blocksize,\n"
9459 "\t\tconst char *device,\n"
9460 "\t\tconst char *uuid);\n"
9465 #: ../src/guestfs-actions.pod:3229 ../fish/guestfish-actions.pod:2503
9467 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
9468 "the journal with UUID C<uuid>."
9472 #: ../src/guestfs-actions.pod:3232
9473 msgid "See also C<guestfs_mke2journal_U>."
9477 #: ../src/guestfs-actions.pod:3236
9478 msgid "guestfs_mke2journal"
9482 #: ../src/guestfs-actions.pod:3238
9485 " int guestfs_mke2journal (guestfs_h *g,\n"
9486 "\t\tint blocksize,\n"
9487 "\t\tconst char *device);\n"
9492 #: ../src/guestfs-actions.pod:3242 ../fish/guestfish-actions.pod:2512
9494 "This creates an ext2 external journal on C<device>. It is equivalent to the "
9499 #: ../src/guestfs-actions.pod:3245 ../fish/guestfish-actions.pod:2515
9502 " mke2fs -O journal_dev -b blocksize device\n"
9507 #: ../src/guestfs-actions.pod:3249
9508 msgid "guestfs_mke2journal_L"
9512 #: ../src/guestfs-actions.pod:3251
9515 " int guestfs_mke2journal_L (guestfs_h *g,\n"
9516 "\t\tint blocksize,\n"
9517 "\t\tconst char *label,\n"
9518 "\t\tconst char *device);\n"
9523 #: ../src/guestfs-actions.pod:3256 ../fish/guestfish-actions.pod:2521
9524 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9528 #: ../src/guestfs-actions.pod:3260
9529 msgid "guestfs_mke2journal_U"
9533 #: ../src/guestfs-actions.pod:3262
9536 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9537 "\t\tint blocksize,\n"
9538 "\t\tconst char *uuid,\n"
9539 "\t\tconst char *device);\n"
9544 #: ../src/guestfs-actions.pod:3267 ../fish/guestfish-actions.pod:2527
9545 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9549 #: ../src/guestfs-actions.pod:3271
9550 msgid "guestfs_mkfifo"
9554 #: ../src/guestfs-actions.pod:3273
9557 " int guestfs_mkfifo (guestfs_h *g,\n"
9559 "\t\tconst char *path);\n"
9564 #: ../src/guestfs-actions.pod:3277
9566 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9567 "is just a convenient wrapper around C<guestfs_mknod>."
9571 #: ../src/guestfs-actions.pod:3285
9572 msgid "guestfs_mkfs"
9576 #: ../src/guestfs-actions.pod:3287
9579 " int guestfs_mkfs (guestfs_h *g,\n"
9580 "\t\tconst char *fstype,\n"
9581 "\t\tconst char *device);\n"
9586 #: ../src/guestfs-actions.pod:3291 ../fish/guestfish-actions.pod:2543
9588 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9589 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9593 #: ../src/guestfs-actions.pod:3297
9594 msgid "guestfs_mkfs_b"
9598 #: ../src/guestfs-actions.pod:3299
9601 " int guestfs_mkfs_b (guestfs_h *g,\n"
9602 "\t\tconst char *fstype,\n"
9603 "\t\tint blocksize,\n"
9604 "\t\tconst char *device);\n"
9609 #: ../src/guestfs-actions.pod:3304
9611 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9612 "block size of the resulting filesystem. Supported block sizes depend on the "
9613 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9617 #: ../src/guestfs-actions.pod:3309 ../fish/guestfish-actions.pod:2556
9619 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9624 #: ../src/guestfs-actions.pod:3314
9625 msgid "guestfs_mkmountpoint"
9629 #: ../src/guestfs-actions.pod:3316
9632 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9633 "\t\tconst char *exemptpath);\n"
9638 #: ../src/guestfs-actions.pod:3319
9640 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9641 "that can be used to create extra mountpoints before mounting the first "
9646 #: ../src/guestfs-actions.pod:3323 ../fish/guestfish-actions.pod:2567
9648 "These calls are I<only> necessary in some very limited circumstances, mainly "
9649 "the case where you want to mount a mix of unrelated and/or read-only "
9650 "filesystems together."
9654 #: ../src/guestfs-actions.pod:3327 ../fish/guestfish-actions.pod:2571
9656 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
9657 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
9658 "inside that. You can unpack this as follows in guestfish:"
9662 #: ../src/guestfs-actions.pod:3332 ../fish/guestfish-actions.pod:2576
9665 " add-ro Fedora-11-i686-Live.iso\n"
9667 " mkmountpoint /cd\n"
9668 " mkmountpoint /sqsh\n"
9669 " mkmountpoint /ext3fs\n"
9670 " mount /dev/sda /cd\n"
9671 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
9672 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
9677 #: ../src/guestfs-actions.pod:3341 ../fish/guestfish-actions.pod:2585
9678 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
9682 #: ../src/guestfs-actions.pod:3343
9684 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
9685 "may get unexpected errors if you try to mix these calls. It is safest to "
9686 "manually unmount filesystems and remove mountpoints after use."
9690 #: ../src/guestfs-actions.pod:3347
9692 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
9693 "first, so for this to work for manual mountpoints, you must ensure that the "
9694 "innermost mountpoints have the longest pathnames, as in the example code "
9699 #: ../src/guestfs-actions.pod:3352 ../fish/guestfish-actions.pod:2596
9700 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
9704 #: ../src/guestfs-actions.pod:3354
9706 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
9707 "means that C<guestfs_umount_all> is called when the handle is closed which "
9708 "can also trigger these issues."
9712 #: ../src/guestfs-actions.pod:3360
9713 msgid "guestfs_mknod"
9717 #: ../src/guestfs-actions.pod:3362
9720 " int guestfs_mknod (guestfs_h *g,\n"
9722 "\t\tint devmajor,\n"
9723 "\t\tint devminor,\n"
9724 "\t\tconst char *path);\n"
9729 #: ../src/guestfs-actions.pod:3368 ../fish/guestfish-actions.pod:2606
9731 "This call creates block or character special devices, or named pipes "
9736 #: ../src/guestfs-actions.pod:3371 ../fish/guestfish-actions.pod:2609
9738 "The C<mode> parameter should be the mode, using the standard constants. "
9739 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
9740 "used when creating block and character special devices."
9744 #: ../src/guestfs-actions.pod:3376
9746 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
9747 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
9748 "regular file). These constants are available in the standard Linux header "
9749 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
9750 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
9751 "the appropriate constant for you."
9755 #: ../src/guestfs-actions.pod:3388
9756 msgid "guestfs_mknod_b"
9760 #: ../src/guestfs-actions.pod:3390
9763 " int guestfs_mknod_b (guestfs_h *g,\n"
9765 "\t\tint devmajor,\n"
9766 "\t\tint devminor,\n"
9767 "\t\tconst char *path);\n"
9772 #: ../src/guestfs-actions.pod:3396
9774 "This call creates a block device node called C<path> with mode C<mode> and "
9775 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9776 "wrapper around C<guestfs_mknod>."
9780 #: ../src/guestfs-actions.pod:3404
9781 msgid "guestfs_mknod_c"
9785 #: ../src/guestfs-actions.pod:3406
9788 " int guestfs_mknod_c (guestfs_h *g,\n"
9790 "\t\tint devmajor,\n"
9791 "\t\tint devminor,\n"
9792 "\t\tconst char *path);\n"
9797 #: ../src/guestfs-actions.pod:3412
9799 "This call creates a char device node called C<path> with mode C<mode> and "
9800 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9801 "wrapper around C<guestfs_mknod>."
9805 #: ../src/guestfs-actions.pod:3420
9806 msgid "guestfs_mkswap"
9810 #: ../src/guestfs-actions.pod:3422
9813 " int guestfs_mkswap (guestfs_h *g,\n"
9814 "\t\tconst char *device);\n"
9819 #: ../src/guestfs-actions.pod:3425 ../fish/guestfish-actions.pod:2648
9820 msgid "Create a swap partition on C<device>."
9824 #: ../src/guestfs-actions.pod:3429
9825 msgid "guestfs_mkswap_L"
9829 #: ../src/guestfs-actions.pod:3431
9832 " int guestfs_mkswap_L (guestfs_h *g,\n"
9833 "\t\tconst char *label,\n"
9834 "\t\tconst char *device);\n"
9839 #: ../src/guestfs-actions.pod:3435 ../fish/guestfish-actions.pod:2654
9840 msgid "Create a swap partition on C<device> with label C<label>."
9844 #: ../src/guestfs-actions.pod:3437 ../fish/guestfish-actions.pod:2656
9846 "Note that you cannot attach a swap label to a block device "
9847 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
9848 "the kernel or swap tools."
9852 #: ../src/guestfs-actions.pod:3443
9853 msgid "guestfs_mkswap_U"
9857 #: ../src/guestfs-actions.pod:3445
9860 " int guestfs_mkswap_U (guestfs_h *g,\n"
9861 "\t\tconst char *uuid,\n"
9862 "\t\tconst char *device);\n"
9867 #: ../src/guestfs-actions.pod:3449 ../fish/guestfish-actions.pod:2664
9868 msgid "Create a swap partition on C<device> with UUID C<uuid>."
9872 #: ../src/guestfs-actions.pod:3453
9873 msgid "guestfs_mkswap_file"
9877 #: ../src/guestfs-actions.pod:3455
9880 " int guestfs_mkswap_file (guestfs_h *g,\n"
9881 "\t\tconst char *path);\n"
9886 #: ../src/guestfs-actions.pod:3458 ../fish/guestfish-actions.pod:2670
9887 msgid "Create a swap file."
9891 #: ../src/guestfs-actions.pod:3460
9893 "This command just writes a swap file signature to an existing file. To "
9894 "create the file itself, use something like C<guestfs_fallocate>."
9898 #: ../src/guestfs-actions.pod:3465
9899 msgid "guestfs_modprobe"
9903 #: ../src/guestfs-actions.pod:3467
9906 " int guestfs_modprobe (guestfs_h *g,\n"
9907 "\t\tconst char *modulename);\n"
9912 #: ../src/guestfs-actions.pod:3470 ../fish/guestfish-actions.pod:2679
9913 msgid "This loads a kernel module in the appliance."
9917 #: ../src/guestfs-actions.pod:3472 ../fish/guestfish-actions.pod:2681
9919 "The kernel module must have been whitelisted when libguestfs was built (see "
9920 "C<appliance/kmod.whitelist.in> in the source)."
9924 #: ../src/guestfs-actions.pod:3477
9925 msgid "guestfs_mount"
9929 #: ../src/guestfs-actions.pod:3479
9932 " int guestfs_mount (guestfs_h *g,\n"
9933 "\t\tconst char *device,\n"
9934 "\t\tconst char *mountpoint);\n"
9939 #: ../src/guestfs-actions.pod:3483 ../fish/guestfish-actions.pod:2688
9941 "Mount a guest disk at a position in the filesystem. Block devices are named "
9942 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
9943 "those block devices contain partitions, they will have the usual names "
9944 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
9948 #: ../src/guestfs-actions.pod:3489 ../fish/guestfish-actions.pod:2694
9950 "The rules are the same as for L<mount(2)>: A filesystem must first be "
9951 "mounted on C</> before others can be mounted. Other filesystems can only be "
9952 "mounted on directories which already exist."
9956 #: ../src/guestfs-actions.pod:3494 ../fish/guestfish-actions.pod:2699
9958 "The mounted filesystem is writable, if we have sufficient permissions on the "
9959 "underlying device."
9963 #: ../src/guestfs-actions.pod:3497
9965 "B<Important note:> When you use this call, the filesystem options C<sync> "
9966 "and C<noatime> are set implicitly. This was originally done because we "
9967 "thought it would improve reliability, but it turns out that I<-o sync> has a "
9968 "very large negative performance impact and negligible effect on "
9969 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
9970 "in any code that needs performance, and instead use C<guestfs_mount_options> "
9971 "(use an empty string for the first parameter if you don't want any options)."
9975 #: ../src/guestfs-actions.pod:3509
9976 msgid "guestfs_mount_loop"
9980 #: ../src/guestfs-actions.pod:3511
9983 " int guestfs_mount_loop (guestfs_h *g,\n"
9984 "\t\tconst char *file,\n"
9985 "\t\tconst char *mountpoint);\n"
9990 #: ../src/guestfs-actions.pod:3515 ../fish/guestfish-actions.pod:2716
9992 "This command lets you mount C<file> (a filesystem image in a file) on a "
9993 "mount point. It is entirely equivalent to the command C<mount -o loop file "
9998 #: ../src/guestfs-actions.pod:3521
9999 msgid "guestfs_mount_options"
10003 #: ../src/guestfs-actions.pod:3523
10006 " int guestfs_mount_options (guestfs_h *g,\n"
10007 "\t\tconst char *options,\n"
10008 "\t\tconst char *device,\n"
10009 "\t\tconst char *mountpoint);\n"
10014 #: ../src/guestfs-actions.pod:3528
10016 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10017 "the mount options as for the L<mount(8)> I<-o> flag."
10021 #: ../src/guestfs-actions.pod:3532 ../fish/guestfish-actions.pod:2728
10023 "If the C<options> parameter is an empty string, then no options are passed "
10024 "(all options default to whatever the filesystem uses)."
10028 #: ../src/guestfs-actions.pod:3538
10029 msgid "guestfs_mount_ro"
10033 #: ../src/guestfs-actions.pod:3540
10036 " int guestfs_mount_ro (guestfs_h *g,\n"
10037 "\t\tconst char *device,\n"
10038 "\t\tconst char *mountpoint);\n"
10043 #: ../src/guestfs-actions.pod:3544
10045 "This is the same as the C<guestfs_mount> command, but it mounts the "
10046 "filesystem with the read-only (I<-o ro>) flag."
10050 #: ../src/guestfs-actions.pod:3549
10051 msgid "guestfs_mount_vfs"
10055 #: ../src/guestfs-actions.pod:3551
10058 " int guestfs_mount_vfs (guestfs_h *g,\n"
10059 "\t\tconst char *options,\n"
10060 "\t\tconst char *vfstype,\n"
10061 "\t\tconst char *device,\n"
10062 "\t\tconst char *mountpoint);\n"
10067 #: ../src/guestfs-actions.pod:3557
10069 "This is the same as the C<guestfs_mount> command, but it allows you to set "
10070 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
10075 #: ../src/guestfs-actions.pod:3563
10076 msgid "guestfs_mountpoints"
10080 #: ../src/guestfs-actions.pod:3565
10083 " char **guestfs_mountpoints (guestfs_h *g);\n"
10088 #: ../src/guestfs-actions.pod:3567
10090 "This call is similar to C<guestfs_mounts>. That call returns a list of "
10091 "devices. This one returns a hash table (map) of device name to directory "
10092 "where the device is mounted."
10096 #: ../src/guestfs-actions.pod:3577
10097 msgid "guestfs_mounts"
10101 #: ../src/guestfs-actions.pod:3579
10104 " char **guestfs_mounts (guestfs_h *g);\n"
10109 #: ../src/guestfs-actions.pod:3581 ../fish/guestfish-actions.pod:2759
10111 "This returns the list of currently mounted filesystems. It returns the list "
10112 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
10116 #: ../src/guestfs-actions.pod:3584 ../fish/guestfish-actions.pod:2762
10117 msgid "Some internal mounts are not shown."
10121 #: ../src/guestfs-actions.pod:3586
10122 msgid "See also: C<guestfs_mountpoints>"
10126 #: ../src/guestfs-actions.pod:3592
10131 #: ../src/guestfs-actions.pod:3594
10134 " int guestfs_mv (guestfs_h *g,\n"
10135 "\t\tconst char *src,\n"
10136 "\t\tconst char *dest);\n"
10141 #: ../src/guestfs-actions.pod:3598 ../fish/guestfish-actions.pod:2770
10143 "This moves a file from C<src> to C<dest> where C<dest> is either a "
10144 "destination filename or destination directory."
10148 #: ../src/guestfs-actions.pod:3603
10149 msgid "guestfs_ntfs_3g_probe"
10153 #: ../src/guestfs-actions.pod:3605
10156 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
10158 "\t\tconst char *device);\n"
10163 #: ../src/guestfs-actions.pod:3609 ../fish/guestfish-actions.pod:2777
10165 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
10166 "C<device> for mountability. (Not all NTFS volumes can be mounted "
10167 "read-write, and some cannot be mounted at all)."
10171 #: ../src/guestfs-actions.pod:3613 ../fish/guestfish-actions.pod:2781
10173 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
10174 "can be mounted read-write. Set it to false if you want to test if the "
10175 "volume can be mounted read-only."
10179 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2785
10181 "The return value is an integer which C<0> if the operation would succeed, or "
10182 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
10186 #: ../src/guestfs-actions.pod:3623
10187 msgid "guestfs_ntfsresize"
10191 #: ../src/guestfs-actions.pod:3625
10194 " int guestfs_ntfsresize (guestfs_h *g,\n"
10195 "\t\tconst char *device);\n"
10200 #: ../src/guestfs-actions.pod:3628 ../fish/guestfish-actions.pod:2793
10202 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
10203 "size of the underlying device. See also L<ntfsresize(8)>."
10207 #: ../src/guestfs-actions.pod:3634
10208 msgid "guestfs_ntfsresize_size"
10212 #: ../src/guestfs-actions.pod:3636
10215 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
10216 "\t\tconst char *device,\n"
10217 "\t\tint64_t size);\n"
10222 #: ../src/guestfs-actions.pod:3640
10224 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
10225 "to specify the new size (in bytes) explicitly."
10229 #: ../src/guestfs-actions.pod:3645
10230 msgid "guestfs_part_add"
10234 #: ../src/guestfs-actions.pod:3647
10237 " int guestfs_part_add (guestfs_h *g,\n"
10238 "\t\tconst char *device,\n"
10239 "\t\tconst char *prlogex,\n"
10240 "\t\tint64_t startsect,\n"
10241 "\t\tint64_t endsect);\n"
10246 #: ../src/guestfs-actions.pod:3653
10248 "This command adds a partition to C<device>. If there is no partition table "
10249 "on the device, call C<guestfs_part_init> first."
10253 #: ../src/guestfs-actions.pod:3656 ../fish/guestfish-actions.pod:2811
10255 "The C<prlogex> parameter is the type of partition. Normally you should pass "
10256 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
10257 "C<logical>) and C<e> (or C<extended>) partition types."
10261 #: ../src/guestfs-actions.pod:3661 ../fish/guestfish-actions.pod:2816
10263 "C<startsect> and C<endsect> are the start and end of the partition in "
10264 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
10265 "from the end of the disk (C<-1> is the last sector)."
10269 #: ../src/guestfs-actions.pod:3665
10271 "Creating a partition which covers the whole disk is not so easy. Use "
10272 "C<guestfs_part_disk> to do that."
10276 #: ../src/guestfs-actions.pod:3670
10277 msgid "guestfs_part_del"
10281 #: ../src/guestfs-actions.pod:3672
10284 " int guestfs_part_del (guestfs_h *g,\n"
10285 "\t\tconst char *device,\n"
10286 "\t\tint partnum);\n"
10291 #: ../src/guestfs-actions.pod:3676 ../fish/guestfish-actions.pod:2827
10292 msgid "This command deletes the partition numbered C<partnum> on C<device>."
10296 #: ../src/guestfs-actions.pod:3678 ../fish/guestfish-actions.pod:2829
10298 "Note that in the case of MBR partitioning, deleting an extended partition "
10299 "also deletes any logical partitions it contains."
10303 #: ../src/guestfs-actions.pod:3684
10304 msgid "guestfs_part_disk"
10308 #: ../src/guestfs-actions.pod:3686
10311 " int guestfs_part_disk (guestfs_h *g,\n"
10312 "\t\tconst char *device,\n"
10313 "\t\tconst char *parttype);\n"
10318 #: ../src/guestfs-actions.pod:3690
10320 "This command is simply a combination of C<guestfs_part_init> followed by "
10321 "C<guestfs_part_add> to create a single primary partition covering the whole "
10326 #: ../src/guestfs-actions.pod:3694
10328 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
10329 "possible values are described in C<guestfs_part_init>."
10333 #: ../src/guestfs-actions.pod:3702
10334 msgid "guestfs_part_get_bootable"
10338 #: ../src/guestfs-actions.pod:3704
10341 " int guestfs_part_get_bootable (guestfs_h *g,\n"
10342 "\t\tconst char *device,\n"
10343 "\t\tint partnum);\n"
10348 #: ../src/guestfs-actions.pod:3708 ../fish/guestfish-actions.pod:2851
10350 "This command returns true if the partition C<partnum> on C<device> has the "
10351 "bootable flag set."
10355 #: ../src/guestfs-actions.pod:3711
10356 msgid "See also C<guestfs_part_set_bootable>."
10360 #: ../src/guestfs-actions.pod:3715
10361 msgid "guestfs_part_get_mbr_id"
10365 #: ../src/guestfs-actions.pod:3717
10368 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
10369 "\t\tconst char *device,\n"
10370 "\t\tint partnum);\n"
10375 #: ../src/guestfs-actions.pod:3721 ../fish/guestfish-actions.pod:2860
10377 "Returns the MBR type byte (also known as the ID byte) from the numbered "
10378 "partition C<partnum>."
10382 #: ../src/guestfs-actions.pod:3724 ../src/guestfs-actions.pod:3886
10384 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
10385 "undefined results for other partition table types (see "
10386 "C<guestfs_part_get_parttype>)."
10390 #: ../src/guestfs-actions.pod:3730
10391 msgid "guestfs_part_get_parttype"
10395 #: ../src/guestfs-actions.pod:3732
10398 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
10399 "\t\tconst char *device);\n"
10404 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2871
10406 "This command examines the partition table on C<device> and returns the "
10407 "partition table type (format) being used."
10411 #: ../src/guestfs-actions.pod:3738
10413 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
10414 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
10415 "possible, although unusual. See C<guestfs_part_init> for a full list."
10419 #: ../src/guestfs-actions.pod:3746
10420 msgid "guestfs_part_init"
10424 #: ../src/guestfs-actions.pod:3748
10427 " int guestfs_part_init (guestfs_h *g,\n"
10428 "\t\tconst char *device,\n"
10429 "\t\tconst char *parttype);\n"
10434 #: ../src/guestfs-actions.pod:3752 ../fish/guestfish-actions.pod:2883
10436 "This creates an empty partition table on C<device> of one of the partition "
10437 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
10438 "(for large disks)."
10442 #: ../src/guestfs-actions.pod:3756
10444 "Initially there are no partitions. Following this, you should call "
10445 "C<guestfs_part_add> for each partition required."
10449 #: ../src/guestfs-actions.pod:3759 ../fish/guestfish-actions.pod:2890
10450 msgid "Possible values for C<parttype> are:"
10454 #: ../src/guestfs-actions.pod:3763 ../fish/guestfish-actions.pod:2894
10455 msgid "B<efi> | B<gpt>"
10459 #: ../src/guestfs-actions.pod:3765 ../fish/guestfish-actions.pod:2896
10460 msgid "Intel EFI / GPT partition table."
10464 #: ../src/guestfs-actions.pod:3767 ../fish/guestfish-actions.pod:2898
10466 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
10467 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
10468 "the C<mbr> format."
10472 #: ../src/guestfs-actions.pod:3771 ../fish/guestfish-actions.pod:2902
10473 msgid "B<mbr> | B<msdos>"
10477 #: ../src/guestfs-actions.pod:3773 ../fish/guestfish-actions.pod:2904
10479 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
10480 "Windows. This partition type will B<only> work for device sizes up to 2 "
10481 "TB. For large disks we recommend using C<gpt>."
10485 #: ../src/guestfs-actions.pod:3780 ../fish/guestfish-actions.pod:2911
10486 msgid "Other partition table types that may work but are not supported include:"
10490 #: ../src/guestfs-actions.pod:3785 ../fish/guestfish-actions.pod:2916
10495 #: ../src/guestfs-actions.pod:3787 ../fish/guestfish-actions.pod:2918
10496 msgid "AIX disk labels."
10500 #: ../src/guestfs-actions.pod:3789 ../fish/guestfish-actions.pod:2920
10501 msgid "B<amiga> | B<rdb>"
10505 #: ../src/guestfs-actions.pod:3791 ../fish/guestfish-actions.pod:2922
10506 msgid "Amiga \"Rigid Disk Block\" format."
10510 #: ../src/guestfs-actions.pod:3793 ../fish/guestfish-actions.pod:2924
10515 #: ../src/guestfs-actions.pod:3795 ../fish/guestfish-actions.pod:2926
10516 msgid "BSD disk labels."
10520 #: ../src/guestfs-actions.pod:3797 ../fish/guestfish-actions.pod:2928
10525 #: ../src/guestfs-actions.pod:3799 ../fish/guestfish-actions.pod:2930
10526 msgid "DASD, used on IBM mainframes."
10530 #: ../src/guestfs-actions.pod:3801 ../fish/guestfish-actions.pod:2932
10535 #: ../src/guestfs-actions.pod:3803 ../fish/guestfish-actions.pod:2934
10536 msgid "MIPS/SGI volumes."
10540 #: ../src/guestfs-actions.pod:3805 ../fish/guestfish-actions.pod:2936
10545 #: ../src/guestfs-actions.pod:3807 ../fish/guestfish-actions.pod:2938
10546 msgid "Old Mac partition format. Modern Macs use C<gpt>."
10550 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2940
10555 #: ../src/guestfs-actions.pod:3811 ../fish/guestfish-actions.pod:2942
10556 msgid "NEC PC-98 format, common in Japan apparently."
10560 #: ../src/guestfs-actions.pod:3813 ../fish/guestfish-actions.pod:2944
10565 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2946
10566 msgid "Sun disk labels."
10570 #: ../src/guestfs-actions.pod:3821
10571 msgid "guestfs_part_list"
10575 #: ../src/guestfs-actions.pod:3823
10578 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10579 "\t\tconst char *device);\n"
10584 #: ../src/guestfs-actions.pod:3826 ../fish/guestfish-actions.pod:2954
10586 "This command parses the partition table on C<device> and returns the list of "
10587 "partitions found."
10591 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2957
10592 msgid "The fields in the returned structure are:"
10596 #: ../src/guestfs-actions.pod:3833 ../fish/guestfish-actions.pod:2961
10597 msgid "B<part_num>"
10601 #: ../src/guestfs-actions.pod:3835 ../fish/guestfish-actions.pod:2963
10602 msgid "Partition number, counting from 1."
10606 #: ../src/guestfs-actions.pod:3837 ../fish/guestfish-actions.pod:2965
10607 msgid "B<part_start>"
10611 #: ../src/guestfs-actions.pod:3839
10613 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10614 "the device's sector size, see C<guestfs_blockdev_getss>."
10618 #: ../src/guestfs-actions.pod:3842 ../fish/guestfish-actions.pod:2970
10619 msgid "B<part_end>"
10623 #: ../src/guestfs-actions.pod:3844 ../fish/guestfish-actions.pod:2972
10624 msgid "End of the partition in bytes."
10628 #: ../src/guestfs-actions.pod:3846 ../fish/guestfish-actions.pod:2974
10629 msgid "B<part_size>"
10633 #: ../src/guestfs-actions.pod:3848 ../fish/guestfish-actions.pod:2976
10634 msgid "Size of the partition in bytes."
10638 #: ../src/guestfs-actions.pod:3852
10640 "This function returns a C<struct guestfs_partition_list *> (see "
10641 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10642 "must call C<guestfs_free_partition_list> after use>."
10646 #: ../src/guestfs-actions.pod:3857
10647 msgid "guestfs_part_set_bootable"
10651 #: ../src/guestfs-actions.pod:3859
10654 " int guestfs_part_set_bootable (guestfs_h *g,\n"
10655 "\t\tconst char *device,\n"
10656 "\t\tint partnum,\n"
10657 "\t\tint bootable);\n"
10662 #: ../src/guestfs-actions.pod:3864 ../fish/guestfish-actions.pod:2984
10664 "This sets the bootable flag on partition numbered C<partnum> on device "
10665 "C<device>. Note that partitions are numbered from 1."
10669 #: ../src/guestfs-actions.pod:3867 ../fish/guestfish-actions.pod:2987
10671 "The bootable flag is used by some operating systems (notably Windows) to "
10672 "determine which partition to boot from. It is by no means universally "
10677 #: ../src/guestfs-actions.pod:3873
10678 msgid "guestfs_part_set_mbr_id"
10682 #: ../src/guestfs-actions.pod:3875
10685 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
10686 "\t\tconst char *device,\n"
10687 "\t\tint partnum,\n"
10688 "\t\tint idbyte);\n"
10693 #: ../src/guestfs-actions.pod:3880 ../fish/guestfish-actions.pod:2995
10695 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
10696 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
10697 "documentation are in fact hexadecimal numbers, but usually documented "
10698 "without any leading \"0x\" which might be confusing."
10702 #: ../src/guestfs-actions.pod:3892
10703 msgid "guestfs_part_set_name"
10707 #: ../src/guestfs-actions.pod:3894
10710 " int guestfs_part_set_name (guestfs_h *g,\n"
10711 "\t\tconst char *device,\n"
10712 "\t\tint partnum,\n"
10713 "\t\tconst char *name);\n"
10718 #: ../src/guestfs-actions.pod:3899 ../fish/guestfish-actions.pod:3009
10720 "This sets the partition name on partition numbered C<partnum> on device "
10721 "C<device>. Note that partitions are numbered from 1."
10725 #: ../src/guestfs-actions.pod:3902 ../fish/guestfish-actions.pod:3012
10727 "The partition name can only be set on certain types of partition table. "
10728 "This works on C<gpt> but not on C<mbr> partitions."
10732 #: ../src/guestfs-actions.pod:3907
10733 msgid "guestfs_part_to_dev"
10737 #: ../src/guestfs-actions.pod:3909
10740 " char *guestfs_part_to_dev (guestfs_h *g,\n"
10741 "\t\tconst char *partition);\n"
10746 #: ../src/guestfs-actions.pod:3912 ../fish/guestfish-actions.pod:3019
10748 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
10749 "partition number, returning the device name (eg. \"/dev/sdb\")."
10753 #: ../src/guestfs-actions.pod:3916
10755 "The named partition must exist, for example as a string returned from "
10756 "C<guestfs_list_partitions>."
10760 #: ../src/guestfs-actions.pod:3922
10761 msgid "guestfs_ping_daemon"
10765 #: ../src/guestfs-actions.pod:3924
10768 " int guestfs_ping_daemon (guestfs_h *g);\n"
10773 #: ../src/guestfs-actions.pod:3926 ../fish/guestfish-actions.pod:3030
10775 "This is a test probe into the guestfs daemon running inside the qemu "
10776 "subprocess. Calling this function checks that the daemon responds to the "
10777 "ping message, without affecting the daemon or attached block device(s) in "
10782 #: ../src/guestfs-actions.pod:3933
10783 msgid "guestfs_pread"
10787 #: ../src/guestfs-actions.pod:3935
10790 " char *guestfs_pread (guestfs_h *g,\n"
10791 "\t\tconst char *path,\n"
10793 "\t\tint64_t offset,\n"
10794 "\t\tsize_t *size_r);\n"
10799 #: ../src/guestfs-actions.pod:3941 ../fish/guestfish-actions.pod:3039
10801 "This command lets you read part of a file. It reads C<count> bytes of the "
10802 "file, starting at C<offset>, from file C<path>."
10806 #: ../src/guestfs-actions.pod:3944 ../src/guestfs-actions.pod:3967 ../fish/guestfish-actions.pod:3042 ../fish/guestfish-actions.pod:3057
10808 "This may read fewer bytes than requested. For further details see the "
10809 "L<pread(2)> system call."
10813 #: ../src/guestfs-actions.pod:3947
10814 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
10818 #: ../src/guestfs-actions.pod:3956
10819 msgid "guestfs_pread_device"
10823 #: ../src/guestfs-actions.pod:3958
10826 " char *guestfs_pread_device (guestfs_h *g,\n"
10827 "\t\tconst char *device,\n"
10829 "\t\tint64_t offset,\n"
10830 "\t\tsize_t *size_r);\n"
10835 #: ../src/guestfs-actions.pod:3964 ../fish/guestfish-actions.pod:3054
10837 "This command lets you read part of a file. It reads C<count> bytes of "
10838 "C<device>, starting at C<offset>."
10842 #: ../src/guestfs-actions.pod:3970
10843 msgid "See also C<guestfs_pread>."
10847 #: ../src/guestfs-actions.pod:3979
10848 msgid "guestfs_pvcreate"
10852 #: ../src/guestfs-actions.pod:3981
10855 " int guestfs_pvcreate (guestfs_h *g,\n"
10856 "\t\tconst char *device);\n"
10861 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:3069
10863 "This creates an LVM physical volume on the named C<device>, where C<device> "
10864 "should usually be a partition name such as C</dev/sda1>."
10868 #: ../src/guestfs-actions.pod:3990
10869 msgid "guestfs_pvremove"
10873 #: ../src/guestfs-actions.pod:3992
10876 " int guestfs_pvremove (guestfs_h *g,\n"
10877 "\t\tconst char *device);\n"
10882 #: ../src/guestfs-actions.pod:3995 ../fish/guestfish-actions.pod:3077
10884 "This wipes a physical volume C<device> so that LVM will no longer recognise "
10889 #: ../src/guestfs-actions.pod:3998 ../fish/guestfish-actions.pod:3080
10891 "The implementation uses the C<pvremove> command which refuses to wipe "
10892 "physical volumes that contain any volume groups, so you have to remove those "
10897 #: ../src/guestfs-actions.pod:4004
10898 msgid "guestfs_pvresize"
10902 #: ../src/guestfs-actions.pod:4006
10905 " int guestfs_pvresize (guestfs_h *g,\n"
10906 "\t\tconst char *device);\n"
10911 #: ../src/guestfs-actions.pod:4009 ../fish/guestfish-actions.pod:3088
10913 "This resizes (expands or shrinks) an existing LVM physical volume to match "
10914 "the new size of the underlying device."
10918 #: ../src/guestfs-actions.pod:4014
10919 msgid "guestfs_pvresize_size"
10923 #: ../src/guestfs-actions.pod:4016
10926 " int guestfs_pvresize_size (guestfs_h *g,\n"
10927 "\t\tconst char *device,\n"
10928 "\t\tint64_t size);\n"
10933 #: ../src/guestfs-actions.pod:4020
10935 "This command is the same as C<guestfs_pvresize> except that it allows you to "
10936 "specify the new size (in bytes) explicitly."
10940 #: ../src/guestfs-actions.pod:4025
10941 msgid "guestfs_pvs"
10945 #: ../src/guestfs-actions.pod:4027
10948 " char **guestfs_pvs (guestfs_h *g);\n"
10953 #: ../src/guestfs-actions.pod:4029 ../fish/guestfish-actions.pod:3102
10955 "List all the physical volumes detected. This is the equivalent of the "
10956 "L<pvs(8)> command."
10960 #: ../src/guestfs-actions.pod:4032 ../fish/guestfish-actions.pod:3105
10962 "This returns a list of just the device names that contain PVs "
10963 "(eg. C</dev/sda2>)."
10967 #: ../src/guestfs-actions.pod:4035
10968 msgid "See also C<guestfs_pvs_full>."
10972 #: ../src/guestfs-actions.pod:4041
10973 msgid "guestfs_pvs_full"
10977 #: ../src/guestfs-actions.pod:4043
10980 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
10985 #: ../src/guestfs-actions.pod:4045 ../fish/guestfish-actions.pod:3114
10987 "List all the physical volumes detected. This is the equivalent of the "
10988 "L<pvs(8)> command. The \"full\" version includes all fields."
10992 #: ../src/guestfs-actions.pod:4048
10994 "This function returns a C<struct guestfs_lvm_pv_list *> (see "
10995 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10996 "must call C<guestfs_free_lvm_pv_list> after use>."
11000 #: ../src/guestfs-actions.pod:4053
11001 msgid "guestfs_pvuuid"
11005 #: ../src/guestfs-actions.pod:4055
11008 " char *guestfs_pvuuid (guestfs_h *g,\n"
11009 "\t\tconst char *device);\n"
11014 #: ../src/guestfs-actions.pod:4058 ../fish/guestfish-actions.pod:3121
11015 msgid "This command returns the UUID of the LVM PV C<device>."
11019 #: ../src/guestfs-actions.pod:4063
11020 msgid "guestfs_pwrite"
11024 #: ../src/guestfs-actions.pod:4065
11027 " int guestfs_pwrite (guestfs_h *g,\n"
11028 "\t\tconst char *path,\n"
11029 "\t\tconst char *content,\n"
11030 "\t\tsize_t content_size,\n"
11031 "\t\tint64_t offset);\n"
11036 #: ../src/guestfs-actions.pod:4071 ../fish/guestfish-actions.pod:3127
11038 "This command writes to part of a file. It writes the data buffer C<content> "
11039 "to the file C<path> starting at offset C<offset>."
11043 #: ../src/guestfs-actions.pod:4074 ../fish/guestfish-actions.pod:3130
11045 "This command implements the L<pwrite(2)> system call, and like that system "
11046 "call it may not write the full data requested. The return value is the "
11047 "number of bytes that were actually written to the file. This could even be "
11048 "0, although short writes are unlikely for regular files in ordinary "
11053 #: ../src/guestfs-actions.pod:4080
11054 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
11058 #: ../src/guestfs-actions.pod:4087
11059 msgid "guestfs_pwrite_device"
11063 #: ../src/guestfs-actions.pod:4089
11066 " int guestfs_pwrite_device (guestfs_h *g,\n"
11067 "\t\tconst char *device,\n"
11068 "\t\tconst char *content,\n"
11069 "\t\tsize_t content_size,\n"
11070 "\t\tint64_t offset);\n"
11075 #: ../src/guestfs-actions.pod:4095 ../fish/guestfish-actions.pod:3145
11077 "This command writes to part of a device. It writes the data buffer "
11078 "C<content> to C<device> starting at offset C<offset>."
11082 #: ../src/guestfs-actions.pod:4098 ../fish/guestfish-actions.pod:3148
11084 "This command implements the L<pwrite(2)> system call, and like that system "
11085 "call it may not write the full data requested (although short writes to disk "
11086 "devices and partitions are probably impossible with standard Linux kernels)."
11090 #: ../src/guestfs-actions.pod:4103
11091 msgid "See also C<guestfs_pwrite>."
11095 #: ../src/guestfs-actions.pod:4110
11096 msgid "guestfs_read_file"
11100 #: ../src/guestfs-actions.pod:4112
11103 " char *guestfs_read_file (guestfs_h *g,\n"
11104 "\t\tconst char *path,\n"
11105 "\t\tsize_t *size_r);\n"
11110 #: ../src/guestfs-actions.pod:4116 ../fish/guestfish-actions.pod:3162
11111 msgid "This calls returns the contents of the file C<path> as a buffer."
11115 #: ../src/guestfs-actions.pod:4119
11117 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
11118 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
11119 "function is limited in the total size of file that can be handled."
11123 #: ../src/guestfs-actions.pod:4131
11124 msgid "guestfs_read_lines"
11128 #: ../src/guestfs-actions.pod:4133
11131 " char **guestfs_read_lines (guestfs_h *g,\n"
11132 "\t\tconst char *path);\n"
11137 #: ../src/guestfs-actions.pod:4138 ../fish/guestfish-actions.pod:3179
11139 "The file contents are returned as a list of lines. Trailing C<LF> and "
11140 "C<CRLF> character sequences are I<not> returned."
11144 #: ../src/guestfs-actions.pod:4141
11146 "Note that this function cannot correctly handle binary files (specifically, "
11147 "files containing C<\\0> character which is treated as end of line). For "
11148 "those you need to use the C<guestfs_read_file> function which has a more "
11149 "complex interface."
11153 #: ../src/guestfs-actions.pod:4150
11154 msgid "guestfs_readdir"
11158 #: ../src/guestfs-actions.pod:4152
11161 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
11162 "\t\tconst char *dir);\n"
11167 #: ../src/guestfs-actions.pod:4155 ../fish/guestfish-actions.pod:3191
11168 msgid "This returns the list of directory entries in directory C<dir>."
11172 #: ../src/guestfs-actions.pod:4157 ../fish/guestfish-actions.pod:3193
11174 "All entries in the directory are returned, including C<.> and C<..>. The "
11175 "entries are I<not> sorted, but returned in the same order as the underlying "
11180 #: ../src/guestfs-actions.pod:4161 ../fish/guestfish-actions.pod:3197
11182 "Also this call returns basic file type information about each file. The "
11183 "C<ftyp> field will contain one of the following characters:"
11187 #: ../src/guestfs-actions.pod:4166 ../fish/guestfish-actions.pod:3202
11192 #: ../src/guestfs-actions.pod:4168 ../fish/guestfish-actions.pod:3204
11193 msgid "Block special"
11197 #: ../src/guestfs-actions.pod:4170 ../fish/guestfish-actions.pod:3206
11202 #: ../src/guestfs-actions.pod:4172 ../fish/guestfish-actions.pod:3208
11203 msgid "Char special"
11207 #: ../src/guestfs-actions.pod:4174 ../fish/guestfish-actions.pod:3210
11212 #: ../src/guestfs-actions.pod:4176 ../fish/guestfish-actions.pod:3212
11217 #: ../src/guestfs-actions.pod:4178 ../fish/guestfish-actions.pod:3214
11222 #: ../src/guestfs-actions.pod:4180 ../fish/guestfish-actions.pod:3216
11223 msgid "FIFO (named pipe)"
11227 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:3218
11232 #: ../src/guestfs-actions.pod:4184 ../fish/guestfish-actions.pod:3220
11233 msgid "Symbolic link"
11237 #: ../src/guestfs-actions.pod:4186 ../fish/guestfish-actions.pod:3222
11242 #: ../src/guestfs-actions.pod:4188 ../fish/guestfish-actions.pod:3224
11243 msgid "Regular file"
11247 #: ../src/guestfs-actions.pod:4190 ../fish/guestfish-actions.pod:3226
11252 #: ../src/guestfs-actions.pod:4192 ../fish/guestfish-actions.pod:3228
11257 #: ../src/guestfs-actions.pod:4194 ../fish/guestfish-actions.pod:3230
11262 #: ../src/guestfs-actions.pod:4196 ../fish/guestfish-actions.pod:3232
11263 msgid "Unknown file type"
11267 #: ../src/guestfs-actions.pod:4198 ../fish/guestfish-actions.pod:3234
11272 #: ../src/guestfs-actions.pod:4200 ../fish/guestfish-actions.pod:3236
11273 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
11277 #: ../src/guestfs-actions.pod:4205
11279 "This function is primarily intended for use by programs. To get a simple "
11280 "list of names, use C<guestfs_ls>. To get a printable directory for human "
11281 "consumption, use C<guestfs_ll>."
11285 #: ../src/guestfs-actions.pod:4209
11287 "This function returns a C<struct guestfs_dirent_list *> (see "
11288 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
11289 "must call C<guestfs_free_dirent_list> after use>."
11293 #: ../src/guestfs-actions.pod:4214
11294 msgid "guestfs_readlink"
11298 #: ../src/guestfs-actions.pod:4216
11301 " char *guestfs_readlink (guestfs_h *g,\n"
11302 "\t\tconst char *path);\n"
11307 #: ../src/guestfs-actions.pod:4219 ../fish/guestfish-actions.pod:3249
11308 msgid "This command reads the target of a symbolic link."
11312 #: ../src/guestfs-actions.pod:4224
11313 msgid "guestfs_readlinklist"
11317 #: ../src/guestfs-actions.pod:4226
11320 " char **guestfs_readlinklist (guestfs_h *g,\n"
11321 "\t\tconst char *path,\n"
11322 "\t\tchar *const *names);\n"
11327 #: ../src/guestfs-actions.pod:4230 ../fish/guestfish-actions.pod:3255
11329 "This call allows you to do a C<readlink> operation on multiple files, where "
11330 "all files are in the directory C<path>. C<names> is the list of files from "
11335 #: ../src/guestfs-actions.pod:4234 ../fish/guestfish-actions.pod:3259
11337 "On return you get a list of strings, with a one-to-one correspondence to the "
11338 "C<names> list. Each string is the value of the symbolic link."
11342 #: ../src/guestfs-actions.pod:4238 ../fish/guestfish-actions.pod:3263
11344 "If the C<readlink(2)> operation fails on any name, then the corresponding "
11345 "result string is the empty string C<\"\">. However the whole operation is "
11346 "completed even if there were C<readlink(2)> errors, and so you can call this "
11347 "function with names where you don't know if they are symbolic links already "
11348 "(albeit slightly less efficient)."
11352 #: ../src/guestfs-actions.pod:4245 ../fish/guestfish-actions.pod:3270
11354 "This call is intended for programs that want to efficiently list a directory "
11355 "contents without making many round-trips. Very long directory listings "
11356 "might cause the protocol message size to be exceeded, causing this call to "
11357 "fail. The caller must split up such requests into smaller groups of names."
11361 #: ../src/guestfs-actions.pod:4256
11362 msgid "guestfs_realpath"
11366 #: ../src/guestfs-actions.pod:4258
11369 " char *guestfs_realpath (guestfs_h *g,\n"
11370 "\t\tconst char *path);\n"
11375 #: ../src/guestfs-actions.pod:4261 ../fish/guestfish-actions.pod:3281
11377 "Return the canonicalized absolute pathname of C<path>. The returned path "
11378 "has no C<.>, C<..> or symbolic link path elements."
11382 #: ../src/guestfs-actions.pod:4267
11383 msgid "guestfs_removexattr"
11387 #: ../src/guestfs-actions.pod:4269
11390 " int guestfs_removexattr (guestfs_h *g,\n"
11391 "\t\tconst char *xattr,\n"
11392 "\t\tconst char *path);\n"
11397 #: ../src/guestfs-actions.pod:4273 ../fish/guestfish-actions.pod:3288
11398 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
11402 #: ../src/guestfs-actions.pod:4276
11403 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
11407 #: ../src/guestfs-actions.pod:4280
11408 msgid "guestfs_resize2fs"
11412 #: ../src/guestfs-actions.pod:4282
11415 " int guestfs_resize2fs (guestfs_h *g,\n"
11416 "\t\tconst char *device);\n"
11421 #: ../src/guestfs-actions.pod:4285 ../fish/guestfish-actions.pod:3297
11423 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
11424 "underlying device."
11428 #: ../src/guestfs-actions.pod:4288
11430 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
11431 "C<device> before calling this command. For unknown reasons C<resize2fs> "
11432 "sometimes gives an error about this and sometimes not. In any case, it is "
11433 "always safe to call C<guestfs_e2fsck_f> before calling this function."
11437 #: ../src/guestfs-actions.pod:4296
11438 msgid "guestfs_resize2fs_size"
11442 #: ../src/guestfs-actions.pod:4298
11445 " int guestfs_resize2fs_size (guestfs_h *g,\n"
11446 "\t\tconst char *device,\n"
11447 "\t\tint64_t size);\n"
11452 #: ../src/guestfs-actions.pod:4302
11454 "This command is the same as C<guestfs_resize2fs> except that it allows you "
11455 "to specify the new size (in bytes) explicitly."
11459 #: ../src/guestfs-actions.pod:4307
11464 #: ../src/guestfs-actions.pod:4309
11467 " int guestfs_rm (guestfs_h *g,\n"
11468 "\t\tconst char *path);\n"
11473 #: ../src/guestfs-actions.pod:4312 ../fish/guestfish-actions.pod:3317
11474 msgid "Remove the single file C<path>."
11478 #: ../src/guestfs-actions.pod:4316
11479 msgid "guestfs_rm_rf"
11483 #: ../src/guestfs-actions.pod:4318
11486 " int guestfs_rm_rf (guestfs_h *g,\n"
11487 "\t\tconst char *path);\n"
11492 #: ../src/guestfs-actions.pod:4321 ../fish/guestfish-actions.pod:3323
11494 "Remove the file or directory C<path>, recursively removing the contents if "
11495 "its a directory. This is like the C<rm -rf> shell command."
11499 #: ../src/guestfs-actions.pod:4327
11500 msgid "guestfs_rmdir"
11504 #: ../src/guestfs-actions.pod:4329
11507 " int guestfs_rmdir (guestfs_h *g,\n"
11508 "\t\tconst char *path);\n"
11513 #: ../src/guestfs-actions.pod:4332 ../fish/guestfish-actions.pod:3331
11514 msgid "Remove the single directory C<path>."
11518 #: ../src/guestfs-actions.pod:4336
11519 msgid "guestfs_rmmountpoint"
11523 #: ../src/guestfs-actions.pod:4338
11526 " int guestfs_rmmountpoint (guestfs_h *g,\n"
11527 "\t\tconst char *exemptpath);\n"
11532 #: ../src/guestfs-actions.pod:4341
11534 "This calls removes a mountpoint that was previously created with "
11535 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
11539 #: ../src/guestfs-actions.pod:4347
11540 msgid "guestfs_scrub_device"
11544 #: ../src/guestfs-actions.pod:4349
11547 " int guestfs_scrub_device (guestfs_h *g,\n"
11548 "\t\tconst char *device);\n"
11553 #: ../src/guestfs-actions.pod:4352 ../fish/guestfish-actions.pod:3345
11555 "This command writes patterns over C<device> to make data retrieval more "
11560 #: ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4373 ../src/guestfs-actions.pod:4389 ../fish/guestfish-actions.pod:3348 ../fish/guestfish-actions.pod:3363 ../fish/guestfish-actions.pod:3376
11562 "It is an interface to the L<scrub(1)> program. See that manual page for "
11567 #: ../src/guestfs-actions.pod:4363
11568 msgid "guestfs_scrub_file"
11572 #: ../src/guestfs-actions.pod:4365
11575 " int guestfs_scrub_file (guestfs_h *g,\n"
11576 "\t\tconst char *file);\n"
11581 #: ../src/guestfs-actions.pod:4368 ../fish/guestfish-actions.pod:3358
11583 "This command writes patterns over a file to make data retrieval more "
11588 #: ../src/guestfs-actions.pod:4371 ../fish/guestfish-actions.pod:3361
11589 msgid "The file is I<removed> after scrubbing."
11593 #: ../src/guestfs-actions.pod:4378
11594 msgid "guestfs_scrub_freespace"
11598 #: ../src/guestfs-actions.pod:4380
11601 " int guestfs_scrub_freespace (guestfs_h *g,\n"
11602 "\t\tconst char *dir);\n"
11607 #: ../src/guestfs-actions.pod:4383
11609 "This command creates the directory C<dir> and then fills it with files until "
11610 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
11611 "and deletes them. The intention is to scrub any free space on the partition "
11612 "containing C<dir>."
11616 #: ../src/guestfs-actions.pod:4394
11617 msgid "guestfs_set_append"
11621 #: ../src/guestfs-actions.pod:4396
11624 " int guestfs_set_append (guestfs_h *g,\n"
11625 "\t\tconst char *append);\n"
11630 #: ../src/guestfs-actions.pod:4399 ../fish/guestfish-actions.pod:3385
11632 "This function is used to add additional options to the guest kernel command "
11637 #: ../src/guestfs-actions.pod:4402 ../fish/guestfish-actions.pod:3388
11639 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
11640 "environment variable."
11644 #: ../src/guestfs-actions.pod:4405 ../fish/guestfish-actions.pod:3391
11646 "Setting C<append> to C<NULL> means I<no> additional options are passed "
11647 "(libguestfs always adds a few of its own)."
11651 #: ../src/guestfs-actions.pod:4410
11652 msgid "guestfs_set_autosync"
11656 #: ../src/guestfs-actions.pod:4412
11659 " int guestfs_set_autosync (guestfs_h *g,\n"
11660 "\t\tint autosync);\n"
11665 #: ../src/guestfs-actions.pod:4415
11667 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
11668 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
11669 "the handle is closed (also if the program exits without closing handles)."
11673 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:3405
11675 "This is enabled by default (since libguestfs 1.5.24, previously it was "
11676 "disabled by default)."
11680 #: ../src/guestfs-actions.pod:4425
11681 msgid "guestfs_set_direct"
11685 #: ../src/guestfs-actions.pod:4427
11688 " int guestfs_set_direct (guestfs_h *g,\n"
11689 "\t\tint direct);\n"
11694 #: ../src/guestfs-actions.pod:4430 ../fish/guestfish-actions.pod:3414
11696 "If the direct appliance mode flag is enabled, then stdin and stdout are "
11697 "passed directly through to the appliance once it is launched."
11701 #: ../src/guestfs-actions.pod:4434
11703 "One consequence of this is that log messages aren't caught by the library "
11704 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
11709 #: ../src/guestfs-actions.pod:4438 ../fish/guestfish-actions.pod:3422
11710 msgid "You probably don't want to use this unless you know what you are doing."
11714 #: ../src/guestfs-actions.pod:4441 ../fish/guestfish-actions.pod:3425
11715 msgid "The default is disabled."
11719 #: ../src/guestfs-actions.pod:4445
11720 msgid "guestfs_set_e2label"
11724 #: ../src/guestfs-actions.pod:4447
11727 " int guestfs_set_e2label (guestfs_h *g,\n"
11728 "\t\tconst char *device,\n"
11729 "\t\tconst char *label);\n"
11734 #: ../src/guestfs-actions.pod:4451 ../fish/guestfish-actions.pod:3431
11736 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
11737 "C<label>. Filesystem labels are limited to 16 characters."
11741 #: ../src/guestfs-actions.pod:4455
11743 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
11744 "the existing label on a filesystem."
11748 #: ../src/guestfs-actions.pod:4460
11749 msgid "guestfs_set_e2uuid"
11753 #: ../src/guestfs-actions.pod:4462
11756 " int guestfs_set_e2uuid (guestfs_h *g,\n"
11757 "\t\tconst char *device,\n"
11758 "\t\tconst char *uuid);\n"
11763 #: ../src/guestfs-actions.pod:4466 ../fish/guestfish-actions.pod:3442
11765 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
11766 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
11767 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
11771 #: ../src/guestfs-actions.pod:4471
11773 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
11774 "the existing UUID of a filesystem."
11778 #: ../src/guestfs-actions.pod:4476
11779 msgid "guestfs_set_memsize"
11783 #: ../src/guestfs-actions.pod:4478
11786 " int guestfs_set_memsize (guestfs_h *g,\n"
11787 "\t\tint memsize);\n"
11792 #: ../src/guestfs-actions.pod:4481
11794 "This sets the memory size in megabytes allocated to the qemu subprocess. "
11795 "This only has any effect if called before C<guestfs_launch>."
11799 #: ../src/guestfs-actions.pod:4485 ../fish/guestfish-actions.pod:3460
11801 "You can also change this by setting the environment variable "
11802 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
11806 #: ../src/guestfs-actions.pod:4494
11807 msgid "guestfs_set_network"
11811 #: ../src/guestfs-actions.pod:4496
11814 " int guestfs_set_network (guestfs_h *g,\n"
11815 "\t\tint network);\n"
11820 #: ../src/guestfs-actions.pod:4499 ../fish/guestfish-actions.pod:3473
11822 "If C<network> is true, then the network is enabled in the libguestfs "
11823 "appliance. The default is false."
11827 #: ../src/guestfs-actions.pod:4502 ../fish/guestfish-actions.pod:3476
11829 "This affects whether commands are able to access the network (see "
11830 "L<guestfs(3)/RUNNING COMMANDS>)."
11834 #: ../src/guestfs-actions.pod:4505
11836 "You must call this before calling C<guestfs_launch>, otherwise it has no "
11841 #: ../src/guestfs-actions.pod:4510
11842 msgid "guestfs_set_path"
11846 #: ../src/guestfs-actions.pod:4512
11849 " int guestfs_set_path (guestfs_h *g,\n"
11850 "\t\tconst char *searchpath);\n"
11855 #: ../src/guestfs-actions.pod:4515 ../fish/guestfish-actions.pod:3488
11856 msgid "Set the path that libguestfs searches for kernel and initrd.img."
11860 #: ../src/guestfs-actions.pod:4517 ../fish/guestfish-actions.pod:3490
11862 "The default is C<$libdir/guestfs> unless overridden by setting "
11863 "C<LIBGUESTFS_PATH> environment variable."
11867 #: ../src/guestfs-actions.pod:4520 ../fish/guestfish-actions.pod:3493
11868 msgid "Setting C<path> to C<NULL> restores the default path."
11872 #: ../src/guestfs-actions.pod:4524
11873 msgid "guestfs_set_qemu"
11877 #: ../src/guestfs-actions.pod:4526
11880 " int guestfs_set_qemu (guestfs_h *g,\n"
11881 "\t\tconst char *qemu);\n"
11886 #: ../src/guestfs-actions.pod:4529 ../fish/guestfish-actions.pod:3501
11887 msgid "Set the qemu binary that we will use."
11891 #: ../src/guestfs-actions.pod:4531 ../fish/guestfish-actions.pod:3503
11892 msgid "The default is chosen when the library was compiled by the configure script."
11896 #: ../src/guestfs-actions.pod:4534 ../fish/guestfish-actions.pod:3506
11898 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
11903 #: ../src/guestfs-actions.pod:4537 ../fish/guestfish-actions.pod:3509
11904 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
11908 #: ../src/guestfs-actions.pod:4539 ../fish/guestfish-actions.pod:3511
11910 "Note that you should call this function as early as possible after creating "
11911 "the handle. This is because some pre-launch operations depend on testing "
11912 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
11913 "don't retest features, and so you might see inconsistent results. Using the "
11914 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
11915 "the qemu binary at the same time as the handle is created."
11919 #: ../src/guestfs-actions.pod:4549
11920 msgid "guestfs_set_recovery_proc"
11924 #: ../src/guestfs-actions.pod:4551
11927 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
11928 "\t\tint recoveryproc);\n"
11933 #: ../src/guestfs-actions.pod:4554
11935 "If this is called with the parameter C<false> then C<guestfs_launch> does "
11936 "not create a recovery process. The purpose of the recovery process is to "
11937 "stop runaway qemu processes in the case where the main program aborts "
11942 #: ../src/guestfs-actions.pod:4559
11944 "This only has any effect if called before C<guestfs_launch>, and the default "
11949 #: ../src/guestfs-actions.pod:4562 ../fish/guestfish-actions.pod:3533
11951 "About the only time when you would want to disable this is if the main "
11952 "process will fork itself into the background (\"daemonize\" itself). In "
11953 "this case the recovery process thinks that the main program has disappeared "
11954 "and so kills qemu, which is not very helpful."
11958 #: ../src/guestfs-actions.pod:4570
11959 msgid "guestfs_set_selinux"
11963 #: ../src/guestfs-actions.pod:4572
11966 " int guestfs_set_selinux (guestfs_h *g,\n"
11967 "\t\tint selinux);\n"
11972 #: ../src/guestfs-actions.pod:4575 ../fish/guestfish-actions.pod:3545
11974 "This sets the selinux flag that is passed to the appliance at boot time. "
11975 "The default is C<selinux=0> (disabled)."
11979 #: ../src/guestfs-actions.pod:4578 ../fish/guestfish-actions.pod:3548
11981 "Note that if SELinux is enabled, it is always in Permissive mode "
11982 "(C<enforcing=0>)."
11986 #: ../src/guestfs-actions.pod:4586
11987 msgid "guestfs_set_trace"
11991 #: ../src/guestfs-actions.pod:4588
11994 " int guestfs_set_trace (guestfs_h *g,\n"
11995 "\t\tint trace);\n"
12000 #: ../src/guestfs-actions.pod:4591 ../fish/guestfish-actions.pod:3560
12002 "If the command trace flag is set to 1, then commands are printed on stderr "
12003 "before they are executed in a format which is very similar to the one used "
12004 "by guestfish. In other words, you can run a program with this enabled, and "
12005 "you will get out a script which you can feed to guestfish to perform the "
12006 "same set of actions."
12010 #: ../src/guestfs-actions.pod:4598 ../fish/guestfish-actions.pod:3567
12012 "If you want to trace C API calls into libguestfs (and other libraries) then "
12013 "possibly a better way is to use the external ltrace(1) command."
12017 #: ../src/guestfs-actions.pod:4602 ../fish/guestfish-actions.pod:3571
12019 "Command traces are disabled unless the environment variable "
12020 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
12024 #: ../src/guestfs-actions.pod:4607
12025 msgid "guestfs_set_verbose"
12029 #: ../src/guestfs-actions.pod:4609
12032 " int guestfs_set_verbose (guestfs_h *g,\n"
12033 "\t\tint verbose);\n"
12038 #: ../src/guestfs-actions.pod:4612 ../fish/guestfish-actions.pod:3580
12039 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
12043 #: ../src/guestfs-actions.pod:4614 ../fish/guestfish-actions.pod:3582
12045 "Verbose messages are disabled unless the environment variable "
12046 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
12050 #: ../src/guestfs-actions.pod:4619
12051 msgid "guestfs_setcon"
12055 #: ../src/guestfs-actions.pod:4621
12058 " int guestfs_setcon (guestfs_h *g,\n"
12059 "\t\tconst char *context);\n"
12064 #: ../src/guestfs-actions.pod:4624 ../fish/guestfish-actions.pod:3589
12066 "This sets the SELinux security context of the daemon to the string "
12071 #: ../src/guestfs-actions.pod:4627 ../fish/guestfish-actions.pod:3592
12072 msgid "See the documentation about SELINUX in L<guestfs(3)>."
12076 #: ../src/guestfs-actions.pod:4631
12077 msgid "guestfs_setxattr"
12081 #: ../src/guestfs-actions.pod:4633
12084 " int guestfs_setxattr (guestfs_h *g,\n"
12085 "\t\tconst char *xattr,\n"
12086 "\t\tconst char *val,\n"
12087 "\t\tint vallen,\n"
12088 "\t\tconst char *path);\n"
12093 #: ../src/guestfs-actions.pod:4639 ../fish/guestfish-actions.pod:3598
12095 "This call sets the extended attribute named C<xattr> of the file C<path> to "
12096 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
12100 #: ../src/guestfs-actions.pod:4643
12101 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
12105 #: ../src/guestfs-actions.pod:4647
12106 msgid "guestfs_sfdisk"
12110 #: ../src/guestfs-actions.pod:4649
12113 " int guestfs_sfdisk (guestfs_h *g,\n"
12114 "\t\tconst char *device,\n"
12117 "\t\tint sectors,\n"
12118 "\t\tchar *const *lines);\n"
12123 #: ../src/guestfs-actions.pod:4656 ../fish/guestfish-actions.pod:3608
12125 "This is a direct interface to the L<sfdisk(8)> program for creating "
12126 "partitions on block devices."
12130 #: ../src/guestfs-actions.pod:4659 ../fish/guestfish-actions.pod:3611
12131 msgid "C<device> should be a block device, for example C</dev/sda>."
12135 #: ../src/guestfs-actions.pod:4661 ../fish/guestfish-actions.pod:3613
12137 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
12138 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
12139 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
12140 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
12141 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
12142 "the kernel) cannot work out the right geometry and you will need to tell it."
12146 #: ../src/guestfs-actions.pod:4669 ../fish/guestfish-actions.pod:3621
12148 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
12149 "refer to the L<sfdisk(8)> manpage."
12153 #: ../src/guestfs-actions.pod:4672 ../fish/guestfish-actions.pod:3624
12155 "To create a single partition occupying the whole disk, you would pass "
12156 "C<lines> as a single element list, when the single element being the string "
12161 #: ../src/guestfs-actions.pod:4676
12162 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
12166 #: ../src/guestfs-actions.pod:4684
12167 msgid "guestfs_sfdiskM"
12171 #: ../src/guestfs-actions.pod:4686
12174 " int guestfs_sfdiskM (guestfs_h *g,\n"
12175 "\t\tconst char *device,\n"
12176 "\t\tchar *const *lines);\n"
12181 #: ../src/guestfs-actions.pod:4690
12183 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
12184 "partition sizes are specified in megabytes only (rounded to the nearest "
12185 "cylinder) and you don't need to specify the cyls, heads and sectors "
12186 "parameters which were rarely if ever used anyway."
12190 #: ../src/guestfs-actions.pod:4696
12192 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
12193 "C<guestfs_part_disk>"
12197 #: ../src/guestfs-actions.pod:4704
12198 msgid "guestfs_sfdisk_N"
12202 #: ../src/guestfs-actions.pod:4706
12205 " int guestfs_sfdisk_N (guestfs_h *g,\n"
12206 "\t\tconst char *device,\n"
12207 "\t\tint partnum,\n"
12210 "\t\tint sectors,\n"
12211 "\t\tconst char *line);\n"
12216 #: ../src/guestfs-actions.pod:4714 ../fish/guestfish-actions.pod:3654
12218 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
12219 "(note: C<n> counts from 1)."
12223 #: ../src/guestfs-actions.pod:4717
12225 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
12226 "for the cyls/heads/sectors parameters."
12230 #: ../src/guestfs-actions.pod:4720
12231 msgid "See also: C<guestfs_part_add>"
12235 #: ../src/guestfs-actions.pod:4727
12236 msgid "guestfs_sfdisk_disk_geometry"
12240 #: ../src/guestfs-actions.pod:4729
12243 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
12244 "\t\tconst char *device);\n"
12249 #: ../src/guestfs-actions.pod:4732
12251 "This displays the disk geometry of C<device> read from the partition table. "
12252 "Especially in the case where the underlying block device has been resized, "
12253 "this can be different from the kernel's idea of the geometry (see "
12254 "C<guestfs_sfdisk_kernel_geometry>)."
12258 #: ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4750 ../fish/guestfish-actions.pod:3674 ../fish/guestfish-actions.pod:3683
12259 msgid "The result is in human-readable format, and not designed to be parsed."
12263 #: ../src/guestfs-actions.pod:4743
12264 msgid "guestfs_sfdisk_kernel_geometry"
12268 #: ../src/guestfs-actions.pod:4745
12271 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
12272 "\t\tconst char *device);\n"
12277 #: ../src/guestfs-actions.pod:4748 ../fish/guestfish-actions.pod:3681
12278 msgid "This displays the kernel's idea of the geometry of C<device>."
12282 #: ../src/guestfs-actions.pod:4756
12283 msgid "guestfs_sfdisk_l"
12287 #: ../src/guestfs-actions.pod:4758
12290 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
12291 "\t\tconst char *device);\n"
12296 #: ../src/guestfs-actions.pod:4761 ../fish/guestfish-actions.pod:3690
12298 "This displays the partition table on C<device>, in the human-readable output "
12299 "of the L<sfdisk(8)> command. It is not intended to be parsed."
12303 #: ../src/guestfs-actions.pod:4765
12304 msgid "See also: C<guestfs_part_list>"
12308 #: ../src/guestfs-actions.pod:4770
12313 #: ../src/guestfs-actions.pod:4772
12316 " char *guestfs_sh (guestfs_h *g,\n"
12317 "\t\tconst char *command);\n"
12322 #: ../src/guestfs-actions.pod:4775 ../fish/guestfish-actions.pod:3700
12324 "This call runs a command from the guest filesystem via the guest's "
12329 #: ../src/guestfs-actions.pod:4778
12330 msgid "This is like C<guestfs_command>, but passes the command to:"
12334 #: ../src/guestfs-actions.pod:4780 ../fish/guestfish-actions.pod:3705
12337 " /bin/sh -c \"command\"\n"
12342 #: ../src/guestfs-actions.pod:4782 ../fish/guestfish-actions.pod:3707
12344 "Depending on the guest's shell, this usually results in wildcards being "
12345 "expanded, shell expressions being interpolated and so on."
12349 #: ../src/guestfs-actions.pod:4786
12350 msgid "All the provisos about C<guestfs_command> apply to this call."
12354 #: ../src/guestfs-actions.pod:4791
12355 msgid "guestfs_sh_lines"
12359 #: ../src/guestfs-actions.pod:4793
12362 " char **guestfs_sh_lines (guestfs_h *g,\n"
12363 "\t\tconst char *command);\n"
12368 #: ../src/guestfs-actions.pod:4796
12370 "This is the same as C<guestfs_sh>, but splits the result into a list of "
12375 #: ../src/guestfs-actions.pod:4799
12376 msgid "See also: C<guestfs_command_lines>"
12380 #: ../src/guestfs-actions.pod:4805
12381 msgid "guestfs_sleep"
12385 #: ../src/guestfs-actions.pod:4807
12388 " int guestfs_sleep (guestfs_h *g,\n"
12394 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3726
12395 msgid "Sleep for C<secs> seconds."
12399 #: ../src/guestfs-actions.pod:4814 ../src/guestfs-structs.pod:109
12400 msgid "guestfs_stat"
12404 #: ../src/guestfs-actions.pod:4816
12407 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
12408 "\t\tconst char *path);\n"
12413 #: ../src/guestfs-actions.pod:4821 ../fish/guestfish-actions.pod:3734
12414 msgid "This is the same as the C<stat(2)> system call."
12418 #: ../src/guestfs-actions.pod:4827 ../src/guestfs-structs.pod:135
12419 msgid "guestfs_statvfs"
12423 #: ../src/guestfs-actions.pod:4829
12426 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
12427 "\t\tconst char *path);\n"
12432 #: ../src/guestfs-actions.pod:4832 ../fish/guestfish-actions.pod:3740
12434 "Returns file system statistics for any mounted file system. C<path> should "
12435 "be a file or directory in the mounted file system (typically it is the mount "
12436 "point itself, but it doesn't need to be)."
12440 #: ../src/guestfs-actions.pod:4836 ../fish/guestfish-actions.pod:3744
12441 msgid "This is the same as the C<statvfs(2)> system call."
12445 #: ../src/guestfs-actions.pod:4838
12447 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
12448 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
12452 #: ../src/guestfs-actions.pod:4842
12453 msgid "guestfs_strings"
12457 #: ../src/guestfs-actions.pod:4844
12460 " char **guestfs_strings (guestfs_h *g,\n"
12461 "\t\tconst char *path);\n"
12466 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3750
12468 "This runs the L<strings(1)> command on a file and returns the list of "
12469 "printable strings found."
12473 #: ../src/guestfs-actions.pod:4857
12474 msgid "guestfs_strings_e"
12478 #: ../src/guestfs-actions.pod:4859
12481 " char **guestfs_strings_e (guestfs_h *g,\n"
12482 "\t\tconst char *encoding,\n"
12483 "\t\tconst char *path);\n"
12488 #: ../src/guestfs-actions.pod:4863
12490 "This is like the C<guestfs_strings> command, but allows you to specify the "
12491 "encoding of strings that are looked for in the source file C<path>."
12495 #: ../src/guestfs-actions.pod:4867 ../fish/guestfish-actions.pod:3764
12496 msgid "Allowed encodings are:"
12500 #: ../src/guestfs-actions.pod:4871 ../fish/guestfish-actions.pod:3768
12505 #: ../src/guestfs-actions.pod:4873
12507 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
12508 "ISO-8859-X (this is what C<guestfs_strings> uses)."
12512 #: ../src/guestfs-actions.pod:4876 ../fish/guestfish-actions.pod:3773
12517 #: ../src/guestfs-actions.pod:4878 ../fish/guestfish-actions.pod:3775
12518 msgid "Single 8-bit-byte characters."
12522 #: ../src/guestfs-actions.pod:4880 ../fish/guestfish-actions.pod:3777
12527 #: ../src/guestfs-actions.pod:4882 ../fish/guestfish-actions.pod:3779
12528 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
12532 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3782
12533 msgid "l (lower case letter L)"
12537 #: ../src/guestfs-actions.pod:4887 ../fish/guestfish-actions.pod:3784
12539 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
12540 "examining binaries in Windows guests."
12544 #: ../src/guestfs-actions.pod:4890 ../fish/guestfish-actions.pod:3787
12549 #: ../src/guestfs-actions.pod:4892 ../fish/guestfish-actions.pod:3789
12550 msgid "32-bit big endian such as UCS-4BE."
12554 #: ../src/guestfs-actions.pod:4894 ../fish/guestfish-actions.pod:3791
12559 #: ../src/guestfs-actions.pod:4896 ../fish/guestfish-actions.pod:3793
12560 msgid "32-bit little endian such as UCS-4LE."
12564 #: ../src/guestfs-actions.pod:4900 ../fish/guestfish-actions.pod:3797
12565 msgid "The returned strings are transcoded to UTF-8."
12569 #: ../src/guestfs-actions.pod:4909
12570 msgid "guestfs_swapoff_device"
12574 #: ../src/guestfs-actions.pod:4911
12577 " int guestfs_swapoff_device (guestfs_h *g,\n"
12578 "\t\tconst char *device);\n"
12583 #: ../src/guestfs-actions.pod:4914
12585 "This command disables the libguestfs appliance swap device or partition "
12586 "named C<device>. See C<guestfs_swapon_device>."
12590 #: ../src/guestfs-actions.pod:4920
12591 msgid "guestfs_swapoff_file"
12595 #: ../src/guestfs-actions.pod:4922
12598 " int guestfs_swapoff_file (guestfs_h *g,\n"
12599 "\t\tconst char *file);\n"
12604 #: ../src/guestfs-actions.pod:4925 ../fish/guestfish-actions.pod:3814
12605 msgid "This command disables the libguestfs appliance swap on file."
12609 #: ../src/guestfs-actions.pod:4929
12610 msgid "guestfs_swapoff_label"
12614 #: ../src/guestfs-actions.pod:4931
12617 " int guestfs_swapoff_label (guestfs_h *g,\n"
12618 "\t\tconst char *label);\n"
12623 #: ../src/guestfs-actions.pod:4934 ../fish/guestfish-actions.pod:3820
12625 "This command disables the libguestfs appliance swap on labeled swap "
12630 #: ../src/guestfs-actions.pod:4939
12631 msgid "guestfs_swapoff_uuid"
12635 #: ../src/guestfs-actions.pod:4941
12638 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
12639 "\t\tconst char *uuid);\n"
12644 #: ../src/guestfs-actions.pod:4944 ../fish/guestfish-actions.pod:3827
12646 "This command disables the libguestfs appliance swap partition with the given "
12651 #: ../src/guestfs-actions.pod:4949
12652 msgid "guestfs_swapon_device"
12656 #: ../src/guestfs-actions.pod:4951
12659 " int guestfs_swapon_device (guestfs_h *g,\n"
12660 "\t\tconst char *device);\n"
12665 #: ../src/guestfs-actions.pod:4954
12667 "This command enables the libguestfs appliance to use the swap device or "
12668 "partition named C<device>. The increased memory is made available for all "
12669 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
12673 #: ../src/guestfs-actions.pod:4959 ../fish/guestfish-actions.pod:3839
12675 "Note that you should not swap to existing guest swap partitions unless you "
12676 "know what you are doing. They may contain hibernation information, or other "
12677 "information that the guest doesn't want you to trash. You also risk leaking "
12678 "information about the host to the guest this way. Instead, attach a new "
12679 "host device to the guest and swap on that."
12683 #: ../src/guestfs-actions.pod:4968
12684 msgid "guestfs_swapon_file"
12688 #: ../src/guestfs-actions.pod:4970
12691 " int guestfs_swapon_file (guestfs_h *g,\n"
12692 "\t\tconst char *file);\n"
12697 #: ../src/guestfs-actions.pod:4973
12699 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
12704 #: ../src/guestfs-actions.pod:4978
12705 msgid "guestfs_swapon_label"
12709 #: ../src/guestfs-actions.pod:4980
12712 " int guestfs_swapon_label (guestfs_h *g,\n"
12713 "\t\tconst char *label);\n"
12718 #: ../src/guestfs-actions.pod:4983
12720 "This command enables swap to a labeled swap partition. See "
12721 "C<guestfs_swapon_device> for other notes."
12725 #: ../src/guestfs-actions.pod:4988
12726 msgid "guestfs_swapon_uuid"
12730 #: ../src/guestfs-actions.pod:4990
12733 " int guestfs_swapon_uuid (guestfs_h *g,\n"
12734 "\t\tconst char *uuid);\n"
12739 #: ../src/guestfs-actions.pod:4993
12741 "This command enables swap to a swap partition with the given UUID. See "
12742 "C<guestfs_swapon_device> for other notes."
12746 #: ../src/guestfs-actions.pod:4998
12747 msgid "guestfs_sync"
12751 #: ../src/guestfs-actions.pod:5000
12754 " int guestfs_sync (guestfs_h *g);\n"
12759 #: ../src/guestfs-actions.pod:5002 ../fish/guestfish-actions.pod:3871
12761 "This syncs the disk, so that any writes are flushed through to the "
12762 "underlying disk image."
12766 #: ../src/guestfs-actions.pod:5005 ../fish/guestfish-actions.pod:3874
12768 "You should always call this if you have modified a disk image, before "
12769 "closing the handle."
12773 #: ../src/guestfs-actions.pod:5010
12774 msgid "guestfs_tail"
12778 #: ../src/guestfs-actions.pod:5012
12781 " char **guestfs_tail (guestfs_h *g,\n"
12782 "\t\tconst char *path);\n"
12787 #: ../src/guestfs-actions.pod:5015 ../fish/guestfish-actions.pod:3881
12788 msgid "This command returns up to the last 10 lines of a file as a list of strings."
12792 #: ../src/guestfs-actions.pod:5025
12793 msgid "guestfs_tail_n"
12797 #: ../src/guestfs-actions.pod:5027
12800 " char **guestfs_tail_n (guestfs_h *g,\n"
12801 "\t\tint nrlines,\n"
12802 "\t\tconst char *path);\n"
12807 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3891
12809 "If the parameter C<nrlines> is a positive number, this returns the last "
12810 "C<nrlines> lines of the file C<path>."
12814 #: ../src/guestfs-actions.pod:5034 ../fish/guestfish-actions.pod:3894
12816 "If the parameter C<nrlines> is a negative number, this returns lines from "
12817 "the file C<path>, starting with the C<-nrlines>th line."
12821 #: ../src/guestfs-actions.pod:5046
12822 msgid "guestfs_tar_in"
12826 #: ../src/guestfs-actions.pod:5048
12829 " int guestfs_tar_in (guestfs_h *g,\n"
12830 "\t\tconst char *tarfile,\n"
12831 "\t\tconst char *directory);\n"
12836 #: ../src/guestfs-actions.pod:5052 ../fish/guestfish-actions.pod:3906
12838 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
12839 "tar file) into C<directory>."
12843 #: ../src/guestfs-actions.pod:5055
12844 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
12848 #: ../src/guestfs-actions.pod:5060
12849 msgid "guestfs_tar_out"
12853 #: ../src/guestfs-actions.pod:5062
12856 " int guestfs_tar_out (guestfs_h *g,\n"
12857 "\t\tconst char *directory,\n"
12858 "\t\tconst char *tarfile);\n"
12863 #: ../src/guestfs-actions.pod:5066 ../fish/guestfish-actions.pod:3918
12865 "This command packs the contents of C<directory> and downloads it to local "
12870 #: ../src/guestfs-actions.pod:5069
12872 "To download a compressed tarball, use C<guestfs_tgz_out> or "
12873 "C<guestfs_txz_out>."
12877 #: ../src/guestfs-actions.pod:5074
12878 msgid "guestfs_tgz_in"
12882 #: ../src/guestfs-actions.pod:5076
12885 " int guestfs_tgz_in (guestfs_h *g,\n"
12886 "\t\tconst char *tarball,\n"
12887 "\t\tconst char *directory);\n"
12892 #: ../src/guestfs-actions.pod:5080 ../fish/guestfish-actions.pod:3930
12894 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
12895 "tar file) into C<directory>."
12899 #: ../src/guestfs-actions.pod:5083
12900 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
12904 #: ../src/guestfs-actions.pod:5087
12905 msgid "guestfs_tgz_out"
12909 #: ../src/guestfs-actions.pod:5089
12912 " int guestfs_tgz_out (guestfs_h *g,\n"
12913 "\t\tconst char *directory,\n"
12914 "\t\tconst char *tarball);\n"
12919 #: ../src/guestfs-actions.pod:5093 ../fish/guestfish-actions.pod:3941
12921 "This command packs the contents of C<directory> and downloads it to local "
12926 #: ../src/guestfs-actions.pod:5096
12927 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
12931 #: ../src/guestfs-actions.pod:5100
12932 msgid "guestfs_touch"
12936 #: ../src/guestfs-actions.pod:5102
12939 " int guestfs_touch (guestfs_h *g,\n"
12940 "\t\tconst char *path);\n"
12945 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3952
12947 "Touch acts like the L<touch(1)> command. It can be used to update the "
12948 "timestamps on a file, or, if the file does not exist, to create a new "
12949 "zero-length file."
12953 #: ../src/guestfs-actions.pod:5109 ../fish/guestfish-actions.pod:3956
12955 "This command only works on regular files, and will fail on other file types "
12956 "such as directories, symbolic links, block special etc."
12960 #: ../src/guestfs-actions.pod:5114
12961 msgid "guestfs_truncate"
12965 #: ../src/guestfs-actions.pod:5116
12968 " int guestfs_truncate (guestfs_h *g,\n"
12969 "\t\tconst char *path);\n"
12974 #: ../src/guestfs-actions.pod:5119 ../fish/guestfish-actions.pod:3963
12976 "This command truncates C<path> to a zero-length file. The file must exist "
12981 #: ../src/guestfs-actions.pod:5124
12982 msgid "guestfs_truncate_size"
12986 #: ../src/guestfs-actions.pod:5126
12989 " int guestfs_truncate_size (guestfs_h *g,\n"
12990 "\t\tconst char *path,\n"
12991 "\t\tint64_t size);\n"
12996 #: ../src/guestfs-actions.pod:5130 ../fish/guestfish-actions.pod:3970
12998 "This command truncates C<path> to size C<size> bytes. The file must exist "
13003 #: ../src/guestfs-actions.pod:5133
13005 "If the current file size is less than C<size> then the file is extended to "
13006 "the required size with zero bytes. This creates a sparse file (ie. disk "
13007 "blocks are not allocated for the file until you write to it). To create a "
13008 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
13012 #: ../src/guestfs-actions.pod:5141
13013 msgid "guestfs_tune2fs_l"
13017 #: ../src/guestfs-actions.pod:5143
13020 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
13021 "\t\tconst char *device);\n"
13026 #: ../src/guestfs-actions.pod:5146 ../fish/guestfish-actions.pod:3983
13028 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
13033 #: ../src/guestfs-actions.pod:5149 ../fish/guestfish-actions.pod:3986
13035 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
13036 "for more details. The list of fields returned isn't clearly defined, and "
13037 "depends on both the version of C<tune2fs> that libguestfs was built against, "
13038 "and the filesystem itself."
13042 #: ../src/guestfs-actions.pod:5160
13043 msgid "guestfs_txz_in"
13047 #: ../src/guestfs-actions.pod:5162
13050 " int guestfs_txz_in (guestfs_h *g,\n"
13051 "\t\tconst char *tarball,\n"
13052 "\t\tconst char *directory);\n"
13057 #: ../src/guestfs-actions.pod:5166 ../fish/guestfish-actions.pod:3995
13059 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
13060 "tar file) into C<directory>."
13064 #: ../src/guestfs-actions.pod:5171
13065 msgid "guestfs_txz_out"
13069 #: ../src/guestfs-actions.pod:5173
13072 " int guestfs_txz_out (guestfs_h *g,\n"
13073 "\t\tconst char *directory,\n"
13074 "\t\tconst char *tarball);\n"
13079 #: ../src/guestfs-actions.pod:5177 ../fish/guestfish-actions.pod:4004
13081 "This command packs the contents of C<directory> and downloads it to local "
13082 "file C<tarball> (as an xz compressed tar archive)."
13086 #: ../src/guestfs-actions.pod:5182
13087 msgid "guestfs_umask"
13091 #: ../src/guestfs-actions.pod:5184
13094 " int guestfs_umask (guestfs_h *g,\n"
13100 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:4013
13102 "This function sets the mask used for creating new files and device nodes to "
13107 #: ../src/guestfs-actions.pod:5190 ../fish/guestfish-actions.pod:4016
13109 "Typical umask values would be C<022> which creates new files with "
13110 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
13111 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
13115 #: ../src/guestfs-actions.pod:5195 ../fish/guestfish-actions.pod:4021
13117 "The default umask is C<022>. This is important because it means that "
13118 "directories and device nodes will be created with C<0644> or C<0755> mode "
13119 "even if you specify C<0777>."
13123 #: ../src/guestfs-actions.pod:5199
13125 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
13126 "C<guestfs_mkdir>."
13130 #: ../src/guestfs-actions.pod:5202 ../fish/guestfish-actions.pod:4028
13131 msgid "This call returns the previous umask."
13135 #: ../src/guestfs-actions.pod:5206
13136 msgid "guestfs_umount"
13140 #: ../src/guestfs-actions.pod:5208
13143 " int guestfs_umount (guestfs_h *g,\n"
13144 "\t\tconst char *pathordevice);\n"
13149 #: ../src/guestfs-actions.pod:5211 ../fish/guestfish-actions.pod:4036
13151 "This unmounts the given filesystem. The filesystem may be specified either "
13152 "by its mountpoint (path) or the device which contains the filesystem."
13156 #: ../src/guestfs-actions.pod:5217
13157 msgid "guestfs_umount_all"
13161 #: ../src/guestfs-actions.pod:5219
13164 " int guestfs_umount_all (guestfs_h *g);\n"
13169 #: ../src/guestfs-actions.pod:5221 ../fish/guestfish-actions.pod:4046
13170 msgid "This unmounts all mounted filesystems."
13174 #: ../src/guestfs-actions.pod:5223 ../fish/guestfish-actions.pod:4048
13175 msgid "Some internal mounts are not unmounted by this call."
13179 #: ../src/guestfs-actions.pod:5227
13180 msgid "guestfs_upload"
13184 #: ../src/guestfs-actions.pod:5229
13187 " int guestfs_upload (guestfs_h *g,\n"
13188 "\t\tconst char *filename,\n"
13189 "\t\tconst char *remotefilename);\n"
13194 #: ../src/guestfs-actions.pod:5233 ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:4054 ../fish/guestfish-actions.pod:4067
13195 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
13199 #: ../src/guestfs-actions.pod:5238
13200 msgid "See also C<guestfs_download>."
13204 #: ../src/guestfs-actions.pod:5242
13205 msgid "guestfs_upload_offset"
13209 #: ../src/guestfs-actions.pod:5244
13212 " int guestfs_upload_offset (guestfs_h *g,\n"
13213 "\t\tconst char *filename,\n"
13214 "\t\tconst char *remotefilename,\n"
13215 "\t\tint64_t offset);\n"
13220 #: ../src/guestfs-actions.pod:5252 ../fish/guestfish-actions.pod:4070
13222 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
13223 "The intention is to overwrite parts of existing files or devices, although "
13224 "if a non-existant file is specified then it is created with a \"hole\" "
13225 "before C<offset>. The size of the data written is implicit in the size of "
13226 "the source C<filename>."
13230 #: ../src/guestfs-actions.pod:5259
13232 "Note that there is no limit on the amount of data that can be uploaded with "
13233 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
13234 "full amount unless an error occurs."
13238 #: ../src/guestfs-actions.pod:5264
13239 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
13243 #: ../src/guestfs-actions.pod:5268
13244 msgid "guestfs_utimens"
13248 #: ../src/guestfs-actions.pod:5270
13251 " int guestfs_utimens (guestfs_h *g,\n"
13252 "\t\tconst char *path,\n"
13253 "\t\tint64_t atsecs,\n"
13254 "\t\tint64_t atnsecs,\n"
13255 "\t\tint64_t mtsecs,\n"
13256 "\t\tint64_t mtnsecs);\n"
13261 #: ../src/guestfs-actions.pod:5277 ../fish/guestfish-actions.pod:4090
13262 msgid "This command sets the timestamps of a file with nanosecond precision."
13266 #: ../src/guestfs-actions.pod:5280 ../fish/guestfish-actions.pod:4093
13268 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
13273 #: ../src/guestfs-actions.pod:5283 ../fish/guestfish-actions.pod:4096
13275 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
13276 "nanoseconds from the epoch."
13280 #: ../src/guestfs-actions.pod:5286 ../fish/guestfish-actions.pod:4099
13282 "If the C<*nsecs> field contains the special value C<-1> then the "
13283 "corresponding timestamp is set to the current time. (The C<*secs> field is "
13284 "ignored in this case)."
13288 #: ../src/guestfs-actions.pod:5290 ../fish/guestfish-actions.pod:4103
13290 "If the C<*nsecs> field contains the special value C<-2> then the "
13291 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
13296 #: ../src/guestfs-actions.pod:5296 ../src/guestfs-structs.pod:175
13297 msgid "guestfs_version"
13301 #: ../src/guestfs-actions.pod:5298
13304 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
13309 #: ../src/guestfs-actions.pod:5300 ../fish/guestfish-actions.pod:4111
13310 msgid "Return the libguestfs version number that the program is linked against."
13314 #: ../src/guestfs-actions.pod:5303 ../fish/guestfish-actions.pod:4114
13316 "Note that because of dynamic linking this is not necessarily the version of "
13317 "libguestfs that you compiled against. You can compile the program, and then "
13318 "at runtime dynamically link against a completely different C<libguestfs.so> "
13323 #: ../src/guestfs-actions.pod:5308 ../fish/guestfish-actions.pod:4119
13325 "This call was added in version C<1.0.58>. In previous versions of "
13326 "libguestfs there was no way to get the version number. From C code you can "
13327 "use dynamic linker functions to find out if this symbol exists (if it "
13328 "doesn't, then it's an earlier version)."
13332 #: ../src/guestfs-actions.pod:5314 ../fish/guestfish-actions.pod:4125
13334 "The call returns a structure with four elements. The first three (C<major>, "
13335 "C<minor> and C<release>) are numbers and correspond to the usual version "
13336 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
13337 "but may be used for distro-specific information."
13341 #: ../src/guestfs-actions.pod:5320 ../fish/guestfish-actions.pod:4131
13342 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
13346 #: ../src/guestfs-actions.pod:5323 ../fish/guestfish-actions.pod:4134
13347 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
13351 #: ../src/guestfs-actions.pod:5325
13353 "I<Note:> Don't use this call to test for availability of features. In "
13354 "enterprise distributions we backport features from later versions into "
13355 "earlier versions, making this an unreliable way to test for features. Use "
13356 "C<guestfs_available> instead."
13360 #: ../src/guestfs-actions.pod:5331
13362 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
13363 "error. I<The caller must call C<guestfs_free_version> after use>."
13367 #: ../src/guestfs-actions.pod:5335
13368 msgid "guestfs_vfs_label"
13372 #: ../src/guestfs-actions.pod:5337
13375 " char *guestfs_vfs_label (guestfs_h *g,\n"
13376 "\t\tconst char *device);\n"
13381 #: ../src/guestfs-actions.pod:5340 ../fish/guestfish-actions.pod:4146
13382 msgid "This returns the filesystem label of the filesystem on C<device>."
13386 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:4149
13387 msgid "If the filesystem is unlabeled, this returns the empty string."
13391 #: ../src/guestfs-actions.pod:5345
13392 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
13396 #: ../src/guestfs-actions.pod:5350
13397 msgid "guestfs_vfs_type"
13401 #: ../src/guestfs-actions.pod:5352
13404 " char *guestfs_vfs_type (guestfs_h *g,\n"
13405 "\t\tconst char *device);\n"
13410 #: ../src/guestfs-actions.pod:5355 ../fish/guestfish-actions.pod:4157
13412 "This command gets the filesystem type corresponding to the filesystem on "
13417 #: ../src/guestfs-actions.pod:5358 ../fish/guestfish-actions.pod:4160
13419 "For most filesystems, the result is the name of the Linux VFS module which "
13420 "would be used to mount this filesystem if you mounted it without specifying "
13421 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
13425 #: ../src/guestfs-actions.pod:5366
13426 msgid "guestfs_vfs_uuid"
13430 #: ../src/guestfs-actions.pod:5368
13433 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
13434 "\t\tconst char *device);\n"
13439 #: ../src/guestfs-actions.pod:5371 ../fish/guestfish-actions.pod:4169
13440 msgid "This returns the filesystem UUID of the filesystem on C<device>."
13444 #: ../src/guestfs-actions.pod:5374 ../fish/guestfish-actions.pod:4172
13445 msgid "If the filesystem does not have a UUID, this returns the empty string."
13449 #: ../src/guestfs-actions.pod:5376
13450 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
13454 #: ../src/guestfs-actions.pod:5381
13455 msgid "guestfs_vg_activate"
13459 #: ../src/guestfs-actions.pod:5383
13462 " int guestfs_vg_activate (guestfs_h *g,\n"
13463 "\t\tint activate,\n"
13464 "\t\tchar *const *volgroups);\n"
13469 #: ../src/guestfs-actions.pod:5387 ../fish/guestfish-actions.pod:4180
13471 "This command activates or (if C<activate> is false) deactivates all logical "
13472 "volumes in the listed volume groups C<volgroups>. If activated, then they "
13473 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
13474 "deactivated, then those devices disappear."
13478 #: ../src/guestfs-actions.pod:5393 ../fish/guestfish-actions.pod:4186
13479 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
13483 #: ../src/guestfs-actions.pod:5395 ../fish/guestfish-actions.pod:4188
13485 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
13486 "activated or deactivated."
13490 #: ../src/guestfs-actions.pod:5400
13491 msgid "guestfs_vg_activate_all"
13495 #: ../src/guestfs-actions.pod:5402
13498 " int guestfs_vg_activate_all (guestfs_h *g,\n"
13499 "\t\tint activate);\n"
13504 #: ../src/guestfs-actions.pod:5405 ../fish/guestfish-actions.pod:4195
13506 "This command activates or (if C<activate> is false) deactivates all logical "
13507 "volumes in all volume groups. If activated, then they are made known to the "
13508 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
13509 "those devices disappear."
13513 #: ../src/guestfs-actions.pod:5411 ../fish/guestfish-actions.pod:4201
13514 msgid "This command is the same as running C<vgchange -a y|n>"
13518 #: ../src/guestfs-actions.pod:5415
13519 msgid "guestfs_vgcreate"
13523 #: ../src/guestfs-actions.pod:5417
13526 " int guestfs_vgcreate (guestfs_h *g,\n"
13527 "\t\tconst char *volgroup,\n"
13528 "\t\tchar *const *physvols);\n"
13533 #: ../src/guestfs-actions.pod:5421 ../fish/guestfish-actions.pod:4207
13535 "This creates an LVM volume group called C<volgroup> from the non-empty list "
13536 "of physical volumes C<physvols>."
13540 #: ../src/guestfs-actions.pod:5426
13541 msgid "guestfs_vglvuuids"
13545 #: ../src/guestfs-actions.pod:5428
13548 " char **guestfs_vglvuuids (guestfs_h *g,\n"
13549 "\t\tconst char *vgname);\n"
13554 #: ../src/guestfs-actions.pod:5431 ../fish/guestfish-actions.pod:4214
13556 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
13557 "volumes created in this volume group."
13561 #: ../src/guestfs-actions.pod:5434
13563 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
13564 "associate logical volumes and volume groups."
13568 #: ../src/guestfs-actions.pod:5437
13569 msgid "See also C<guestfs_vgpvuuids>."
13573 #: ../src/guestfs-actions.pod:5443
13574 msgid "guestfs_vgpvuuids"
13578 #: ../src/guestfs-actions.pod:5445
13581 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
13582 "\t\tconst char *vgname);\n"
13587 #: ../src/guestfs-actions.pod:5448 ../fish/guestfish-actions.pod:4226
13589 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
13590 "volumes that this volume group resides on."
13594 #: ../src/guestfs-actions.pod:5451
13596 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
13597 "associate physical volumes and volume groups."
13601 #: ../src/guestfs-actions.pod:5454
13602 msgid "See also C<guestfs_vglvuuids>."
13606 #: ../src/guestfs-actions.pod:5460
13607 msgid "guestfs_vgremove"
13611 #: ../src/guestfs-actions.pod:5462
13614 " int guestfs_vgremove (guestfs_h *g,\n"
13615 "\t\tconst char *vgname);\n"
13620 #: ../src/guestfs-actions.pod:5465 ../fish/guestfish-actions.pod:4238
13621 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
13625 #: ../src/guestfs-actions.pod:5467 ../fish/guestfish-actions.pod:4240
13626 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
13630 #: ../src/guestfs-actions.pod:5472
13631 msgid "guestfs_vgrename"
13635 #: ../src/guestfs-actions.pod:5474
13638 " int guestfs_vgrename (guestfs_h *g,\n"
13639 "\t\tconst char *volgroup,\n"
13640 "\t\tconst char *newvolgroup);\n"
13645 #: ../src/guestfs-actions.pod:5478 ../fish/guestfish-actions.pod:4247
13646 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
13650 #: ../src/guestfs-actions.pod:5482
13651 msgid "guestfs_vgs"
13655 #: ../src/guestfs-actions.pod:5484
13658 " char **guestfs_vgs (guestfs_h *g);\n"
13663 #: ../src/guestfs-actions.pod:5486 ../fish/guestfish-actions.pod:4253
13665 "List all the volumes groups detected. This is the equivalent of the "
13666 "L<vgs(8)> command."
13670 #: ../src/guestfs-actions.pod:5489 ../fish/guestfish-actions.pod:4256
13672 "This returns a list of just the volume group names that were detected "
13673 "(eg. C<VolGroup00>)."
13677 #: ../src/guestfs-actions.pod:5492
13678 msgid "See also C<guestfs_vgs_full>."
13682 #: ../src/guestfs-actions.pod:5498
13683 msgid "guestfs_vgs_full"
13687 #: ../src/guestfs-actions.pod:5500
13690 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
13695 #: ../src/guestfs-actions.pod:5502 ../fish/guestfish-actions.pod:4265
13697 "List all the volumes groups detected. This is the equivalent of the "
13698 "L<vgs(8)> command. The \"full\" version includes all fields."
13702 #: ../src/guestfs-actions.pod:5505
13704 "This function returns a C<struct guestfs_lvm_vg_list *> (see "
13705 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
13706 "must call C<guestfs_free_lvm_vg_list> after use>."
13710 #: ../src/guestfs-actions.pod:5510
13711 msgid "guestfs_vgscan"
13715 #: ../src/guestfs-actions.pod:5512
13718 " int guestfs_vgscan (guestfs_h *g);\n"
13723 #: ../src/guestfs-actions.pod:5514 ../fish/guestfish-actions.pod:4272
13725 "This rescans all block devices and rebuilds the list of LVM physical "
13726 "volumes, volume groups and logical volumes."
13730 #: ../src/guestfs-actions.pod:5519
13731 msgid "guestfs_vguuid"
13735 #: ../src/guestfs-actions.pod:5521
13738 " char *guestfs_vguuid (guestfs_h *g,\n"
13739 "\t\tconst char *vgname);\n"
13744 #: ../src/guestfs-actions.pod:5524 ../fish/guestfish-actions.pod:4279
13745 msgid "This command returns the UUID of the LVM VG named C<vgname>."
13749 #: ../src/guestfs-actions.pod:5529
13750 msgid "guestfs_wait_ready"
13754 #: ../src/guestfs-actions.pod:5531
13757 " int guestfs_wait_ready (guestfs_h *g);\n"
13762 #: ../src/guestfs-actions.pod:5533
13763 msgid "This function is a no op."
13767 #: ../src/guestfs-actions.pod:5535
13769 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
13770 "calling C<guestfs_launch> to wait for the launch to complete. However this "
13771 "is no longer necessary because C<guestfs_launch> now does the waiting."
13775 #: ../src/guestfs-actions.pod:5540
13777 "If you see any calls to this function in code then you can just remove them, "
13778 "unless you want to retain compatibility with older versions of the API."
13782 #: ../src/guestfs-actions.pod:5546
13783 msgid "guestfs_wc_c"
13787 #: ../src/guestfs-actions.pod:5548
13790 " int guestfs_wc_c (guestfs_h *g,\n"
13791 "\t\tconst char *path);\n"
13796 #: ../src/guestfs-actions.pod:5551 ../fish/guestfish-actions.pod:4285
13798 "This command counts the characters in a file, using the C<wc -c> external "
13803 #: ../src/guestfs-actions.pod:5556
13804 msgid "guestfs_wc_l"
13808 #: ../src/guestfs-actions.pod:5558
13811 " int guestfs_wc_l (guestfs_h *g,\n"
13812 "\t\tconst char *path);\n"
13817 #: ../src/guestfs-actions.pod:5561 ../fish/guestfish-actions.pod:4292
13819 "This command counts the lines in a file, using the C<wc -l> external "
13824 #: ../src/guestfs-actions.pod:5566
13825 msgid "guestfs_wc_w"
13829 #: ../src/guestfs-actions.pod:5568
13832 " int guestfs_wc_w (guestfs_h *g,\n"
13833 "\t\tconst char *path);\n"
13838 #: ../src/guestfs-actions.pod:5571 ../fish/guestfish-actions.pod:4299
13840 "This command counts the words in a file, using the C<wc -w> external "
13845 #: ../src/guestfs-actions.pod:5576
13846 msgid "guestfs_write"
13850 #: ../src/guestfs-actions.pod:5578
13853 " int guestfs_write (guestfs_h *g,\n"
13854 "\t\tconst char *path,\n"
13855 "\t\tconst char *content,\n"
13856 "\t\tsize_t content_size);\n"
13861 #: ../src/guestfs-actions.pod:5583 ../fish/guestfish-actions.pod:4306
13863 "This call creates a file called C<path>. The content of the file is the "
13864 "string C<content> (which can contain any 8 bit data)."
13868 #: ../src/guestfs-actions.pod:5591
13869 msgid "guestfs_write_file"
13873 #: ../src/guestfs-actions.pod:5593
13876 " int guestfs_write_file (guestfs_h *g,\n"
13877 "\t\tconst char *path,\n"
13878 "\t\tconst char *content,\n"
13884 #: ../src/guestfs-actions.pod:5598 ../fish/guestfish-actions.pod:4316
13886 "This call creates a file called C<path>. The contents of the file is the "
13887 "string C<content> (which can contain any 8 bit data), with length C<size>."
13891 #: ../src/guestfs-actions.pod:5602 ../fish/guestfish-actions.pod:4320
13893 "As a special case, if C<size> is C<0> then the length is calculated using "
13894 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
13898 #: ../src/guestfs-actions.pod:5606 ../fish/guestfish-actions.pod:4324
13900 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
13901 "I<not> work, even if the length is specified."
13905 #: ../src/guestfs-actions.pod:5614 ../fish/guestfish-actions.pod:4330
13906 msgid "This function is deprecated. In new code, use the C<write> call instead."
13910 #: ../src/guestfs-actions.pod:5621
13911 msgid "guestfs_zegrep"
13915 #: ../src/guestfs-actions.pod:5623
13918 " char **guestfs_zegrep (guestfs_h *g,\n"
13919 "\t\tconst char *regex,\n"
13920 "\t\tconst char *path);\n"
13925 #: ../src/guestfs-actions.pod:5627 ../fish/guestfish-actions.pod:4341
13926 msgid "This calls the external C<zegrep> program and returns the matching lines."
13930 #: ../src/guestfs-actions.pod:5637
13931 msgid "guestfs_zegrepi"
13935 #: ../src/guestfs-actions.pod:5639
13938 " char **guestfs_zegrepi (guestfs_h *g,\n"
13939 "\t\tconst char *regex,\n"
13940 "\t\tconst char *path);\n"
13945 #: ../src/guestfs-actions.pod:5643 ../fish/guestfish-actions.pod:4351
13946 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
13950 #: ../src/guestfs-actions.pod:5653
13951 msgid "guestfs_zero"
13955 #: ../src/guestfs-actions.pod:5655
13958 " int guestfs_zero (guestfs_h *g,\n"
13959 "\t\tconst char *device);\n"
13964 #: ../src/guestfs-actions.pod:5658 ../fish/guestfish-actions.pod:4361
13965 msgid "This command writes zeroes over the first few blocks of C<device>."
13969 #: ../src/guestfs-actions.pod:5660 ../fish/guestfish-actions.pod:4363
13971 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
13972 "securely wipe the device). It should be sufficient to remove any partition "
13973 "tables, filesystem superblocks and so on."
13977 #: ../src/guestfs-actions.pod:5664
13978 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
13982 #: ../src/guestfs-actions.pod:5673
13983 msgid "guestfs_zero_device"
13987 #: ../src/guestfs-actions.pod:5675
13990 " int guestfs_zero_device (guestfs_h *g,\n"
13991 "\t\tconst char *device);\n"
13996 #: ../src/guestfs-actions.pod:5678
13998 "This command writes zeroes over the entire C<device>. Compare with "
13999 "C<guestfs_zero> which just zeroes the first few blocks of a device."
14003 #: ../src/guestfs-actions.pod:5692
14004 msgid "guestfs_zerofree"
14008 #: ../src/guestfs-actions.pod:5694
14011 " int guestfs_zerofree (guestfs_h *g,\n"
14012 "\t\tconst char *device);\n"
14017 #: ../src/guestfs-actions.pod:5697 ../fish/guestfish-actions.pod:4384
14019 "This runs the I<zerofree> program on C<device>. This program claims to zero "
14020 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
14021 "possible to compress the filesystem more effectively."
14025 #: ../src/guestfs-actions.pod:5702 ../fish/guestfish-actions.pod:4389
14026 msgid "You should B<not> run this program if the filesystem is mounted."
14030 #: ../src/guestfs-actions.pod:5705 ../fish/guestfish-actions.pod:4392
14032 "It is possible that using this program can damage the filesystem or data on "
14037 #: ../src/guestfs-actions.pod:5710
14038 msgid "guestfs_zfgrep"
14042 #: ../src/guestfs-actions.pod:5712
14045 " char **guestfs_zfgrep (guestfs_h *g,\n"
14046 "\t\tconst char *pattern,\n"
14047 "\t\tconst char *path);\n"
14052 #: ../src/guestfs-actions.pod:5716 ../fish/guestfish-actions.pod:4399
14053 msgid "This calls the external C<zfgrep> program and returns the matching lines."
14057 #: ../src/guestfs-actions.pod:5726
14058 msgid "guestfs_zfgrepi"
14062 #: ../src/guestfs-actions.pod:5728
14065 " char **guestfs_zfgrepi (guestfs_h *g,\n"
14066 "\t\tconst char *pattern,\n"
14067 "\t\tconst char *path);\n"
14072 #: ../src/guestfs-actions.pod:5732 ../fish/guestfish-actions.pod:4409
14073 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
14077 #: ../src/guestfs-actions.pod:5742
14078 msgid "guestfs_zfile"
14082 #: ../src/guestfs-actions.pod:5744
14085 " char *guestfs_zfile (guestfs_h *g,\n"
14086 "\t\tconst char *meth,\n"
14087 "\t\tconst char *path);\n"
14092 #: ../src/guestfs-actions.pod:5748 ../fish/guestfish-actions.pod:4419
14093 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
14097 #: ../src/guestfs-actions.pod:5751 ../fish/guestfish-actions.pod:4422
14098 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
14102 #: ../src/guestfs-actions.pod:5753
14104 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
14109 #: ../src/guestfs-actions.pod:5759 ../fish/guestfish-actions.pod:4427
14110 msgid "This function is deprecated. In new code, use the C<file> call instead."
14114 #: ../src/guestfs-actions.pod:5766
14115 msgid "guestfs_zgrep"
14119 #: ../src/guestfs-actions.pod:5768
14122 " char **guestfs_zgrep (guestfs_h *g,\n"
14123 "\t\tconst char *regex,\n"
14124 "\t\tconst char *path);\n"
14129 #: ../src/guestfs-actions.pod:5772 ../fish/guestfish-actions.pod:4438
14130 msgid "This calls the external C<zgrep> program and returns the matching lines."
14134 #: ../src/guestfs-actions.pod:5782
14135 msgid "guestfs_zgrepi"
14139 #: ../src/guestfs-actions.pod:5784
14142 " char **guestfs_zgrepi (guestfs_h *g,\n"
14143 "\t\tconst char *regex,\n"
14144 "\t\tconst char *path);\n"
14149 #: ../src/guestfs-actions.pod:5788 ../fish/guestfish-actions.pod:4448
14150 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
14154 #: ../src/guestfs-availability.pod:3
14159 #: ../src/guestfs-availability.pod:5
14161 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
14162 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
14163 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
14164 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
14165 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
14169 #: ../src/guestfs-availability.pod:21
14174 #: ../src/guestfs-availability.pod:23
14176 "The following functions: L</guestfs_inotify_add_watch> "
14177 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
14178 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
14182 #: ../src/guestfs-availability.pod:31
14183 msgid "B<linuxfsuuid>"
14187 #: ../src/guestfs-availability.pod:33
14189 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
14190 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
14194 #: ../src/guestfs-availability.pod:40
14195 msgid "B<linuxmodules>"
14199 #: ../src/guestfs-availability.pod:42
14200 msgid "The following functions: L</guestfs_modprobe>"
14204 #: ../src/guestfs-availability.pod:45
14205 msgid "B<linuxxattrs>"
14209 #: ../src/guestfs-availability.pod:47
14211 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> "
14212 "L</guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> "
14213 "L</guestfs_removexattr> L</guestfs_setxattr>"
14217 #: ../src/guestfs-availability.pod:56
14222 #: ../src/guestfs-availability.pod:58
14224 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
14225 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
14226 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
14230 #: ../src/guestfs-availability.pod:67
14235 #: ../src/guestfs-availability.pod:69
14237 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
14238 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
14239 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
14240 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
14241 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
14242 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
14243 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
14244 "L</guestfs_vgs_full>"
14248 #: ../src/guestfs-availability.pod:92
14253 #: ../src/guestfs-availability.pod:94
14255 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
14256 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
14260 #: ../src/guestfs-availability.pod:100
14265 #: ../src/guestfs-availability.pod:102
14266 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
14270 #: ../src/guestfs-availability.pod:105
14271 msgid "B<ntfsprogs>"
14275 #: ../src/guestfs-availability.pod:107
14276 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
14280 #: ../src/guestfs-availability.pod:111
14281 msgid "B<realpath>"
14285 #: ../src/guestfs-availability.pod:113
14286 msgid "The following functions: L</guestfs_realpath>"
14290 #: ../src/guestfs-availability.pod:116
14295 #: ../src/guestfs-availability.pod:118
14297 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
14298 "L</guestfs_scrub_freespace>"
14302 #: ../src/guestfs-availability.pod:123
14307 #: ../src/guestfs-availability.pod:125
14308 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
14312 #: ../src/guestfs-availability.pod:129
14317 #: ../src/guestfs-availability.pod:131
14318 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
14322 #: ../src/guestfs-availability.pod:135
14323 msgid "B<zerofree>"
14327 #: ../src/guestfs-availability.pod:137
14328 msgid "The following functions: L</guestfs_zerofree>"
14332 #: ../src/guestfs-structs.pod:1
14333 msgid "guestfs_int_bool"
14337 #: ../src/guestfs-structs.pod:3
14340 " struct guestfs_int_bool {\n"
14348 #: ../src/guestfs-structs.pod:8
14351 " struct guestfs_int_bool_list {\n"
14352 " uint32_t len; /* Number of elements in list. */\n"
14353 " struct guestfs_int_bool *val; /* Elements. */\n"
14359 #: ../src/guestfs-structs.pod:13
14362 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
14363 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
14368 #: ../src/guestfs-structs.pod:16
14369 msgid "guestfs_lvm_pv"
14373 #: ../src/guestfs-structs.pod:18
14376 " struct guestfs_lvm_pv {\n"
14377 " char *pv_name;\n"
14378 " /* The next field is NOT nul-terminated, be careful when printing it: "
14380 " char pv_uuid[32];\n"
14382 " uint64_t pv_size;\n"
14383 " uint64_t dev_size;\n"
14384 " uint64_t pv_free;\n"
14385 " uint64_t pv_used;\n"
14386 " char *pv_attr;\n"
14387 " int64_t pv_pe_count;\n"
14388 " int64_t pv_pe_alloc_count;\n"
14389 " char *pv_tags;\n"
14390 " uint64_t pe_start;\n"
14391 " int64_t pv_mda_count;\n"
14392 " uint64_t pv_mda_free;\n"
14398 #: ../src/guestfs-structs.pod:36
14401 " struct guestfs_lvm_pv_list {\n"
14402 " uint32_t len; /* Number of elements in list. */\n"
14403 " struct guestfs_lvm_pv *val; /* Elements. */\n"
14409 #: ../src/guestfs-structs.pod:41
14412 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
14413 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
14418 #: ../src/guestfs-structs.pod:44
14419 msgid "guestfs_lvm_vg"
14423 #: ../src/guestfs-structs.pod:46
14426 " struct guestfs_lvm_vg {\n"
14427 " char *vg_name;\n"
14428 " /* The next field is NOT nul-terminated, be careful when printing it: "
14430 " char vg_uuid[32];\n"
14432 " char *vg_attr;\n"
14433 " uint64_t vg_size;\n"
14434 " uint64_t vg_free;\n"
14435 " char *vg_sysid;\n"
14436 " uint64_t vg_extent_size;\n"
14437 " int64_t vg_extent_count;\n"
14438 " int64_t vg_free_count;\n"
14439 " int64_t max_lv;\n"
14440 " int64_t max_pv;\n"
14441 " int64_t pv_count;\n"
14442 " int64_t lv_count;\n"
14443 " int64_t snap_count;\n"
14444 " int64_t vg_seqno;\n"
14445 " char *vg_tags;\n"
14446 " int64_t vg_mda_count;\n"
14447 " uint64_t vg_mda_free;\n"
14453 #: ../src/guestfs-structs.pod:69
14456 " struct guestfs_lvm_vg_list {\n"
14457 " uint32_t len; /* Number of elements in list. */\n"
14458 " struct guestfs_lvm_vg *val; /* Elements. */\n"
14464 #: ../src/guestfs-structs.pod:74
14467 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
14468 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
14473 #: ../src/guestfs-structs.pod:77
14474 msgid "guestfs_lvm_lv"
14478 #: ../src/guestfs-structs.pod:79
14481 " struct guestfs_lvm_lv {\n"
14482 " char *lv_name;\n"
14483 " /* The next field is NOT nul-terminated, be careful when printing it: "
14485 " char lv_uuid[32];\n"
14486 " char *lv_attr;\n"
14487 " int64_t lv_major;\n"
14488 " int64_t lv_minor;\n"
14489 " int64_t lv_kernel_major;\n"
14490 " int64_t lv_kernel_minor;\n"
14491 " uint64_t lv_size;\n"
14492 " int64_t seg_count;\n"
14494 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14495 " float snap_percent;\n"
14496 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
14497 " float copy_percent;\n"
14498 " char *move_pv;\n"
14499 " char *lv_tags;\n"
14500 " char *mirror_log;\n"
14501 " char *modules;\n"
14507 #: ../src/guestfs-structs.pod:101
14510 " struct guestfs_lvm_lv_list {\n"
14511 " uint32_t len; /* Number of elements in list. */\n"
14512 " struct guestfs_lvm_lv *val; /* Elements. */\n"
14518 #: ../src/guestfs-structs.pod:106
14521 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
14522 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
14527 #: ../src/guestfs-structs.pod:111
14530 " struct guestfs_stat {\n"
14534 " int64_t nlink;\n"
14539 " int64_t blksize;\n"
14540 " int64_t blocks;\n"
14541 " int64_t atime;\n"
14542 " int64_t mtime;\n"
14543 " int64_t ctime;\n"
14549 #: ../src/guestfs-structs.pod:127
14552 " struct guestfs_stat_list {\n"
14553 " uint32_t len; /* Number of elements in list. */\n"
14554 " struct guestfs_stat *val; /* Elements. */\n"
14560 #: ../src/guestfs-structs.pod:132
14563 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
14564 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
14569 #: ../src/guestfs-structs.pod:137
14572 " struct guestfs_statvfs {\n"
14573 " int64_t bsize;\n"
14574 " int64_t frsize;\n"
14575 " int64_t blocks;\n"
14576 " int64_t bfree;\n"
14577 " int64_t bavail;\n"
14578 " int64_t files;\n"
14579 " int64_t ffree;\n"
14580 " int64_t favail;\n"
14583 " int64_t namemax;\n"
14589 #: ../src/guestfs-structs.pod:151
14592 " struct guestfs_statvfs_list {\n"
14593 " uint32_t len; /* Number of elements in list. */\n"
14594 " struct guestfs_statvfs *val; /* Elements. */\n"
14600 #: ../src/guestfs-structs.pod:156
14603 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
14604 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
14609 #: ../src/guestfs-structs.pod:159
14610 msgid "guestfs_dirent"
14614 #: ../src/guestfs-structs.pod:161
14617 " struct guestfs_dirent {\n"
14626 #: ../src/guestfs-structs.pod:167
14629 " struct guestfs_dirent_list {\n"
14630 " uint32_t len; /* Number of elements in list. */\n"
14631 " struct guestfs_dirent *val; /* Elements. */\n"
14637 #: ../src/guestfs-structs.pod:172
14640 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
14641 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
14646 #: ../src/guestfs-structs.pod:177
14649 " struct guestfs_version {\n"
14650 " int64_t major;\n"
14651 " int64_t minor;\n"
14652 " int64_t release;\n"
14659 #: ../src/guestfs-structs.pod:184
14662 " struct guestfs_version_list {\n"
14663 " uint32_t len; /* Number of elements in list. */\n"
14664 " struct guestfs_version *val; /* Elements. */\n"
14670 #: ../src/guestfs-structs.pod:189
14673 " void guestfs_free_version (struct guestfs_free_version *);\n"
14674 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
14679 #: ../src/guestfs-structs.pod:192
14680 msgid "guestfs_xattr"
14684 #: ../src/guestfs-structs.pod:194
14687 " struct guestfs_xattr {\n"
14688 " char *attrname;\n"
14689 " /* The next two fields describe a byte array. */\n"
14690 " uint32_t attrval_len;\n"
14691 " char *attrval;\n"
14697 #: ../src/guestfs-structs.pod:201
14700 " struct guestfs_xattr_list {\n"
14701 " uint32_t len; /* Number of elements in list. */\n"
14702 " struct guestfs_xattr *val; /* Elements. */\n"
14708 #: ../src/guestfs-structs.pod:206
14711 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
14712 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
14717 #: ../src/guestfs-structs.pod:209
14718 msgid "guestfs_inotify_event"
14722 #: ../src/guestfs-structs.pod:211
14725 " struct guestfs_inotify_event {\n"
14726 " int64_t in_wd;\n"
14727 " uint32_t in_mask;\n"
14728 " uint32_t in_cookie;\n"
14729 " char *in_name;\n"
14735 #: ../src/guestfs-structs.pod:218
14738 " struct guestfs_inotify_event_list {\n"
14739 " uint32_t len; /* Number of elements in list. */\n"
14740 " struct guestfs_inotify_event *val; /* Elements. */\n"
14746 #: ../src/guestfs-structs.pod:223
14749 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
14750 " void guestfs_free_inotify_event_list (struct "
14751 "guestfs_free_inotify_event_list *);\n"
14756 #: ../src/guestfs-structs.pod:226
14757 msgid "guestfs_partition"
14761 #: ../src/guestfs-structs.pod:228
14764 " struct guestfs_partition {\n"
14765 " int32_t part_num;\n"
14766 " uint64_t part_start;\n"
14767 " uint64_t part_end;\n"
14768 " uint64_t part_size;\n"
14774 #: ../src/guestfs-structs.pod:235
14777 " struct guestfs_partition_list {\n"
14778 " uint32_t len; /* Number of elements in list. */\n"
14779 " struct guestfs_partition *val; /* Elements. */\n"
14785 #: ../src/guestfs-structs.pod:240
14788 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
14789 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
14794 #: ../fish/guestfish.pod:5
14795 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
14799 #: ../fish/guestfish.pod:9
14802 " guestfish [--options] [commands]\n"
14807 #: ../fish/guestfish.pod:11
14815 #: ../fish/guestfish.pod:13
14818 " guestfish -a disk.img\n"
14823 #: ../fish/guestfish.pod:15
14826 " guestfish -a disk.img -m dev[:mountpoint]\n"
14831 #: ../fish/guestfish.pod:17
14834 " guestfish -d libvirt-domain\n"
14839 #: ../fish/guestfish.pod:19
14842 " guestfish -a disk.img -i\n"
14847 #: ../fish/guestfish.pod:21
14850 " guestfish -d libvirt-domain -i\n"
14855 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44 ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59 ../tools/virt-rescue.pl:41
14860 #: ../fish/guestfish.pod:25
14862 "Using guestfish in read/write mode on live virtual machines can be "
14863 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
14864 "option to use guestfish safely if the disk image or virtual machine might be "
14869 #: ../fish/guestfish.pod:32
14871 "Guestfish is a shell and command-line tool for examining and modifying "
14872 "virtual machine filesystems. It uses libguestfs and exposes all of the "
14873 "functionality of the guestfs API, see L<guestfs(3)>."
14877 #: ../fish/guestfish.pod:36
14879 "Guestfish gives you structured access to the libguestfs API, from shell "
14880 "scripts or the command line or interactively. If you want to rescue a "
14881 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
14886 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:800 ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58 ../tools/virt-resize.pl:66 ../tools/virt-cat.pl:50 ../tools/virt-tar.pl:45
14891 #: ../fish/guestfish.pod:43
14892 msgid "As an interactive shell"
14896 #: ../fish/guestfish.pod:45
14904 #: ../fish/guestfish.pod:47
14907 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
14908 " editing virtual machine filesystems.\n"
14913 #: ../fish/guestfish.pod:50
14916 " Type: 'help' for a list of commands\n"
14917 " 'man' to read the manual\n"
14918 " 'quit' to quit the shell\n"
14923 #: ../fish/guestfish.pod:54
14926 " ><fs> add-ro disk.img\n"
14928 " ><fs> list-filesystems\n"
14929 " /dev/sda1: ext4\n"
14930 " /dev/vg_guest/lv_root: ext4\n"
14931 " /dev/vg_guest/lv_swap: swap\n"
14932 " ><fs> mount /dev/vg_guest/lv_root /\n"
14933 " ><fs> cat /etc/fstab\n"
14935 " # Created by anaconda\n"
14942 #: ../fish/guestfish.pod:67
14943 msgid "From shell scripts"
14947 #: ../fish/guestfish.pod:69
14948 msgid "Create a new C</etc/motd> file in a guest or disk image:"
14952 #: ../fish/guestfish.pod:71
14955 " guestfish <<_EOF_\n"
14958 " mount /dev/vg_guest/lv_root /\n"
14959 " write /etc/motd \"Welcome, new users\"\n"
14965 #: ../fish/guestfish.pod:78
14966 msgid "List the LVM logical volumes in a disk image:"
14970 #: ../fish/guestfish.pod:80
14973 " guestfish -a disk.img --ro <<_EOF_\n"
14981 #: ../fish/guestfish.pod:85
14982 msgid "List all the filesystems in a disk image:"
14986 #: ../fish/guestfish.pod:87
14989 " guestfish -a disk.img --ro <<_EOF_\n"
14991 " list-filesystems\n"
14997 #: ../fish/guestfish.pod:92
14998 msgid "On one command line"
15002 #: ../fish/guestfish.pod:94
15003 msgid "Update C</etc/resolv.conf> in a guest:"
15007 #: ../fish/guestfish.pod:96
15011 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
15012 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
15017 #: ../fish/guestfish.pod:100
15018 msgid "Edit C</boot/grub/grub.conf> interactively:"
15022 #: ../fish/guestfish.pod:102
15025 " guestfish --add disk.img \\\n"
15026 " --mount /dev/vg_guest/lv_root \\\n"
15027 " --mount /dev/sda1:/boot \\\n"
15028 " edit /boot/grub/grub.conf\n"
15033 #: ../fish/guestfish.pod:107
15034 msgid "Mount disks automatically"
15038 #: ../fish/guestfish.pod:109
15040 "Use the I<-i> option to automatically mount the disks from a virtual "
15045 #: ../fish/guestfish.pod:112
15048 " guestfish --ro -a disk.img -i cat /etc/group\n"
15053 #: ../fish/guestfish.pod:114
15056 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
15061 #: ../fish/guestfish.pod:116
15062 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
15066 #: ../fish/guestfish.pod:118
15069 " guestfish -a disk.img -i edit /boot/grub/grub.conf\n"
15074 #: ../fish/guestfish.pod:120
15075 msgid "As a script interpreter"
15079 #: ../fish/guestfish.pod:122
15080 msgid "Create a 100MB disk containing an ext2-formatted partition:"
15084 #: ../fish/guestfish.pod:124
15087 " #!/usr/bin/guestfish -f\n"
15088 " sparse test1.img 100M\n"
15090 " part-disk /dev/sda mbr\n"
15091 " mkfs ext2 /dev/sda1\n"
15096 #: ../fish/guestfish.pod:130
15097 msgid "Start with a prepared disk"
15101 #: ../fish/guestfish.pod:132
15103 "An alternate way to create a 100MB disk called C<test1.img> containing a "
15104 "single ext2-formatted partition:"
15108 #: ../fish/guestfish.pod:135
15111 " guestfish -N fs\n"
15116 #: ../fish/guestfish.pod:137
15117 msgid "To list what is available do:"
15121 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:791
15124 " guestfish -N help | less\n"
15129 #: ../fish/guestfish.pod:141
15130 msgid "Remote control"
15134 #: ../fish/guestfish.pod:143
15137 " eval `guestfish --listen`\n"
15138 " guestfish --remote add-ro disk.img\n"
15139 " guestfish --remote run\n"
15140 " guestfish --remote lvs\n"
15145 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:73 ../inspector/virt-inspector.pl:68 ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:171 ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78 ../tools/virt-resize.pl:257 ../tools/virt-list-filesystems.pl:50 ../tools/virt-cat.pl:79 ../tools/virt-tar.pl:98 ../tools/virt-rescue.pl:103 ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:51
15150 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:124 ../inspector/virt-inspector.pl:76 ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:179 ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86 ../tools/virt-resize.pl:265 ../tools/virt-list-filesystems.pl:58 ../tools/virt-cat.pl:87 ../tools/virt-tar.pl:106 ../tools/virt-rescue.pl:111 ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:59
15155 #: ../fish/guestfish.pod:154
15156 msgid "Displays general help on options."
15160 #: ../fish/guestfish.pod:156
15161 msgid "B<-h> | B<--cmd-help>"
15165 #: ../fish/guestfish.pod:158
15166 msgid "Lists all available guestfish commands."
15170 #: ../fish/guestfish.pod:160
15171 msgid "B<-h cmd> | B<--cmd-help cmd>"
15175 #: ../fish/guestfish.pod:162
15176 msgid "Displays detailed help on a single command C<cmd>."
15180 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
15181 msgid "B<-a image> | B<--add image>"
15185 #: ../fish/guestfish.pod:166
15186 msgid "Add a block device or virtual machine image to the shell."
15190 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
15192 "The format of the disk image is auto-detected. To override this and force a "
15193 "particular format use the I<--format=..> option."
15197 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
15198 msgid "B<-c URI> | B<--connect URI>"
15202 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
15204 "When used in conjunction with the I<-d> option, this specifies the libvirt "
15205 "URI to use. The default is to use the default libvirt connection."
15209 #: ../fish/guestfish.pod:177 ../fuse/guestmount.pod:90
15210 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
15214 #: ../fish/guestfish.pod:179 ../fuse/guestmount.pod:92
15216 "Add disks from the named libvirt domain. If the I<--ro> option is also "
15217 "used, then any libvirt domain can be used. However in write mode, only "
15218 "libvirt domains which are shut down can be named here."
15222 #: ../fish/guestfish.pod:183
15223 msgid "B<-D> | B<--no-dest-paths>"
15227 #: ../fish/guestfish.pod:185
15229 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
15230 "to hit the tab key to complete paths on the guest filesystem, but this "
15231 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
15232 "allow this feature to be disabled."
15236 #: ../fish/guestfish.pod:190
15237 msgid "B<--echo-keys>"
15241 #: ../fish/guestfish.pod:192
15243 "When prompting for keys and passphrases, guestfish normally turns echoing "
15244 "off so you cannot see what you are typing. If you are not worried about "
15245 "Tempest attacks and there is no one else in the room you can specify this "
15246 "flag to see what you are typing."
15250 #: ../fish/guestfish.pod:197
15251 msgid "B<-f file> | B<--file file>"
15255 #: ../fish/guestfish.pod:199
15256 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
15260 #: ../fish/guestfish.pod:202
15263 " #!/usr/bin/guestfish -f\n"
15268 #: ../fish/guestfish.pod:204 ../fuse/guestmount.pod:108
15269 msgid "B<--format=raw|qcow2|..> | B<--format>"
15273 #: ../fish/guestfish.pod:206 ../fuse/guestmount.pod:110
15275 "The default for the I<-a> option is to auto-detect the format of the disk "
15276 "image. Using this forces the disk format for I<-a> options which follow on "
15277 "the command line. Using I<--format> with no argument switches back to "
15278 "auto-detection for subsequent I<-a> options."
15282 #: ../fish/guestfish.pod:211 ../fish/guestfish.pod:504
15283 msgid "For example:"
15287 #: ../fish/guestfish.pod:213
15290 " guestfish --format=raw -a disk.img\n"
15295 #: ../fish/guestfish.pod:215
15296 msgid "forces raw format (no auto-detection) for C<disk.img>."
15300 #: ../fish/guestfish.pod:217
15303 " guestfish --format=raw -a disk.img --format -a another.img\n"
15308 #: ../fish/guestfish.pod:219
15310 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
15311 "auto-detection for C<another.img>."
15315 #: ../fish/guestfish.pod:222
15317 "If you have untrusted raw-format guest disk images, you should use this "
15318 "option to specify the disk format. This avoids a possible security problem "
15319 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
15323 #: ../fish/guestfish.pod:227 ../fuse/guestmount.pod:128
15324 msgid "B<-i> | B<--inspector>"
15328 #: ../fish/guestfish.pod:229 ../fuse/guestmount.pod:130
15330 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
15331 "system and mount filesystems as they would be mounted on the real virtual "
15336 #: ../fish/guestfish.pod:233
15337 msgid "Typical usage is either:"
15341 #: ../fish/guestfish.pod:235
15344 " guestfish -d myguest -i\n"
15349 #: ../fish/guestfish.pod:237
15350 msgid "(for an inactive libvirt domain called I<myguest>), or:"
15354 #: ../fish/guestfish.pod:239
15357 " guestfish --ro -d myguest -i\n"
15362 #: ../fish/guestfish.pod:241
15363 msgid "(for active domains, readonly), or specify the block device directly:"
15367 #: ../fish/guestfish.pod:243
15370 " guestfish -a /dev/Guests/MyGuest -i\n"
15375 #: ../fish/guestfish.pod:245
15377 "Note that the command line syntax changed slightly over older versions of "
15378 "guestfish. You can still use the old syntax:"
15382 #: ../fish/guestfish.pod:248
15385 " guestfish [--ro] -i disk.img\n"
15390 #: ../fish/guestfish.pod:250
15393 " guestfish [--ro] -i libvirt-domain\n"
15398 #: ../fish/guestfish.pod:252
15399 msgid "B<--keys-from-stdin>"
15403 #: ../fish/guestfish.pod:254
15405 "Read key or passphrase parameters from stdin. The default is to try to read "
15406 "passphrases from the user by opening C</dev/tty>."
15410 #: ../fish/guestfish.pod:257
15411 msgid "B<--listen>"
15415 #: ../fish/guestfish.pod:259
15417 "Fork into the background and listen for remote commands. See section "
15418 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
15422 #: ../fish/guestfish.pod:262
15423 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
15427 #: ../fish/guestfish.pod:264
15428 msgid "Mount the named partition or logical volume on the given mountpoint."
15432 #: ../fish/guestfish.pod:266
15433 msgid "If the mountpoint is omitted, it defaults to C</>."
15437 #: ../fish/guestfish.pod:268
15438 msgid "You have to mount something on C</> before most commands will work."
15442 #: ../fish/guestfish.pod:270
15444 "If any I<-m> or I<--mount> options are given, the guest is automatically "
15449 #: ../fish/guestfish.pod:273
15451 "If you don't know what filesystems a disk image contains, you can either run "
15452 "guestfish without this option, then list the partitions and LVs available "
15453 "(see L</list-partitions> and L</lvs> commands), or you can use the "
15454 "L<virt-list-filesystems(1)> program."
15458 #: ../fish/guestfish.pod:278 ../fuse/guestmount.pod:142
15459 msgid "B<-n> | B<--no-sync>"
15463 #: ../fish/guestfish.pod:280
15465 "Disable autosync. This is enabled by default. See the discussion of "
15466 "autosync in the L<guestfs(3)> manpage."
15470 #: ../fish/guestfish.pod:283
15471 msgid "B<-N type> | B<--new type> | B<-N help>"
15475 #: ../fish/guestfish.pod:285
15477 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
15478 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
15479 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
15484 #: ../fish/guestfish.pod:290
15485 msgid "B<--progress-bars>"
15489 #: ../fish/guestfish.pod:292
15490 msgid "Enable progress bars, even when guestfish is used non-interactively."
15494 #: ../fish/guestfish.pod:294
15496 "Progress bars are enabled by default when guestfish is used as an "
15497 "interactive shell."
15501 #: ../fish/guestfish.pod:297
15502 msgid "B<--no-progress-bars>"
15506 #: ../fish/guestfish.pod:299
15507 msgid "Disable progress bars."
15511 #: ../fish/guestfish.pod:301
15512 msgid "B<--remote[=pid]>"
15516 #: ../fish/guestfish.pod:303
15518 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
15519 "CONTROL GUESTFISH OVER A SOCKET> below."
15523 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
15524 msgid "B<-r> | B<--ro>"
15528 #: ../fish/guestfish.pod:308
15530 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
15531 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
15535 #: ../fish/guestfish.pod:311 ../tools/virt-rescue.pl:187
15537 "The option must always be used if the disk image or virtual machine might be "
15538 "running, and is generally recommended in cases where you don't need write "
15539 "access to the disk."
15543 #: ../fish/guestfish.pod:315
15545 "Note that prepared disk images created with I<-N> are not affected by the "
15550 #: ../fish/guestfish.pod:318 ../fuse/guestmount.pod:194 ../tools/virt-rescue.pl:195
15551 msgid "B<--selinux>"
15555 #: ../fish/guestfish.pod:320
15556 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
15560 #: ../fish/guestfish.pod:322 ../fuse/guestmount.pod:198
15561 msgid "B<-v> | B<--verbose>"
15565 #: ../fish/guestfish.pod:324
15567 "Enable very verbose messages. This is particularly useful if you find a "
15572 #: ../fish/guestfish.pod:327 ../fuse/guestmount.pod:202
15573 msgid "B<-V> | B<--version>"
15577 #: ../fish/guestfish.pod:329
15578 msgid "Display the guestfish / libguestfs version number and exit."
15582 #: ../fish/guestfish.pod:331
15587 #: ../fish/guestfish.pod:333
15588 msgid "Echo each command before executing it."
15592 #: ../fish/guestfish.pod:337
15593 msgid "COMMANDS ON COMMAND LINE"
15597 #: ../fish/guestfish.pod:339
15598 msgid "Any additional (non-option) arguments are treated as commands to execute."
15602 #: ../fish/guestfish.pod:342
15604 "Commands to execute should be separated by a colon (C<:>), where the colon "
15605 "is a separate parameter. Thus:"
15609 #: ../fish/guestfish.pod:345
15612 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
15617 #: ../fish/guestfish.pod:347
15619 "If there are no additional arguments, then we enter a shell, either an "
15620 "interactive shell with a prompt (if the input is a terminal) or a "
15621 "non-interactive shell."
15625 #: ../fish/guestfish.pod:351
15627 "In either command line mode or non-interactive shell, the first command that "
15628 "gives an error causes the whole shell to exit. In interactive mode (with a "
15629 "prompt) if a command fails, you can continue to enter commands."
15633 #: ../fish/guestfish.pod:356
15634 msgid "USING launch (OR run)"
15638 #: ../fish/guestfish.pod:358
15640 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
15641 "then launch it, then mount any disks you need, and finally issue "
15642 "actions/commands. So the general order of the day is:"
15646 #: ../fish/guestfish.pod:366
15647 msgid "add or -a/--add"
15651 #: ../fish/guestfish.pod:370
15652 msgid "launch (aka run)"
15656 #: ../fish/guestfish.pod:374
15657 msgid "mount or -m/--mount"
15661 #: ../fish/guestfish.pod:378
15662 msgid "any other commands"
15666 #: ../fish/guestfish.pod:382
15668 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
15669 "guest before mounting or performing any other commands."
15673 #: ../fish/guestfish.pod:385
15675 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
15676 "I<--new> options were given then C<run> is done automatically, simply "
15677 "because guestfish can't perform the action you asked for without doing this."
15681 #: ../fish/guestfish.pod:390
15686 #: ../fish/guestfish.pod:392
15688 "You can quote ordinary parameters using either single or double quotes. For "
15693 #: ../fish/guestfish.pod:395
15696 " add \"file with a space.img\"\n"
15701 #: ../fish/guestfish.pod:397
15704 " rm '/file name'\n"
15709 #: ../fish/guestfish.pod:399
15717 #: ../fish/guestfish.pod:401
15719 "A few commands require a list of strings to be passed. For these, use a "
15720 "whitespace-separated list, enclosed in quotes. Strings containing "
15721 "whitespace to be passed through must be enclosed in single quotes. A "
15722 "literal single quote must be escaped with a backslash."
15726 #: ../fish/guestfish.pod:406
15729 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
15730 " command \"/bin/echo 'foo bar'\"\n"
15731 " command \"/bin/echo \\'foo\\'\"\n"
15736 #: ../fish/guestfish.pod:410
15737 msgid "OPTIONAL ARGUMENTS"
15741 #: ../fish/guestfish.pod:412
15743 "Some commands take optional arguments. These arguments appear in this "
15744 "documentation as C<[argname:..]>. You can use them as in these examples:"
15748 #: ../fish/guestfish.pod:416
15751 " add-drive-opts filename\n"
15756 #: ../fish/guestfish.pod:418
15759 " add-drive-opts filename readonly:true\n"
15764 #: ../fish/guestfish.pod:420
15767 " add-drive-opts filename format:qcow2 readonly:false\n"
15772 #: ../fish/guestfish.pod:422
15774 "Each optional argument can appear at most once. All optional arguments must "
15775 "appear after the required ones."
15779 #: ../fish/guestfish.pod:425
15784 #: ../fish/guestfish.pod:427
15785 msgid "This section applies to all commands which can take integers as parameters."
15789 #: ../fish/guestfish.pod:430
15790 msgid "SIZE SUFFIX"
15794 #: ../fish/guestfish.pod:432
15796 "When the command takes a parameter measured in bytes, you can use one of the "
15797 "following suffixes to specify kilobytes, megabytes and larger sizes:"
15801 #: ../fish/guestfish.pod:438
15802 msgid "B<k> or B<K> or B<KiB>"
15806 #: ../fish/guestfish.pod:440
15807 msgid "The size in kilobytes (multiplied by 1024)."
15811 #: ../fish/guestfish.pod:442
15816 #: ../fish/guestfish.pod:444
15817 msgid "The size in SI 1000 byte units."
15821 #: ../fish/guestfish.pod:446
15822 msgid "B<M> or B<MiB>"
15826 #: ../fish/guestfish.pod:448
15827 msgid "The size in megabytes (multiplied by 1048576)."
15831 #: ../fish/guestfish.pod:450
15836 #: ../fish/guestfish.pod:452
15837 msgid "The size in SI 1000000 byte units."
15841 #: ../fish/guestfish.pod:454
15842 msgid "B<G> or B<GiB>"
15846 #: ../fish/guestfish.pod:456
15847 msgid "The size in gigabytes (multiplied by 2**30)."
15851 #: ../fish/guestfish.pod:458
15856 #: ../fish/guestfish.pod:460
15857 msgid "The size in SI 10**9 byte units."
15861 #: ../fish/guestfish.pod:462
15862 msgid "B<T> or B<TiB>"
15866 #: ../fish/guestfish.pod:464
15867 msgid "The size in terabytes (multiplied by 2**40)."
15871 #: ../fish/guestfish.pod:466
15876 #: ../fish/guestfish.pod:468
15877 msgid "The size in SI 10**12 byte units."
15881 #: ../fish/guestfish.pod:470
15882 msgid "B<P> or B<PiB>"
15886 #: ../fish/guestfish.pod:472
15887 msgid "The size in petabytes (multiplied by 2**50)."
15891 #: ../fish/guestfish.pod:474
15896 #: ../fish/guestfish.pod:476
15897 msgid "The size in SI 10**15 byte units."
15901 #: ../fish/guestfish.pod:478
15902 msgid "B<E> or B<EiB>"
15906 #: ../fish/guestfish.pod:480
15907 msgid "The size in exabytes (multiplied by 2**60)."
15911 #: ../fish/guestfish.pod:482
15916 #: ../fish/guestfish.pod:484
15917 msgid "The size in SI 10**18 byte units."
15921 #: ../fish/guestfish.pod:486
15922 msgid "B<Z> or B<ZiB>"
15926 #: ../fish/guestfish.pod:488
15927 msgid "The size in zettabytes (multiplied by 2**70)."
15931 #: ../fish/guestfish.pod:490
15936 #: ../fish/guestfish.pod:492
15937 msgid "The size in SI 10**21 byte units."
15941 #: ../fish/guestfish.pod:494
15942 msgid "B<Y> or B<YiB>"
15946 #: ../fish/guestfish.pod:496
15947 msgid "The size in yottabytes (multiplied by 2**80)."
15951 #: ../fish/guestfish.pod:498
15956 #: ../fish/guestfish.pod:500
15957 msgid "The size in SI 10**24 byte units."
15961 #: ../fish/guestfish.pod:506
15964 " truncate-size /file 1G\n"
15969 #: ../fish/guestfish.pod:508
15970 msgid "would truncate the file to 1 gigabyte."
15974 #: ../fish/guestfish.pod:510
15976 "Be careful because a few commands take sizes in kilobytes or megabytes "
15977 "(eg. the parameter to L</memsize> is specified in megabytes already). "
15978 "Adding a suffix will probably not do what you expect."
15982 #: ../fish/guestfish.pod:514
15983 msgid "OCTAL AND HEXADECIMAL NUMBERS"
15987 #: ../fish/guestfish.pod:516
15989 "For specifying the radix (base) use the C convention: C<0> to prefix an "
15990 "octal number or C<0x> to prefix a hexadecimal number. For example:"
15994 #: ../fish/guestfish.pod:519
15997 " 1234 decimal number 1234\n"
15998 " 02322 octal number, equivalent to decimal 1234\n"
15999 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
16004 #: ../fish/guestfish.pod:523
16006 "When using the C<chmod> command, you almost always want to specify an octal "
16007 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
16008 "L<chmod(1)> program):"
16012 #: ../fish/guestfish.pod:527
16015 " chmod 0777 /public # OK\n"
16016 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
16021 #: ../fish/guestfish.pod:530
16023 "Commands that return numbers usually print them in decimal, but some "
16024 "commands print numbers in other radices (eg. C<umask> prints the mode in "
16025 "octal, preceeded by C<0>)."
16029 #: ../fish/guestfish.pod:534
16030 msgid "WILDCARDS AND GLOBBING"
16034 #: ../fish/guestfish.pod:536
16036 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
16037 "(globbing) by default. So for example the following will not do what you "
16042 #: ../fish/guestfish.pod:540
16050 #: ../fish/guestfish.pod:542
16052 "Assuming you don't have a directory called literally C</home/*> then the "
16053 "above command will return an error."
16057 #: ../fish/guestfish.pod:545
16058 msgid "To perform wildcard expansion, use the C<glob> command."
16062 #: ../fish/guestfish.pod:547
16065 " glob rm-rf /home/*\n"
16070 #: ../fish/guestfish.pod:549
16072 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
16073 "many times), equivalent to:"
16077 #: ../fish/guestfish.pod:552
16080 " rm-rf /home/jim\n"
16081 " rm-rf /home/joe\n"
16082 " rm-rf /home/mary\n"
16087 #: ../fish/guestfish.pod:556
16088 msgid "C<glob> only works on simple guest paths and not on device names."
16092 #: ../fish/guestfish.pod:558
16094 "If you have several parameters, each containing a wildcard, then glob will "
16095 "perform a Cartesian product."
16099 #: ../fish/guestfish.pod:561
16104 #: ../fish/guestfish.pod:563
16106 "Any line which starts with a I<#> character is treated as a comment and "
16107 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
16108 "a command. For example:"
16112 #: ../fish/guestfish.pod:567
16115 " # this is a comment\n"
16116 " # this is a comment\n"
16117 " foo # NOT a comment\n"
16122 #: ../fish/guestfish.pod:571
16123 msgid "Blank lines are also ignored."
16127 #: ../fish/guestfish.pod:573
16128 msgid "RUNNING COMMANDS LOCALLY"
16132 #: ../fish/guestfish.pod:575
16134 "Any line which starts with a I<!> character is treated as a command sent to "
16135 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
16139 #: ../fish/guestfish.pod:579
16143 " tgz-out /remote local/remote-data.tar.gz\n"
16148 #: ../fish/guestfish.pod:582
16150 "will create a directory C<local> on the host, and then export the contents "
16151 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
16152 "(See C<tgz-out>)."
16156 #: ../fish/guestfish.pod:586
16158 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
16159 "effect, due to the way that subprocesses work in Unix."
16163 #: ../fish/guestfish.pod:589
16168 #: ../fish/guestfish.pod:591
16170 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
16171 "command (a guestfish command) to the second command (any host command). For "
16176 #: ../fish/guestfish.pod:595
16179 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
16184 #: ../fish/guestfish.pod:597
16186 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
16187 "program). The above command would list all accounts in the guest filesystem "
16188 "which have UID 0, ie. root accounts including backdoors. Other examples:"
16192 #: ../fish/guestfish.pod:602
16195 " hexdump /bin/ls | head\n"
16196 " list-devices | tail -1\n"
16197 " tgz-out / - | tar ztf -\n"
16202 #: ../fish/guestfish.pod:606
16204 "The space before the pipe symbol is required, any space after the pipe "
16205 "symbol is optional. Everything after the pipe symbol is just passed "
16206 "straight to the host shell, so it can contain redirections, globs and "
16207 "anything else that makes sense on the host side."
16211 #: ../fish/guestfish.pod:611
16213 "To use a literal argument which begins with a pipe symbol, you have to quote "
16218 #: ../fish/guestfish.pod:614
16226 #: ../fish/guestfish.pod:616
16227 msgid "HOME DIRECTORIES"
16231 #: ../fish/guestfish.pod:618
16233 "If a parameter starts with the character C<~> then the tilde may be expanded "
16234 "as a home directory path (either C<~> for the current user's home directory, "
16235 "or C<~user> for another user)."
16239 #: ../fish/guestfish.pod:622
16241 "Note that home directory expansion happens for users known I<on the host>, "
16242 "not in the guest filesystem."
16246 #: ../fish/guestfish.pod:625
16248 "To use a literal argument which begins with a tilde, you have to quote it, "
16253 #: ../fish/guestfish.pod:628
16261 #: ../fish/guestfish.pod:632
16263 "Libguestfs has some support for Linux guests encrypted according to the "
16264 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
16265 "disk encryption systems used by modern Linux guests. Currently only "
16266 "LVM-on-LUKS is supported."
16270 #: ../fish/guestfish.pod:637
16271 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
16275 #: ../fish/guestfish.pod:639
16278 " ><fs> vfs-type /dev/sda2\n"
16284 #: ../fish/guestfish.pod:642
16286 "Then open those devices using L</luks-open>. This creates a device-mapper "
16287 "device called C</dev/mapper/luksdev>."
16291 #: ../fish/guestfish.pod:645
16294 " ><fs> luks-open /dev/sda2 luksdev\n"
16295 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
16300 #: ../fish/guestfish.pod:648
16302 "Finally you have to tell LVM to scan for volume groups on the newly created "
16307 #: ../fish/guestfish.pod:651
16311 " vg-activate-all true\n"
16316 #: ../fish/guestfish.pod:654
16317 msgid "The logical volume(s) can now be mounted in the usual way."
16321 #: ../fish/guestfish.pod:656
16323 "Before closing a LUKS device you must unmount any logical volumes on it and "
16324 "deactivate the volume groups by calling C<vg-activate false VG> on each "
16325 "one. Then you can close the mapper device:"
16329 #: ../fish/guestfish.pod:660
16332 " vg-activate false /dev/VG\n"
16333 " luks-close /dev/mapper/luksdev\n"
16338 #: ../fish/guestfish.pod:663
16339 msgid "WINDOWS PATHS"
16343 #: ../fish/guestfish.pod:665
16345 "If a path is prefixed with C<win:> then you can use Windows-style paths "
16346 "(with some limitations). The following commands are equivalent:"
16350 #: ../fish/guestfish.pod:668
16353 " file /WINDOWS/system32/config/system.LOG\n"
16358 #: ../fish/guestfish.pod:670
16361 " file win:/windows/system32/config/system.log\n"
16366 #: ../fish/guestfish.pod:672
16369 " file win:\\windows\\system32\\config\\system.log\n"
16374 #: ../fish/guestfish.pod:674
16377 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
16382 #: ../fish/guestfish.pod:676
16384 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
16385 "handles case insensitivity like Windows would. This only works in argument "
16386 "positions that expect a path."
16390 #: ../fish/guestfish.pod:680
16391 msgid "UPLOADING AND DOWNLOADING FILES"
16395 #: ../fish/guestfish.pod:682
16397 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
16398 "others which upload from or download to a local file, you can use the "
16399 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
16403 #: ../fish/guestfish.pod:686
16411 #: ../fish/guestfish.pod:688
16412 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
16416 #: ../fish/guestfish.pod:691
16419 " tar-out /etc - | tar tf -\n"
16424 #: ../fish/guestfish.pod:693
16426 "writes the tarball to stdout and then pipes that into the external \"tar\" "
16427 "command (see L</PIPES>)."
16431 #: ../fish/guestfish.pod:696
16433 "When using C<-> to read from stdin, the input is read up to the end of "
16434 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
16435 "some arbitrary end marker:"
16439 #: ../fish/guestfish.pod:700
16442 " upload -<<END /foo\n"
16451 #: ../fish/guestfish.pod:706
16453 "Any string of characters can be used instead of C<END>. The end marker must "
16454 "appear on a line of its own, without any preceeding or following characters "
16455 "(not even spaces)."
16459 #: ../fish/guestfish.pod:710
16461 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
16462 "upload local files (so-called \"FileIn\" parameters in the generator)."
16466 #: ../fish/guestfish.pod:713
16467 msgid "EXIT ON ERROR BEHAVIOUR"
16471 #: ../fish/guestfish.pod:715
16473 "By default, guestfish will ignore any errors when in interactive mode "
16474 "(ie. taking commands from a human over a tty), and will exit on the first "
16475 "error in non-interactive mode (scripts, commands given on the command line)."
16479 #: ../fish/guestfish.pod:720
16481 "If you prefix a command with a I<-> character, then that command will not "
16482 "cause guestfish to exit, even if that (one) command returns an error."
16486 #: ../fish/guestfish.pod:724
16487 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
16491 #: ../fish/guestfish.pod:726
16493 "Guestfish can be remote-controlled over a socket. This is useful "
16494 "particularly in shell scripts where you want to make several different "
16495 "changes to a filesystem, but you don't want the overhead of starting up a "
16496 "guestfish process each time."
16500 #: ../fish/guestfish.pod:731
16501 msgid "Start a guestfish server process using:"
16505 #: ../fish/guestfish.pod:733
16508 " eval `guestfish --listen`\n"
16513 #: ../fish/guestfish.pod:735
16514 msgid "and then send it commands by doing:"
16518 #: ../fish/guestfish.pod:737
16521 " guestfish --remote cmd [...]\n"
16526 #: ../fish/guestfish.pod:739
16527 msgid "To cause the server to exit, send it the exit command:"
16531 #: ../fish/guestfish.pod:741
16534 " guestfish --remote exit\n"
16539 #: ../fish/guestfish.pod:743
16541 "Note that the server will normally exit if there is an error in a command. "
16542 "You can change this in the usual way. See section L</EXIT ON ERROR "
16547 #: ../fish/guestfish.pod:747
16548 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
16552 #: ../fish/guestfish.pod:749
16554 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
16555 "is how the I<--remote> option knows where to send the commands. You can "
16556 "have several guestfish listener processes running using:"
16560 #: ../fish/guestfish.pod:753
16563 " eval `guestfish --listen`\n"
16564 " pid1=$GUESTFISH_PID\n"
16565 " eval `guestfish --listen`\n"
16566 " pid2=$GUESTFISH_PID\n"
16568 " guestfish --remote=$pid1 cmd\n"
16569 " guestfish --remote=$pid2 cmd\n"
16574 #: ../fish/guestfish.pod:761
16575 msgid "REMOTE CONTROL DETAILS"
16579 #: ../fish/guestfish.pod:763
16581 "Remote control happens over a Unix domain socket called "
16582 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
16583 "of the process, and C<$PID> is the process ID of the server."
16587 #: ../fish/guestfish.pod:767
16588 msgid "Guestfish client and server versions must match exactly."
16592 #: ../fish/guestfish.pod:769
16593 msgid "PREPARED DISK IMAGES"
16597 #: ../fish/guestfish.pod:771
16599 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
16600 "preformatted disk images that guestfish can make for you to save typing. "
16601 "This is particularly useful for testing purposes. This option is used "
16602 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
16603 "can be mixed with I<-a>)."
16607 #: ../fish/guestfish.pod:777
16609 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
16610 "the second and so on. Existing files in the current directory are "
16615 #: ../fish/guestfish.pod:781
16617 "The type briefly describes how the disk should be sized, partitioned, how "
16618 "filesystem(s) should be created, and how content should be added. "
16619 "Optionally the type can be followed by extra parameters, separated by C<:> "
16620 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
16621 "sparsely-allocated disk, containing a single partition, with the partition "
16622 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
16623 "on a 1GB disk instead."
16627 #: ../fish/guestfish.pod:789
16628 msgid "To list the available types and any extra parameters they take, run:"
16632 #: ../fish/guestfish.pod:793
16634 "Note that the prepared filesystem is not mounted. You would usually have to "
16635 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
16639 #: ../fish/guestfish.pod:797
16641 "If any I<-N> or I<--new> options are given, the guest is automatically "
16646 #: ../fish/guestfish.pod:802
16647 msgid "Create a 100MB disk with an ext4-formatted partition:"
16651 #: ../fish/guestfish.pod:804
16654 " guestfish -N fs:ext4\n"
16659 #: ../fish/guestfish.pod:806
16660 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
16664 #: ../fish/guestfish.pod:808
16667 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
16672 #: ../fish/guestfish.pod:810
16673 msgid "Create a blank 200MB disk:"
16677 #: ../fish/guestfish.pod:812
16680 " guestfish -N disk:200M\n"
16685 #: ../fish/guestfish.pod:814
16686 msgid "PROGRESS BARS"
16690 #: ../fish/guestfish.pod:816
16692 "Some (not all) long-running commands send progress notification messages as "
16693 "they are running. Guestfish turns these messages into progress bars."
16697 #: ../fish/guestfish.pod:820
16699 "When a command that supports progress bars takes longer than two seconds to "
16700 "run, and if progress bars are enabled, then you will see one appearing below "
16705 #: ../fish/guestfish.pod:824
16708 " ><fs> copy-size /large-file /another-file 2048M\n"
16709 " / 10% [#####-----------------------------------------] 00:30\n"
16714 #: ../fish/guestfish.pod:827
16716 "The spinner on the left hand side moves round once for every progress "
16717 "notification received from the backend. This is a (reasonably) golden "
16718 "assurance that the command is \"doing something\" even if the progress bar "
16719 "is not moving, because the command is able to send the progress "
16720 "notifications. When the bar reaches 100% and the command finishes, the "
16721 "spinner disappears."
16725 #: ../fish/guestfish.pod:834
16727 "Progress bars are enabled by default when guestfish is used interactively. "
16728 "You can enable them even for non-interactive modes using I<--progress-bars>, "
16729 "and you can disable them completely using I<--no-progress-bars>."
16733 #: ../fish/guestfish.pod:839
16734 msgid "GUESTFISH COMMANDS"
16738 #: ../fish/guestfish.pod:841
16740 "The commands in this section are guestfish convenience commands, in other "
16741 "words, they are not part of the L<guestfs(3)> API."
16745 #: ../fish/guestfish.pod:844
16750 #: ../fish/guestfish.pod:846
16759 #: ../fish/guestfish.pod:849
16761 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
16762 "this displays detailed help for a command."
16766 #: ../fish/guestfish.pod:852
16767 msgid "quit | exit"
16771 #: ../fish/guestfish.pod:854
16772 msgid "This exits guestfish. You can also use C<^D> key."
16776 #: ../fish/guestfish.pod:856
16777 msgid "@FISH_COMMANDS@"
16781 #: ../fish/guestfish.pod:858
16786 #: ../fish/guestfish.pod:862 ../test-tool/libguestfs-test-tool.pod:83
16791 #: ../fish/guestfish.pod:864
16793 "guestfish returns 0 if the commands completed without error, or 1 if there "
16798 #: ../fish/guestfish.pod:871
16803 #: ../fish/guestfish.pod:873
16805 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
16810 #: ../fish/guestfish.pod:876
16811 msgid "GUESTFISH_PID"
16815 #: ../fish/guestfish.pod:878
16817 "Used with the I<--remote> option to specify the remote guestfish process to "
16818 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
16822 #: ../fish/guestfish.pod:882
16827 #: ../fish/guestfish.pod:884
16829 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
16830 "not specified, the external L<hexedit(1)> program is used."
16834 #: ../fish/guestfish.pod:888
16839 #: ../fish/guestfish.pod:890
16841 "If compiled with GNU readline support, various files in the home directory "
16842 "can be used. See L</FILES>."
16846 #: ../fish/guestfish.pod:899
16848 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
16849 "effect as using the B<-v> option."
16853 #: ../fish/guestfish.pod:911
16855 "Set the path that guestfish uses to search for kernel and initrd.img. See "
16856 "the discussion of paths in L<guestfs(3)>."
16860 #: ../fish/guestfish.pod:922
16861 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
16865 #: ../fish/guestfish.pod:924
16870 #: ../fish/guestfish.pod:926
16872 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
16877 #: ../fish/guestfish.pod:941 ../test-tool/libguestfs-test-tool.pod:88
16882 #: ../fish/guestfish.pod:945
16883 msgid "$HOME/.guestfish"
16887 #: ../fish/guestfish.pod:947
16889 "If compiled with GNU readline support, then the command history is saved in "
16894 #: ../fish/guestfish.pod:950
16895 msgid "$HOME/.inputrc"
16899 #: ../fish/guestfish.pod:952
16900 msgid "/etc/inputrc"
16904 #: ../fish/guestfish.pod:954
16906 "If compiled with GNU readline support, then these files can be used to "
16907 "configure readline. For further information, please see "
16908 "L<readline(3)/INITIALIZATION FILE>."
16912 #: ../fish/guestfish.pod:958
16913 msgid "To write rules which only apply to guestfish, use:"
16917 #: ../fish/guestfish.pod:960
16927 #: ../fish/guestfish.pod:964
16929 "Variables that you can set in inputrc that change the behaviour of guestfish "
16930 "in useful ways include:"
16934 #: ../fish/guestfish.pod:969
16935 msgid "completion-ignore-case (default: on)"
16939 #: ../fish/guestfish.pod:971
16941 "By default, guestfish will ignore case when tab-completing paths on the "
16946 #: ../fish/guestfish.pod:974
16949 " set completion-ignore-case off\n"
16954 #: ../fish/guestfish.pod:976
16955 msgid "to make guestfish case sensitive."
16959 #: ../fish/guestfish.pod:980
16964 #: ../fish/guestfish.pod:982
16965 msgid "test2.img (etc)"
16969 #: ../fish/guestfish.pod:984
16971 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
16972 "will be created in the file C<test1.img> in the current directory. The "
16973 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
16974 "the same name will be overwritten."
16978 #: ../fish/guestfish.pod:993
16980 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
16981 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
16982 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
16983 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
16987 #: ../fish/guestfish.pod:1017 ../test-tool/libguestfs-test-tool.pod:124 ../fuse/guestmount.pod:234 ../inspector/virt-inspector.pl:384 ../tools/virt-edit.pl:370 ../tools/virt-win-reg.pl:518 ../tools/virt-df.pl:657 ../tools/virt-ls.pl:251 ../tools/virt-resize.pl:1516 ../tools/virt-list-filesystems.pl:206 ../tools/virt-cat.pl:203 ../tools/virt-tar.pl:300 ../tools/virt-rescue.pl:285 ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:273
16989 "This program is free software; you can redistribute it and/or modify it "
16990 "under the terms of the GNU General Public License as published by the Free "
16991 "Software Foundation; either version 2 of the License, or (at your option) "
16992 "any later version."
16996 #: ../fish/guestfish.pod:1022 ../test-tool/libguestfs-test-tool.pod:129 ../fuse/guestmount.pod:239 ../inspector/virt-inspector.pl:389 ../tools/virt-edit.pl:375 ../tools/virt-win-reg.pl:523 ../tools/virt-df.pl:662 ../tools/virt-ls.pl:256 ../tools/virt-resize.pl:1521 ../tools/virt-list-filesystems.pl:211 ../tools/virt-cat.pl:208 ../tools/virt-tar.pl:305 ../tools/virt-rescue.pl:290 ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:278
16998 "This program is distributed in the hope that it will be useful, but WITHOUT "
16999 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
17000 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
17005 #: ../fish/guestfish.pod:1027 ../test-tool/libguestfs-test-tool.pod:134 ../fuse/guestmount.pod:244 ../inspector/virt-inspector.pl:394 ../tools/virt-edit.pl:380 ../tools/virt-win-reg.pl:528 ../tools/virt-df.pl:667 ../tools/virt-ls.pl:261 ../tools/virt-resize.pl:1526 ../tools/virt-list-filesystems.pl:216 ../tools/virt-cat.pl:213 ../tools/virt-tar.pl:310 ../tools/virt-rescue.pl:295 ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:283
17007 "You should have received a copy of the GNU General Public License along with "
17008 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
17009 "Ave, Cambridge, MA 02139, USA."
17013 #: ../fish/guestfish-actions.pod:1
17018 #: ../fish/guestfish-actions.pod:3
17021 " add-cdrom filename\n"
17026 #: ../fish/guestfish-actions.pod:15
17028 "This call checks for the existence of C<filename>. This stops you from "
17029 "specifying other types of drive which are supported by qemu such as C<nbd:> "
17030 "and C<http:> URLs. To specify those, use the general L</config> call "
17035 #: ../fish/guestfish-actions.pod:22
17037 "If you just want to add an ISO file (often you use this as an efficient way "
17038 "to transfer large files into the guest), then you should probably use "
17039 "L</add-drive-ro> instead."
17043 #: ../fish/guestfish-actions.pod:35
17048 #: ../fish/guestfish-actions.pod:37
17051 " add-drive filename\n"
17056 #: ../fish/guestfish-actions.pod:39
17058 "This function is the equivalent of calling L</add-drive-opts> with no "
17059 "optional parameters, so the disk is added writable, with the format being "
17060 "detected automatically."
17064 #: ../fish/guestfish-actions.pod:43
17066 "Automatic detection of the format opens you up to a potential security hole "
17067 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
17068 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
17069 "you should think about replacing calls to this function with calls to "
17070 "L</add-drive-opts>, and specifying the format."
17074 #: ../fish/guestfish-actions.pod:50
17075 msgid "add-drive-opts"
17079 #: ../fish/guestfish-actions.pod:52
17084 #: ../fish/guestfish-actions.pod:54
17087 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
17092 #: ../fish/guestfish-actions.pod:81
17094 "This forces the image format. If you omit this (or use L</add-drive> or "
17095 "L</add-drive-ro>) then the format is automatically detected. Possible "
17096 "formats include C<raw> and C<qcow2>."
17100 #: ../fish/guestfish-actions.pod:92
17102 "This rarely-used option lets you emulate the behaviour of the deprecated "
17103 "L</add-drive-with-if> call (q.v.)"
17107 #: ../fish/guestfish-actions.pod:97
17109 "This command has one or more optional arguments. See L</OPTIONAL "
17114 #: ../fish/guestfish-actions.pod:99
17115 msgid "add-drive-ro"
17119 #: ../fish/guestfish-actions.pod:101
17124 #: ../fish/guestfish-actions.pod:103
17127 " add-drive-ro filename\n"
17132 #: ../fish/guestfish-actions.pod:105
17134 "This function is the equivalent of calling L</add-drive-opts> with the "
17135 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
17136 "is added read-only, with the format being detected automatically."
17140 #: ../fish/guestfish-actions.pod:110
17141 msgid "add-drive-ro-with-if"
17145 #: ../fish/guestfish-actions.pod:112
17148 " add-drive-ro-with-if filename iface\n"
17153 #: ../fish/guestfish-actions.pod:114
17155 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
17156 "interface emulation to use at run time."
17160 #: ../fish/guestfish-actions.pod:124
17161 msgid "add-drive-with-if"
17165 #: ../fish/guestfish-actions.pod:126
17168 " add-drive-with-if filename iface\n"
17173 #: ../fish/guestfish-actions.pod:128
17175 "This is the same as L</add-drive> but it allows you to specify the QEMU "
17176 "interface emulation to use at run time."
17180 #: ../fish/guestfish-actions.pod:138
17185 #: ../fish/guestfish-actions.pod:140
17188 " aug-clear augpath\n"
17193 #: ../fish/guestfish-actions.pod:145
17198 #: ../fish/guestfish-actions.pod:147
17206 #: ../fish/guestfish-actions.pod:149
17208 "Close the current Augeas handle and free up any resources used by it. After "
17209 "calling this, you have to call L</aug-init> again before you can use any "
17210 "other Augeas functions."
17214 #: ../fish/guestfish-actions.pod:154
17215 msgid "aug-defnode"
17219 #: ../fish/guestfish-actions.pod:156
17222 " aug-defnode name expr val\n"
17227 #: ../fish/guestfish-actions.pod:161
17229 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
17230 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
17231 "containing that single node."
17235 #: ../fish/guestfish-actions.pod:169
17240 #: ../fish/guestfish-actions.pod:171
17243 " aug-defvar name expr\n"
17248 #: ../fish/guestfish-actions.pod:180
17253 #: ../fish/guestfish-actions.pod:182
17256 " aug-get augpath\n"
17261 #: ../fish/guestfish-actions.pod:187
17266 #: ../fish/guestfish-actions.pod:189
17269 " aug-init root flags\n"
17274 #: ../fish/guestfish-actions.pod:195
17275 msgid "You must call this before using any other L</aug-*> commands."
17279 #: ../fish/guestfish-actions.pod:230
17280 msgid "Do not load the tree in L</aug-init>."
17284 #: ../fish/guestfish-actions.pod:234
17285 msgid "To close the handle, you can call L</aug-close>."
17289 #: ../fish/guestfish-actions.pod:238
17294 #: ../fish/guestfish-actions.pod:240
17297 " aug-insert augpath label true|false\n"
17302 #: ../fish/guestfish-actions.pod:250
17307 #: ../fish/guestfish-actions.pod:252
17315 #: ../fish/guestfish-actions.pod:259
17320 #: ../fish/guestfish-actions.pod:261
17323 " aug-ls augpath\n"
17328 #: ../fish/guestfish-actions.pod:263
17330 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
17331 "resulting nodes into alphabetical order."
17335 #: ../fish/guestfish-actions.pod:266
17340 #: ../fish/guestfish-actions.pod:268
17343 " aug-match augpath\n"
17348 #: ../fish/guestfish-actions.pod:274
17353 #: ../fish/guestfish-actions.pod:276
17356 " aug-mv src dest\n"
17361 #: ../fish/guestfish-actions.pod:281
17366 #: ../fish/guestfish-actions.pod:283
17369 " aug-rm augpath\n"
17374 #: ../fish/guestfish-actions.pod:289
17379 #: ../fish/guestfish-actions.pod:291
17387 #: ../fish/guestfish-actions.pod:295
17389 "The flags which were passed to L</aug-init> affect exactly how files are "
17394 #: ../fish/guestfish-actions.pod:298
17399 #: ../fish/guestfish-actions.pod:300
17402 " aug-set augpath val\n"
17407 #: ../fish/guestfish-actions.pod:304
17409 "In the Augeas API, it is possible to clear a node by setting the value to "
17410 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
17411 "this call. Instead you must use the L</aug-clear> call."
17415 #: ../fish/guestfish-actions.pod:309
17420 #: ../fish/guestfish-actions.pod:311
17423 " available 'groups ...'\n"
17428 #: ../fish/guestfish-actions.pod:317
17430 "The libguestfs groups, and the functions that those groups correspond to, "
17431 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
17432 "runtime by calling L</available-all-groups>."
17436 #: ../fish/guestfish-actions.pod:341
17437 msgid "You must call L</launch> before calling this function."
17441 #: ../fish/guestfish-actions.pod:363
17443 "This call was added in version C<1.0.80>. In previous versions of "
17444 "libguestfs all you could do would be to speculatively execute a command to "
17445 "find out if the daemon implemented it. See also L</version>."
17449 #: ../fish/guestfish-actions.pod:370
17450 msgid "available-all-groups"
17454 #: ../fish/guestfish-actions.pod:372
17457 " available-all-groups\n"
17462 #: ../fish/guestfish-actions.pod:374
17464 "This command returns a list of all optional groups that this daemon knows "
17465 "about. Note this returns both supported and unsupported groups. To find "
17466 "out which ones the daemon can actually support you have to call "
17467 "L</available> on each member of the returned list."
17471 #: ../fish/guestfish-actions.pod:380
17472 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
17476 #: ../fish/guestfish-actions.pod:382
17481 #: ../fish/guestfish-actions.pod:384
17484 " base64-in (base64file|-) filename\n"
17489 #: ../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:3912 ../fish/guestfish-actions.pod:3924 ../fish/guestfish-actions.pod:3935 ../fish/guestfish-actions.pod:3946 ../fish/guestfish-actions.pod:3998 ../fish/guestfish-actions.pod:4007 ../fish/guestfish-actions.pod:4061 ../fish/guestfish-actions.pod:4084
17490 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
17494 #: ../fish/guestfish-actions.pod:391
17499 #: ../fish/guestfish-actions.pod:393
17502 " base64-out filename (base64file|-)\n"
17507 #: ../fish/guestfish-actions.pod:400
17508 msgid "blockdev-flushbufs"
17512 #: ../fish/guestfish-actions.pod:402
17515 " blockdev-flushbufs device\n"
17520 #: ../fish/guestfish-actions.pod:409
17521 msgid "blockdev-getbsz"
17525 #: ../fish/guestfish-actions.pod:411
17528 " blockdev-getbsz device\n"
17533 #: ../fish/guestfish-actions.pod:420
17534 msgid "blockdev-getro"
17538 #: ../fish/guestfish-actions.pod:422
17541 " blockdev-getro device\n"
17546 #: ../fish/guestfish-actions.pod:429
17547 msgid "blockdev-getsize64"
17551 #: ../fish/guestfish-actions.pod:431
17554 " blockdev-getsize64 device\n"
17559 #: ../fish/guestfish-actions.pod:435
17560 msgid "See also L</blockdev-getsz>."
17564 #: ../fish/guestfish-actions.pod:439
17565 msgid "blockdev-getss"
17569 #: ../fish/guestfish-actions.pod:441
17572 " blockdev-getss device\n"
17577 #: ../fish/guestfish-actions.pod:446
17578 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
17582 #: ../fish/guestfish-actions.pod:451
17583 msgid "blockdev-getsz"
17587 #: ../fish/guestfish-actions.pod:453
17590 " blockdev-getsz device\n"
17595 #: ../fish/guestfish-actions.pod:458
17597 "See also L</blockdev-getss> for the real sector size of the device, and "
17598 "L</blockdev-getsize64> for the more useful I<size in bytes>."
17602 #: ../fish/guestfish-actions.pod:464
17603 msgid "blockdev-rereadpt"
17607 #: ../fish/guestfish-actions.pod:466
17610 " blockdev-rereadpt device\n"
17615 #: ../fish/guestfish-actions.pod:472
17616 msgid "blockdev-setbsz"
17620 #: ../fish/guestfish-actions.pod:474
17623 " blockdev-setbsz device blocksize\n"
17628 #: ../fish/guestfish-actions.pod:483
17629 msgid "blockdev-setro"
17633 #: ../fish/guestfish-actions.pod:485
17636 " blockdev-setro device\n"
17641 #: ../fish/guestfish-actions.pod:491
17642 msgid "blockdev-setrw"
17646 #: ../fish/guestfish-actions.pod:493
17649 " blockdev-setrw device\n"
17654 #: ../fish/guestfish-actions.pod:499
17655 msgid "case-sensitive-path"
17659 #: ../fish/guestfish-actions.pod:501
17662 " case-sensitive-path path\n"
17667 #: ../fish/guestfish-actions.pod:525
17669 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
17670 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
17671 "how the directories were originally created under Windows)."
17675 #: ../fish/guestfish-actions.pod:533
17676 msgid "See also L</realpath>."
17680 #: ../fish/guestfish-actions.pod:535
17685 #: ../fish/guestfish-actions.pod:537
17693 #: ../fish/guestfish-actions.pod:541
17695 "Note that this function cannot correctly handle binary files (specifically, "
17696 "files containing C<\\0> character which is treated as end of string). For "
17697 "those you need to use the L</read-file> or L</download> functions which have "
17698 "a more complex interface."
17702 #: ../fish/guestfish-actions.pod:549
17707 #: ../fish/guestfish-actions.pod:551
17710 " checksum csumtype path\n"
17715 #: ../fish/guestfish-actions.pod:594
17716 msgid "To get the checksum for a device, use L</checksum-device>."
17720 #: ../fish/guestfish-actions.pod:596
17721 msgid "To get the checksums for many files, use L</checksums-out>."
17725 #: ../fish/guestfish-actions.pod:598
17726 msgid "checksum-device"
17730 #: ../fish/guestfish-actions.pod:600
17733 " checksum-device csumtype device\n"
17738 #: ../fish/guestfish-actions.pod:602
17740 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
17741 "device named C<device>. For the types of checksums supported see the "
17742 "L</checksum> command."
17746 #: ../fish/guestfish-actions.pod:606
17747 msgid "checksums-out"
17751 #: ../fish/guestfish-actions.pod:608
17754 " checksums-out csumtype directory (sumsfile|-)\n"
17759 #: ../fish/guestfish-actions.pod:624
17764 #: ../fish/guestfish-actions.pod:626
17767 " chmod mode path\n"
17772 #: ../fish/guestfish-actions.pod:637
17777 #: ../fish/guestfish-actions.pod:639
17780 " chown owner group path\n"
17785 #: ../fish/guestfish-actions.pod:647
17790 #: ../fish/guestfish-actions.pod:649
17793 " command 'arguments ...'\n"
17798 #: ../fish/guestfish-actions.pod:656
17800 "The single parameter is an argv-style list of arguments. The first element "
17801 "is the name of the program to run. Subsequent elements are parameters. The "
17802 "list must be non-empty (ie. must contain a program name). Note that the "
17803 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
17807 #: ../fish/guestfish-actions.pod:684
17808 msgid "command-lines"
17812 #: ../fish/guestfish-actions.pod:686
17815 " command-lines 'arguments ...'\n"
17820 #: ../fish/guestfish-actions.pod:688
17821 msgid "This is the same as L</command>, but splits the result into a list of lines."
17825 #: ../fish/guestfish-actions.pod:691
17826 msgid "See also: L</sh-lines>"
17830 #: ../fish/guestfish-actions.pod:696
17835 #: ../fish/guestfish-actions.pod:698
17838 " config qemuparam qemuvalue\n"
17843 #: ../fish/guestfish-actions.pod:709
17848 #: ../fish/guestfish-actions.pod:711
17851 " copy-size src dest size\n"
17856 #: ../fish/guestfish-actions.pod:719
17861 #: ../fish/guestfish-actions.pod:721
17869 #: ../fish/guestfish-actions.pod:726
17874 #: ../fish/guestfish-actions.pod:728
17882 #: ../fish/guestfish-actions.pod:733
17887 #: ../fish/guestfish-actions.pod:735
17895 #: ../fish/guestfish-actions.pod:742
17897 "If the destination is a device, it must be as large or larger than the "
17898 "source file or device, otherwise the copy will fail. This command cannot do "
17899 "partial copies (see L</copy-size>)."
17903 #: ../fish/guestfish-actions.pod:746
17908 #: ../fish/guestfish-actions.pod:748
17911 " debug subcmd 'extraargs ...'\n"
17916 #: ../fish/guestfish-actions.pod:750
17918 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
17919 "daemon) that runs inside the qemu subprocess."
17923 #: ../fish/guestfish-actions.pod:758
17924 msgid "debug-upload"
17928 #: ../fish/guestfish-actions.pod:760
17931 " debug-upload (filename|-) tmpname mode\n"
17936 #: ../fish/guestfish-actions.pod:762
17937 msgid "The L</debug-upload> command uploads a file to the libguestfs appliance."
17941 #: ../fish/guestfish-actions.pod:771
17946 #: ../fish/guestfish-actions.pod:773
17954 #: ../fish/guestfish-actions.pod:781
17959 #: ../fish/guestfish-actions.pod:783
17967 #: ../fish/guestfish-actions.pod:792
17972 #: ../fish/guestfish-actions.pod:794
17980 #: ../fish/guestfish-actions.pod:800
17982 "Another way to get the same information is to enable verbose messages with "
17983 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
17984 "before running the program."
17988 #: ../fish/guestfish-actions.pod:805
17993 #: ../fish/guestfish-actions.pod:807
17996 " download remotefilename (filename|-)\n"
18001 #: ../fish/guestfish-actions.pod:814
18002 msgid "See also L</upload>, L</cat>."
18006 #: ../fish/guestfish-actions.pod:818
18007 msgid "download-offset"
18011 #: ../fish/guestfish-actions.pod:820
18014 " download-offset remotefilename (filename|-) offset size\n"
18019 #: ../fish/guestfish-actions.pod:828
18021 "Note that there is no limit on the amount of data that can be downloaded "
18022 "with this call, unlike with L</pread>, and this call always reads the full "
18023 "amount unless an error occurs."
18027 #: ../fish/guestfish-actions.pod:833
18028 msgid "See also L</download>, L</pread>."
18032 #: ../fish/guestfish-actions.pod:837
18033 msgid "drop-caches"
18037 #: ../fish/guestfish-actions.pod:839
18040 " drop-caches whattodrop\n"
18045 #: ../fish/guestfish-actions.pod:851
18050 #: ../fish/guestfish-actions.pod:853
18058 #: ../fish/guestfish-actions.pod:865
18063 #: ../fish/guestfish-actions.pod:867
18066 " e2fsck-f device\n"
18071 #: ../fish/guestfish-actions.pod:873
18073 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
18074 "should use L</fsck>."
18078 #: ../fish/guestfish-actions.pod:876
18079 msgid "echo-daemon"
18083 #: ../fish/guestfish-actions.pod:878
18086 " echo-daemon 'words ...'\n"
18091 #: ../fish/guestfish-actions.pod:885
18092 msgid "See also L</ping-daemon>."
18096 #: ../fish/guestfish-actions.pod:887
18101 #: ../fish/guestfish-actions.pod:889
18104 " egrep regex path\n"
18109 #: ../fish/guestfish-actions.pod:897
18114 #: ../fish/guestfish-actions.pod:899
18117 " egrepi regex path\n"
18122 #: ../fish/guestfish-actions.pod:907
18127 #: ../fish/guestfish-actions.pod:909
18130 " equal file1 file2\n"
18135 #: ../fish/guestfish-actions.pod:916
18140 #: ../fish/guestfish-actions.pod:918
18148 #: ../fish/guestfish-actions.pod:923
18149 msgid "See also L</is-file>, L</is-dir>, L</stat>."
18153 #: ../fish/guestfish-actions.pod:925
18158 #: ../fish/guestfish-actions.pod:927
18161 " fallocate path len\n"
18166 #: ../fish/guestfish-actions.pod:944
18167 msgid "fallocate64"
18171 #: ../fish/guestfish-actions.pod:946
18174 " fallocate64 path len\n"
18179 #: ../fish/guestfish-actions.pod:952
18181 "Note that this call allocates disk blocks for the file. To create a sparse "
18182 "file use L</truncate-size> instead."
18186 #: ../fish/guestfish-actions.pod:955
18188 "The deprecated call L</fallocate> does the same, but owing to an oversight "
18189 "it only allowed 30 bit lengths to be specified, effectively limiting the "
18190 "maximum size of files created through that call to 1GB."
18194 #: ../fish/guestfish-actions.pod:964
18199 #: ../fish/guestfish-actions.pod:966
18202 " fgrep pattern path\n"
18207 #: ../fish/guestfish-actions.pod:974
18212 #: ../fish/guestfish-actions.pod:976
18215 " fgrepi pattern path\n"
18220 #: ../fish/guestfish-actions.pod:984
18225 #: ../fish/guestfish-actions.pod:986
18233 #: ../fish/guestfish-actions.pod:998
18235 "This command can also be used on C</dev/> devices (and partitions, LV "
18236 "names). You can for example use this to determine if a device contains a "
18237 "filesystem, although it's usually better to use L</vfs-type>."
18241 #: ../fish/guestfish-actions.pod:1008
18242 msgid "file-architecture"
18246 #: ../fish/guestfish-actions.pod:1010
18249 " file-architecture filename\n"
18254 #: ../fish/guestfish-actions.pod:1113
18259 #: ../fish/guestfish-actions.pod:1115
18267 #: ../fish/guestfish-actions.pod:1119
18269 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
18270 "L</is-file> etc. To get the size of block devices, use "
18271 "L</blockdev-getsize64>."
18275 #: ../fish/guestfish-actions.pod:1123
18280 #: ../fish/guestfish-actions.pod:1125
18283 " fill c len path\n"
18288 #: ../fish/guestfish-actions.pod:1131
18290 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
18291 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
18292 "L</fill-pattern>."
18296 #: ../fish/guestfish-actions.pod:1136
18297 msgid "fill-pattern"
18301 #: ../fish/guestfish-actions.pod:1138
18304 " fill-pattern pattern len path\n"
18309 #: ../fish/guestfish-actions.pod:1140
18311 "This function is like L</fill> except that it creates a new file of length "
18312 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
18313 "is truncated if necessary to ensure the length of the file is exactly C<len> "
18318 #: ../fish/guestfish-actions.pod:1145
18323 #: ../fish/guestfish-actions.pod:1147
18326 " find directory\n"
18331 #: ../fish/guestfish-actions.pod:1161
18332 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
18336 #: ../fish/guestfish-actions.pod:1174
18337 msgid "See also L</find0>."
18341 #: ../fish/guestfish-actions.pod:1179
18346 #: ../fish/guestfish-actions.pod:1181
18349 " find0 directory (files|-)\n"
18354 #: ../fish/guestfish-actions.pod:1187
18355 msgid "This command works the same way as L</find> with the following exceptions:"
18359 #: ../fish/guestfish-actions.pod:1214
18360 msgid "findfs-label"
18364 #: ../fish/guestfish-actions.pod:1216
18367 " findfs-label label\n"
18372 #: ../fish/guestfish-actions.pod:1222
18373 msgid "To find the label of a filesystem, use L</vfs-label>."
18377 #: ../fish/guestfish-actions.pod:1224
18378 msgid "findfs-uuid"
18382 #: ../fish/guestfish-actions.pod:1226
18385 " findfs-uuid uuid\n"
18390 #: ../fish/guestfish-actions.pod:1232
18391 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
18395 #: ../fish/guestfish-actions.pod:1234
18400 #: ../fish/guestfish-actions.pod:1236
18403 " fsck fstype device\n"
18408 #: ../fish/guestfish-actions.pod:1266
18413 #: ../fish/guestfish-actions.pod:1268
18421 #: ../fish/guestfish-actions.pod:1275
18422 msgid "get-autosync"
18426 #: ../fish/guestfish-actions.pod:1277
18434 #: ../fish/guestfish-actions.pod:1281
18439 #: ../fish/guestfish-actions.pod:1283
18447 #: ../fish/guestfish-actions.pod:1287
18448 msgid "get-e2label"
18452 #: ../fish/guestfish-actions.pod:1289
18455 " get-e2label device\n"
18460 #: ../fish/guestfish-actions.pod:1301
18465 #: ../fish/guestfish-actions.pod:1303
18468 " get-e2uuid device\n"
18473 #: ../fish/guestfish-actions.pod:1315
18474 msgid "get-memsize"
18478 #: ../fish/guestfish-actions.pod:1317
18486 #: ../fish/guestfish-actions.pod:1322
18488 "If L</set-memsize> was not called on this handle, and if "
18489 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
18490 "value for memsize."
18494 #: ../fish/guestfish-actions.pod:1329
18495 msgid "get-network"
18499 #: ../fish/guestfish-actions.pod:1331
18507 #: ../fish/guestfish-actions.pod:1335
18512 #: ../fish/guestfish-actions.pod:1337
18520 #: ../fish/guestfish-actions.pod:1344
18525 #: ../fish/guestfish-actions.pod:1346
18530 #: ../fish/guestfish-actions.pod:1348
18538 #: ../fish/guestfish-actions.pod:1355
18543 #: ../fish/guestfish-actions.pod:1357
18551 #: ../fish/guestfish-actions.pod:1364
18552 msgid "get-recovery-proc"
18556 #: ../fish/guestfish-actions.pod:1366
18559 " get-recovery-proc\n"
18564 #: ../fish/guestfish-actions.pod:1370
18565 msgid "get-selinux"
18569 #: ../fish/guestfish-actions.pod:1372
18577 #: ../fish/guestfish-actions.pod:1374
18579 "This returns the current setting of the selinux flag which is passed to the "
18580 "appliance at boot time. See L</set-selinux>."
18584 #: ../fish/guestfish-actions.pod:1380
18589 #: ../fish/guestfish-actions.pod:1382
18597 #: ../fish/guestfish-actions.pod:1389
18602 #: ../fish/guestfish-actions.pod:1391
18610 #: ../fish/guestfish-actions.pod:1395
18615 #: ../fish/guestfish-actions.pod:1397
18623 #: ../fish/guestfish-actions.pod:1399
18625 "Return the current umask. By default the umask is C<022> unless it has been "
18626 "set by calling L</umask>."
18630 #: ../fish/guestfish-actions.pod:1402
18631 msgid "get-verbose"
18635 #: ../fish/guestfish-actions.pod:1404
18643 #: ../fish/guestfish-actions.pod:1408
18648 #: ../fish/guestfish-actions.pod:1410
18656 #: ../fish/guestfish-actions.pod:1414
18657 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
18661 #: ../fish/guestfish-actions.pod:1417
18666 #: ../fish/guestfish-actions.pod:1419
18669 " getxattrs path\n"
18674 #: ../fish/guestfish-actions.pod:1427
18675 msgid "See also: L</lgetxattrs>, L<attr(5)>."
18679 #: ../fish/guestfish-actions.pod:1429
18680 msgid "glob-expand"
18684 #: ../fish/guestfish-actions.pod:1431
18687 " glob-expand pattern\n"
18692 #: ../fish/guestfish-actions.pod:1444
18697 #: ../fish/guestfish-actions.pod:1446
18700 " grep regex path\n"
18705 #: ../fish/guestfish-actions.pod:1454
18710 #: ../fish/guestfish-actions.pod:1456
18713 " grepi regex path\n"
18718 #: ../fish/guestfish-actions.pod:1464
18719 msgid "grub-install"
18723 #: ../fish/guestfish-actions.pod:1466
18726 " grub-install root device\n"
18731 #: ../fish/guestfish-actions.pod:1482
18736 #: ../fish/guestfish-actions.pod:1484
18744 #: ../fish/guestfish-actions.pod:1492
18749 #: ../fish/guestfish-actions.pod:1494
18752 " head-n nrlines path\n"
18757 #: ../fish/guestfish-actions.pod:1507
18762 #: ../fish/guestfish-actions.pod:1509
18770 #: ../fish/guestfish-actions.pod:1517
18775 #: ../fish/guestfish-actions.pod:1519
18778 " initrd-cat initrdpath filename\n"
18783 #: ../fish/guestfish-actions.pod:1531
18784 msgid "See also L</initrd-list>."
18788 #: ../fish/guestfish-actions.pod:1536
18789 msgid "initrd-list"
18793 #: ../fish/guestfish-actions.pod:1538
18796 " initrd-list path\n"
18801 #: ../fish/guestfish-actions.pod:1550
18802 msgid "inotify-add-watch"
18806 #: ../fish/guestfish-actions.pod:1552
18809 " inotify-add-watch path mask\n"
18814 #: ../fish/guestfish-actions.pod:1564
18815 msgid "inotify-close"
18819 #: ../fish/guestfish-actions.pod:1566
18827 #: ../fish/guestfish-actions.pod:1572
18828 msgid "inotify-files"
18832 #: ../fish/guestfish-actions.pod:1574
18840 #: ../fish/guestfish-actions.pod:1576
18842 "This function is a helpful wrapper around L</inotify-read> which just "
18843 "returns a list of pathnames of objects that were touched. The returned "
18844 "pathnames are sorted and deduplicated."
18848 #: ../fish/guestfish-actions.pod:1580
18849 msgid "inotify-init"
18853 #: ../fish/guestfish-actions.pod:1582
18856 " inotify-init maxevents\n"
18861 #: ../fish/guestfish-actions.pod:1588
18863 "C<maxevents> is the maximum number of events which will be queued up between "
18864 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
18865 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
18866 "default was 16384 events. Beyond this limit, the kernel throws away events, "
18867 "but records the fact that it threw them away by setting a flag "
18868 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
18872 #: ../fish/guestfish-actions.pod:1598
18874 "Before any events are generated, you have to add some watches to the "
18875 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
18876 "L</inotify-watch-all>."
18880 #: ../fish/guestfish-actions.pod:1604
18882 "Queued up events should be read periodically by calling L</inotify-read> (or "
18883 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
18884 "If you don't read the events out often enough then you risk the internal "
18885 "queue overflowing."
18889 #: ../fish/guestfish-actions.pod:1611
18891 "The handle should be closed after use by calling L</inotify-close>. This "
18892 "also removes any watches automatically."
18896 #: ../fish/guestfish-actions.pod:1620
18897 msgid "inotify-read"
18901 #: ../fish/guestfish-actions.pod:1622
18909 #: ../fish/guestfish-actions.pod:1635
18910 msgid "inotify-rm-watch"
18914 #: ../fish/guestfish-actions.pod:1637
18917 " inotify-rm-watch wd\n"
18922 #: ../fish/guestfish-actions.pod:1639
18923 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
18927 #: ../fish/guestfish-actions.pod:1642
18928 msgid "inspect-get-arch"
18932 #: ../fish/guestfish-actions.pod:1644
18935 " inspect-get-arch root\n"
18940 #: ../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 ../fish/guestfish-actions.pod:1833
18942 "This function should only be called with a root device string as returned by "
18947 #: ../fish/guestfish-actions.pod:1649
18949 "This returns the architecture of the inspected operating system. The "
18950 "possible return values are listed under L</file-architecture>."
18954 #: ../fish/guestfish-actions.pod:1658
18955 msgid "inspect-get-distro"
18959 #: ../fish/guestfish-actions.pod:1660
18962 " inspect-get-distro root\n"
18967 #: ../fish/guestfish-actions.pod:1704
18968 msgid "inspect-get-filesystems"
18972 #: ../fish/guestfish-actions.pod:1706
18975 " inspect-get-filesystems root\n"
18980 #: ../fish/guestfish-actions.pod:1719
18982 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18983 "L</inspect-get-mountpoints>."
18987 #: ../fish/guestfish-actions.pod:1722
18988 msgid "inspect-get-major-version"
18992 #: ../fish/guestfish-actions.pod:1724
18995 " inspect-get-major-version root\n"
19000 #: ../fish/guestfish-actions.pod:1743
19001 msgid "inspect-get-minor-version"
19005 #: ../fish/guestfish-actions.pod:1745
19008 " inspect-get-minor-version root\n"
19013 #: ../fish/guestfish-actions.pod:1755
19015 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
19016 "L</inspect-get-major-version>."
19020 #: ../fish/guestfish-actions.pod:1758
19021 msgid "inspect-get-mountpoints"
19025 #: ../fish/guestfish-actions.pod:1760
19028 " inspect-get-mountpoints root\n"
19033 #: ../fish/guestfish-actions.pod:1778
19035 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
19036 "L</inspect-get-filesystems>."
19040 #: ../fish/guestfish-actions.pod:1781
19041 msgid "inspect-get-product-name"
19045 #: ../fish/guestfish-actions.pod:1783
19048 " inspect-get-product-name root\n"
19053 #: ../fish/guestfish-actions.pod:1798
19054 msgid "inspect-get-type"
19058 #: ../fish/guestfish-actions.pod:1800
19061 " inspect-get-type root\n"
19066 #: ../fish/guestfish-actions.pod:1829
19067 msgid "inspect-get-windows-systemroot"
19071 #: ../fish/guestfish-actions.pod:1831
19074 " inspect-get-windows-systemroot root\n"
19079 #: ../fish/guestfish-actions.pod:1845
19084 #: ../fish/guestfish-actions.pod:1847
19092 #: ../fish/guestfish-actions.pod:1862
19094 "You can pass the root string(s) returned to other L</inspect-get-*> "
19095 "functions in order to query further information about each operating system, "
19096 "such as the name and version."
19100 #: ../fish/guestfish-actions.pod:1867
19102 "This function uses other libguestfs features such as L</mount-ro> and "
19103 "L</umount-all> in order to mount and unmount filesystems and look at the "
19104 "contents. This should be called with no disks currently mounted. The "
19105 "function may also use Augeas, so any existing Augeas handle will be closed."
19109 #: ../fish/guestfish-actions.pod:1879 ../fish/guestfish-actions.pod:2035 ../fish/guestfish-actions.pod:2081
19110 msgid "See also L</list-filesystems>."
19114 #: ../fish/guestfish-actions.pod:1881
19115 msgid "is-blockdev"
19119 #: ../fish/guestfish-actions.pod:1883
19122 " is-blockdev path\n"
19127 #: ../fish/guestfish-actions.pod:1888 ../fish/guestfish-actions.pod:1906 ../fish/guestfish-actions.pod:1925 ../fish/guestfish-actions.pod:1934 ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1978 ../fish/guestfish-actions.pod:1987
19128 msgid "See also L</stat>."
19132 #: ../fish/guestfish-actions.pod:1890
19137 #: ../fish/guestfish-actions.pod:1892
19145 #: ../fish/guestfish-actions.pod:1899
19150 #: ../fish/guestfish-actions.pod:1901
19153 " is-chardev path\n"
19158 #: ../fish/guestfish-actions.pod:1908
19163 #: ../fish/guestfish-actions.pod:1910
19171 #: ../fish/guestfish-actions.pod:1917
19176 #: ../fish/guestfish-actions.pod:1919
19184 #: ../fish/guestfish-actions.pod:1927
19189 #: ../fish/guestfish-actions.pod:1929
19197 #: ../fish/guestfish-actions.pod:1936
19202 #: ../fish/guestfish-actions.pod:1938
19210 #: ../fish/guestfish-actions.pod:1946
19211 msgid "is-launching"
19215 #: ../fish/guestfish-actions.pod:1948
19223 #: ../fish/guestfish-actions.pod:1955
19228 #: ../fish/guestfish-actions.pod:1957
19236 #: ../fish/guestfish-actions.pod:1962
19241 #: ../fish/guestfish-actions.pod:1964
19249 #: ../fish/guestfish-actions.pod:1971
19254 #: ../fish/guestfish-actions.pod:1973
19257 " is-socket path\n"
19262 #: ../fish/guestfish-actions.pod:1980
19267 #: ../fish/guestfish-actions.pod:1982
19270 " is-symlink path\n"
19275 #: ../fish/guestfish-actions.pod:1989
19276 msgid "kill-subprocess"
19280 #: ../fish/guestfish-actions.pod:1991
19283 " kill-subprocess\n"
19288 #: ../fish/guestfish-actions.pod:1995
19293 #: ../fish/guestfish-actions.pod:1997
19298 #: ../fish/guestfish-actions.pod:1999
19306 #: ../fish/guestfish-actions.pod:2007
19311 #: ../fish/guestfish-actions.pod:2009
19314 " lchown owner group path\n"
19319 #: ../fish/guestfish-actions.pod:2011
19321 "Change the file owner to C<owner> and group to C<group>. This is like "
19322 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
19327 #: ../fish/guestfish-actions.pod:2019
19332 #: ../fish/guestfish-actions.pod:2021
19335 " lgetxattrs path\n"
19340 #: ../fish/guestfish-actions.pod:2023
19342 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
19343 "it returns the extended attributes of the link itself."
19347 #: ../fish/guestfish-actions.pod:2027
19348 msgid "list-devices"
19352 #: ../fish/guestfish-actions.pod:2029
19360 #: ../fish/guestfish-actions.pod:2037
19361 msgid "list-filesystems"
19365 #: ../fish/guestfish-actions.pod:2039
19368 " list-filesystems\n"
19373 #: ../fish/guestfish-actions.pod:2058
19375 "This command runs other libguestfs commands, which might include L</mount> "
19376 "and L</umount>, and therefore you should use this soon after launch and only "
19377 "when nothing is mounted."
19381 #: ../fish/guestfish-actions.pod:2062
19383 "Not all of the filesystems returned will be mountable. In particular, swap "
19384 "partitions are returned in the list. Also this command does not check that "
19385 "each filesystem found is valid and mountable, and some filesystems might be "
19386 "mountable but require special options. Filesystems may not all belong to a "
19387 "single logical operating system (use L</inspect-os> to look for OSes)."
19391 #: ../fish/guestfish-actions.pod:2070
19392 msgid "list-partitions"
19396 #: ../fish/guestfish-actions.pod:2072
19399 " list-partitions\n"
19404 #: ../fish/guestfish-actions.pod:2078
19406 "This does not return logical volumes. For that you will need to call "
19411 #: ../fish/guestfish-actions.pod:2083
19416 #: ../fish/guestfish-actions.pod:2085
19424 #: ../fish/guestfish-actions.pod:2093
19429 #: ../fish/guestfish-actions.pod:2095
19432 " ln target linkname\n"
19437 #: ../fish/guestfish-actions.pod:2099
19442 #: ../fish/guestfish-actions.pod:2101
19445 " ln-f target linkname\n"
19450 #: ../fish/guestfish-actions.pod:2106
19455 #: ../fish/guestfish-actions.pod:2108
19458 " ln-s target linkname\n"
19463 #: ../fish/guestfish-actions.pod:2112
19468 #: ../fish/guestfish-actions.pod:2114
19471 " ln-sf target linkname\n"
19476 #: ../fish/guestfish-actions.pod:2119
19477 msgid "lremovexattr"
19481 #: ../fish/guestfish-actions.pod:2121
19484 " lremovexattr xattr path\n"
19489 #: ../fish/guestfish-actions.pod:2123
19491 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
19492 "it removes an extended attribute of the link itself."
19496 #: ../fish/guestfish-actions.pod:2127
19501 #: ../fish/guestfish-actions.pod:2129
19509 #: ../fish/guestfish-actions.pod:2135
19511 "This command is mostly useful for interactive sessions. Programs should "
19512 "probably use L</readdir> instead."
19516 #: ../fish/guestfish-actions.pod:2138
19521 #: ../fish/guestfish-actions.pod:2140
19524 " lsetxattr xattr val vallen path\n"
19529 #: ../fish/guestfish-actions.pod:2142
19531 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
19532 "sets an extended attribute of the link itself."
19536 #: ../fish/guestfish-actions.pod:2146
19541 #: ../fish/guestfish-actions.pod:2148
19549 #: ../fish/guestfish-actions.pod:2152
19551 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
19552 "the link is stat-ed, not the file it refers to."
19556 #: ../fish/guestfish-actions.pod:2158
19561 #: ../fish/guestfish-actions.pod:2160
19564 " lstatlist path 'names ...'\n"
19569 #: ../fish/guestfish-actions.pod:2162
19571 "This call allows you to perform the L</lstat> operation on multiple files, "
19572 "where all files are in the directory C<path>. C<names> is the list of files "
19573 "from this directory."
19577 #: ../fish/guestfish-actions.pod:2171
19579 "This call is intended for programs that want to efficiently list a directory "
19580 "contents without making many round-trips. See also L</lxattrlist> for a "
19581 "similarly efficient call for getting extended attributes. Very long "
19582 "directory listings might cause the protocol message size to be exceeded, "
19583 "causing this call to fail. The caller must split up such requests into "
19584 "smaller groups of names."
19588 #: ../fish/guestfish-actions.pod:2179
19589 msgid "luks-add-key"
19593 #: ../fish/guestfish-actions.pod:2181
19596 " luks-add-key device keyslot\n"
19601 #: ../fish/guestfish-actions.pod:2188
19603 "Note that if C<keyslot> already contains a key, then this command will "
19604 "fail. You have to use L</luks-kill-slot> first to remove that key."
19608 #: ../fish/guestfish-actions.pod:2192 ../fish/guestfish-actions.pod:2214 ../fish/guestfish-actions.pod:2227 ../fish/guestfish-actions.pod:2241 ../fish/guestfish-actions.pod:2264 ../fish/guestfish-actions.pod:2274
19610 "This command has one or more key or passphrase parameters. Guestfish will "
19611 "prompt for these separately."
19615 #: ../fish/guestfish-actions.pod:2195
19620 #: ../fish/guestfish-actions.pod:2197
19623 " luks-close device\n"
19628 #: ../fish/guestfish-actions.pod:2199
19630 "This closes a LUKS device that was created earlier by L</luks-open> or "
19631 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
19632 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
19633 "underlying block device."
19637 #: ../fish/guestfish-actions.pod:2205
19638 msgid "luks-format"
19642 #: ../fish/guestfish-actions.pod:2207
19645 " luks-format device keyslot\n"
19650 #: ../fish/guestfish-actions.pod:2220
19651 msgid "luks-format-cipher"
19655 #: ../fish/guestfish-actions.pod:2222
19658 " luks-format-cipher device keyslot cipher\n"
19663 #: ../fish/guestfish-actions.pod:2224
19665 "This command is the same as L</luks-format> but it also allows you to set "
19666 "the C<cipher> used."
19670 #: ../fish/guestfish-actions.pod:2233
19671 msgid "luks-kill-slot"
19675 #: ../fish/guestfish-actions.pod:2235
19678 " luks-kill-slot device keyslot\n"
19683 #: ../fish/guestfish-actions.pod:2244
19688 #: ../fish/guestfish-actions.pod:2246
19691 " luks-open device mapname\n"
19696 #: ../fish/guestfish-actions.pod:2260
19698 "If this block device contains LVM volume groups, then calling L</vgscan> "
19699 "followed by L</vg-activate-all> will make them visible."
19703 #: ../fish/guestfish-actions.pod:2267
19704 msgid "luks-open-ro"
19708 #: ../fish/guestfish-actions.pod:2269
19711 " luks-open-ro device mapname\n"
19716 #: ../fish/guestfish-actions.pod:2271
19718 "This is the same as L</luks-open> except that a read-only mapping is "
19723 #: ../fish/guestfish-actions.pod:2277
19728 #: ../fish/guestfish-actions.pod:2279
19731 " lvcreate logvol volgroup mbytes\n"
19736 #: ../fish/guestfish-actions.pod:2284
19737 msgid "lvm-canonical-lv-name"
19741 #: ../fish/guestfish-actions.pod:2286
19744 " lvm-canonical-lv-name lvname\n"
19749 #: ../fish/guestfish-actions.pod:2295
19750 msgid "See also L</is-lv>."
19754 #: ../fish/guestfish-actions.pod:2297
19755 msgid "lvm-clear-filter"
19759 #: ../fish/guestfish-actions.pod:2299
19762 " lvm-clear-filter\n"
19767 #: ../fish/guestfish-actions.pod:2301
19769 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
19774 #: ../fish/guestfish-actions.pod:2307
19775 msgid "lvm-remove-all"
19779 #: ../fish/guestfish-actions.pod:2309
19782 " lvm-remove-all\n"
19787 #: ../fish/guestfish-actions.pod:2317
19788 msgid "lvm-set-filter"
19792 #: ../fish/guestfish-actions.pod:2319
19795 " lvm-set-filter 'devices ...'\n"
19800 #: ../fish/guestfish-actions.pod:2344
19805 #: ../fish/guestfish-actions.pod:2346
19808 " lvremove device\n"
19813 #: ../fish/guestfish-actions.pod:2354
19818 #: ../fish/guestfish-actions.pod:2356
19821 " lvrename logvol newlogvol\n"
19826 #: ../fish/guestfish-actions.pod:2360
19831 #: ../fish/guestfish-actions.pod:2362
19834 " lvresize device mbytes\n"
19839 #: ../fish/guestfish-actions.pod:2368
19840 msgid "lvresize-free"
19844 #: ../fish/guestfish-actions.pod:2370
19847 " lvresize-free lv percent\n"
19852 #: ../fish/guestfish-actions.pod:2378
19857 #: ../fish/guestfish-actions.pod:2380
19865 #: ../fish/guestfish-actions.pod:2388
19866 msgid "See also L</lvs-full>, L</list-filesystems>."
19870 #: ../fish/guestfish-actions.pod:2390
19875 #: ../fish/guestfish-actions.pod:2392
19883 #: ../fish/guestfish-actions.pod:2397
19888 #: ../fish/guestfish-actions.pod:2399
19896 #: ../fish/guestfish-actions.pod:2403
19901 #: ../fish/guestfish-actions.pod:2405
19904 " lxattrlist path 'names ...'\n"
19909 #: ../fish/guestfish-actions.pod:2421
19911 "This call is intended for programs that want to efficiently list a directory "
19912 "contents without making many round-trips. See also L</lstatlist> for a "
19913 "similarly efficient call for getting standard stats. Very long directory "
19914 "listings might cause the protocol message size to be exceeded, causing this "
19915 "call to fail. The caller must split up such requests into smaller groups of "
19920 #: ../fish/guestfish-actions.pod:2429
19925 #: ../fish/guestfish-actions.pod:2431
19933 #: ../fish/guestfish-actions.pod:2435
19938 #: ../fish/guestfish-actions.pod:2437
19941 " mkdir-mode path mode\n"
19946 #: ../fish/guestfish-actions.pod:2446
19947 msgid "See also L</mkdir>, L</umask>"
19951 #: ../fish/guestfish-actions.pod:2448
19956 #: ../fish/guestfish-actions.pod:2450
19964 #: ../fish/guestfish-actions.pod:2455
19969 #: ../fish/guestfish-actions.pod:2457
19972 " mkdtemp template\n"
19977 #: ../fish/guestfish-actions.pod:2478
19982 #: ../fish/guestfish-actions.pod:2480
19985 " mke2fs-J fstype blocksize device journal\n"
19990 #: ../fish/guestfish-actions.pod:2488
19991 msgid "See also L</mke2journal>."
19995 #: ../fish/guestfish-actions.pod:2490
20000 #: ../fish/guestfish-actions.pod:2492
20003 " mke2fs-JL fstype blocksize device label\n"
20008 #: ../fish/guestfish-actions.pod:2497
20009 msgid "See also L</mke2journal-L>."
20013 #: ../fish/guestfish-actions.pod:2499
20018 #: ../fish/guestfish-actions.pod:2501
20021 " mke2fs-JU fstype blocksize device uuid\n"
20026 #: ../fish/guestfish-actions.pod:2506
20027 msgid "See also L</mke2journal-U>."
20031 #: ../fish/guestfish-actions.pod:2508
20032 msgid "mke2journal"
20036 #: ../fish/guestfish-actions.pod:2510
20039 " mke2journal blocksize device\n"
20044 #: ../fish/guestfish-actions.pod:2517
20045 msgid "mke2journal-L"
20049 #: ../fish/guestfish-actions.pod:2519
20052 " mke2journal-L blocksize label device\n"
20057 #: ../fish/guestfish-actions.pod:2523
20058 msgid "mke2journal-U"
20062 #: ../fish/guestfish-actions.pod:2525
20065 " mke2journal-U blocksize uuid device\n"
20070 #: ../fish/guestfish-actions.pod:2529
20075 #: ../fish/guestfish-actions.pod:2531
20078 " mkfifo mode path\n"
20083 #: ../fish/guestfish-actions.pod:2533
20085 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
20086 "is just a convenient wrapper around L</mknod>."
20090 #: ../fish/guestfish-actions.pod:2539
20095 #: ../fish/guestfish-actions.pod:2541
20098 " mkfs fstype device\n"
20103 #: ../fish/guestfish-actions.pod:2547
20108 #: ../fish/guestfish-actions.pod:2549
20111 " mkfs-b fstype blocksize device\n"
20116 #: ../fish/guestfish-actions.pod:2551
20118 "This call is similar to L</mkfs>, but it allows you to control the block "
20119 "size of the resulting filesystem. Supported block sizes depend on the "
20120 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
20124 #: ../fish/guestfish-actions.pod:2559
20125 msgid "mkmountpoint"
20129 #: ../fish/guestfish-actions.pod:2561
20132 " mkmountpoint exemptpath\n"
20137 #: ../fish/guestfish-actions.pod:2563
20139 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
20140 "to create extra mountpoints before mounting the first filesystem."
20144 #: ../fish/guestfish-actions.pod:2587
20146 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
20147 "unexpected errors if you try to mix these calls. It is safest to manually "
20148 "unmount filesystems and remove mountpoints after use."
20152 #: ../fish/guestfish-actions.pod:2591
20154 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
20155 "for this to work for manual mountpoints, you must ensure that the innermost "
20156 "mountpoints have the longest pathnames, as in the example code above."
20160 #: ../fish/guestfish-actions.pod:2598
20162 "Autosync [see L</set-autosync>, this is set by default on handles] means "
20163 "that L</umount-all> is called when the handle is closed which can also "
20164 "trigger these issues."
20168 #: ../fish/guestfish-actions.pod:2602
20173 #: ../fish/guestfish-actions.pod:2604
20176 " mknod mode devmajor devminor path\n"
20181 #: ../fish/guestfish-actions.pod:2614
20183 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
20184 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
20185 "regular file). These constants are available in the standard Linux header "
20186 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
20187 "wrappers around this command which bitwise OR in the appropriate constant "
20192 #: ../fish/guestfish-actions.pod:2624
20197 #: ../fish/guestfish-actions.pod:2626
20200 " mknod-b mode devmajor devminor path\n"
20205 #: ../fish/guestfish-actions.pod:2628
20207 "This call creates a block device node called C<path> with mode C<mode> and "
20208 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20209 "wrapper around L</mknod>."
20213 #: ../fish/guestfish-actions.pod:2634
20218 #: ../fish/guestfish-actions.pod:2636
20221 " mknod-c mode devmajor devminor path\n"
20226 #: ../fish/guestfish-actions.pod:2638
20228 "This call creates a char device node called C<path> with mode C<mode> and "
20229 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
20230 "wrapper around L</mknod>."
20234 #: ../fish/guestfish-actions.pod:2644
20239 #: ../fish/guestfish-actions.pod:2646
20247 #: ../fish/guestfish-actions.pod:2650
20252 #: ../fish/guestfish-actions.pod:2652
20255 " mkswap-L label device\n"
20260 #: ../fish/guestfish-actions.pod:2660
20265 #: ../fish/guestfish-actions.pod:2662
20268 " mkswap-U uuid device\n"
20273 #: ../fish/guestfish-actions.pod:2666
20274 msgid "mkswap-file"
20278 #: ../fish/guestfish-actions.pod:2668
20281 " mkswap-file path\n"
20286 #: ../fish/guestfish-actions.pod:2672
20288 "This command just writes a swap file signature to an existing file. To "
20289 "create the file itself, use something like L</fallocate>."
20293 #: ../fish/guestfish-actions.pod:2675
20298 #: ../fish/guestfish-actions.pod:2677
20301 " modprobe modulename\n"
20306 #: ../fish/guestfish-actions.pod:2684
20311 #: ../fish/guestfish-actions.pod:2686
20314 " mount device mountpoint\n"
20319 #: ../fish/guestfish-actions.pod:2702
20321 "B<Important note:> When you use this call, the filesystem options C<sync> "
20322 "and C<noatime> are set implicitly. This was originally done because we "
20323 "thought it would improve reliability, but it turns out that I<-o sync> has a "
20324 "very large negative performance impact and negligible effect on "
20325 "reliability. Therefore we recommend that you avoid using L</mount> in any "
20326 "code that needs performance, and instead use L</mount-options> (use an empty "
20327 "string for the first parameter if you don't want any options)."
20331 #: ../fish/guestfish-actions.pod:2712
20336 #: ../fish/guestfish-actions.pod:2714
20339 " mount-loop file mountpoint\n"
20344 #: ../fish/guestfish-actions.pod:2720
20345 msgid "mount-options"
20349 #: ../fish/guestfish-actions.pod:2722
20352 " mount-options options device mountpoint\n"
20357 #: ../fish/guestfish-actions.pod:2724
20359 "This is the same as the L</mount> command, but it allows you to set the "
20360 "mount options as for the L<mount(8)> I<-o> flag."
20364 #: ../fish/guestfish-actions.pod:2732
20369 #: ../fish/guestfish-actions.pod:2734
20372 " mount-ro device mountpoint\n"
20377 #: ../fish/guestfish-actions.pod:2736
20379 "This is the same as the L</mount> command, but it mounts the filesystem with "
20380 "the read-only (I<-o ro>) flag."
20384 #: ../fish/guestfish-actions.pod:2739
20389 #: ../fish/guestfish-actions.pod:2741
20392 " mount-vfs options vfstype device mountpoint\n"
20397 #: ../fish/guestfish-actions.pod:2743
20399 "This is the same as the L</mount> command, but it allows you to set both the "
20400 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
20404 #: ../fish/guestfish-actions.pod:2747
20405 msgid "mountpoints"
20409 #: ../fish/guestfish-actions.pod:2749
20417 #: ../fish/guestfish-actions.pod:2751
20419 "This call is similar to L</mounts>. That call returns a list of devices. "
20420 "This one returns a hash table (map) of device name to directory where the "
20421 "device is mounted."
20425 #: ../fish/guestfish-actions.pod:2755
20430 #: ../fish/guestfish-actions.pod:2757
20438 #: ../fish/guestfish-actions.pod:2764
20439 msgid "See also: L</mountpoints>"
20443 #: ../fish/guestfish-actions.pod:2766
20448 #: ../fish/guestfish-actions.pod:2768
20456 #: ../fish/guestfish-actions.pod:2773
20457 msgid "ntfs-3g-probe"
20461 #: ../fish/guestfish-actions.pod:2775
20464 " ntfs-3g-probe true|false device\n"
20469 #: ../fish/guestfish-actions.pod:2789
20474 #: ../fish/guestfish-actions.pod:2791
20477 " ntfsresize device\n"
20482 #: ../fish/guestfish-actions.pod:2797
20483 msgid "ntfsresize-size"
20487 #: ../fish/guestfish-actions.pod:2799
20490 " ntfsresize-size device size\n"
20495 #: ../fish/guestfish-actions.pod:2801
20497 "This command is the same as L</ntfsresize> except that it allows you to "
20498 "specify the new size (in bytes) explicitly."
20502 #: ../fish/guestfish-actions.pod:2804
20507 #: ../fish/guestfish-actions.pod:2806
20510 " part-add device prlogex startsect endsect\n"
20515 #: ../fish/guestfish-actions.pod:2808
20517 "This command adds a partition to C<device>. If there is no partition table "
20518 "on the device, call L</part-init> first."
20522 #: ../fish/guestfish-actions.pod:2820
20524 "Creating a partition which covers the whole disk is not so easy. Use "
20525 "L</part-disk> to do that."
20529 #: ../fish/guestfish-actions.pod:2823
20534 #: ../fish/guestfish-actions.pod:2825
20537 " part-del device partnum\n"
20542 #: ../fish/guestfish-actions.pod:2833
20547 #: ../fish/guestfish-actions.pod:2835
20550 " part-disk device parttype\n"
20555 #: ../fish/guestfish-actions.pod:2837
20557 "This command is simply a combination of L</part-init> followed by "
20558 "L</part-add> to create a single primary partition covering the whole disk."
20562 #: ../fish/guestfish-actions.pod:2841
20564 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
20565 "possible values are described in L</part-init>."
20569 #: ../fish/guestfish-actions.pod:2847
20570 msgid "part-get-bootable"
20574 #: ../fish/guestfish-actions.pod:2849
20577 " part-get-bootable device partnum\n"
20582 #: ../fish/guestfish-actions.pod:2854
20583 msgid "See also L</part-set-bootable>."
20587 #: ../fish/guestfish-actions.pod:2856
20588 msgid "part-get-mbr-id"
20592 #: ../fish/guestfish-actions.pod:2858
20595 " part-get-mbr-id device partnum\n"
20600 #: ../fish/guestfish-actions.pod:2863 ../fish/guestfish-actions.pod:3001
20602 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
20603 "undefined results for other partition table types (see "
20604 "L</part-get-parttype>)."
20608 #: ../fish/guestfish-actions.pod:2867
20609 msgid "part-get-parttype"
20613 #: ../fish/guestfish-actions.pod:2869
20616 " part-get-parttype device\n"
20621 #: ../fish/guestfish-actions.pod:2874
20623 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
20624 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
20625 "possible, although unusual. See L</part-init> for a full list."
20629 #: ../fish/guestfish-actions.pod:2879
20634 #: ../fish/guestfish-actions.pod:2881
20637 " part-init device parttype\n"
20642 #: ../fish/guestfish-actions.pod:2887
20644 "Initially there are no partitions. Following this, you should call "
20645 "L</part-add> for each partition required."
20649 #: ../fish/guestfish-actions.pod:2950
20654 #: ../fish/guestfish-actions.pod:2952
20657 " part-list device\n"
20662 #: ../fish/guestfish-actions.pod:2967
20664 "Start of the partition I<in bytes>. To get sectors you have to divide by "
20665 "the device's sector size, see L</blockdev-getss>."
20669 #: ../fish/guestfish-actions.pod:2980
20670 msgid "part-set-bootable"
20674 #: ../fish/guestfish-actions.pod:2982
20677 " part-set-bootable device partnum true|false\n"
20682 #: ../fish/guestfish-actions.pod:2991
20683 msgid "part-set-mbr-id"
20687 #: ../fish/guestfish-actions.pod:2993
20690 " part-set-mbr-id device partnum idbyte\n"
20695 #: ../fish/guestfish-actions.pod:3005
20696 msgid "part-set-name"
20700 #: ../fish/guestfish-actions.pod:3007
20703 " part-set-name device partnum name\n"
20708 #: ../fish/guestfish-actions.pod:3015
20709 msgid "part-to-dev"
20713 #: ../fish/guestfish-actions.pod:3017
20716 " part-to-dev partition\n"
20721 #: ../fish/guestfish-actions.pod:3023
20723 "The named partition must exist, for example as a string returned from "
20724 "L</list-partitions>."
20728 #: ../fish/guestfish-actions.pod:3026
20729 msgid "ping-daemon"
20733 #: ../fish/guestfish-actions.pod:3028
20741 #: ../fish/guestfish-actions.pod:3035
20746 #: ../fish/guestfish-actions.pod:3037
20749 " pread path count offset\n"
20754 #: ../fish/guestfish-actions.pod:3045
20755 msgid "See also L</pwrite>, L</pread-device>."
20759 #: ../fish/guestfish-actions.pod:3050
20760 msgid "pread-device"
20764 #: ../fish/guestfish-actions.pod:3052
20767 " pread-device device count offset\n"
20772 #: ../fish/guestfish-actions.pod:3060
20773 msgid "See also L</pread>."
20777 #: ../fish/guestfish-actions.pod:3065
20782 #: ../fish/guestfish-actions.pod:3067
20785 " pvcreate device\n"
20790 #: ../fish/guestfish-actions.pod:3073
20795 #: ../fish/guestfish-actions.pod:3075
20798 " pvremove device\n"
20803 #: ../fish/guestfish-actions.pod:3084
20808 #: ../fish/guestfish-actions.pod:3086
20811 " pvresize device\n"
20816 #: ../fish/guestfish-actions.pod:3091
20817 msgid "pvresize-size"
20821 #: ../fish/guestfish-actions.pod:3093
20824 " pvresize-size device size\n"
20829 #: ../fish/guestfish-actions.pod:3095
20831 "This command is the same as L</pvresize> except that it allows you to "
20832 "specify the new size (in bytes) explicitly."
20836 #: ../fish/guestfish-actions.pod:3098
20841 #: ../fish/guestfish-actions.pod:3100
20849 #: ../fish/guestfish-actions.pod:3108
20850 msgid "See also L</pvs-full>."
20854 #: ../fish/guestfish-actions.pod:3110
20859 #: ../fish/guestfish-actions.pod:3112
20867 #: ../fish/guestfish-actions.pod:3117
20872 #: ../fish/guestfish-actions.pod:3119
20880 #: ../fish/guestfish-actions.pod:3123
20885 #: ../fish/guestfish-actions.pod:3125
20888 " pwrite path content offset\n"
20893 #: ../fish/guestfish-actions.pod:3136
20894 msgid "See also L</pread>, L</pwrite-device>."
20898 #: ../fish/guestfish-actions.pod:3141
20899 msgid "pwrite-device"
20903 #: ../fish/guestfish-actions.pod:3143
20906 " pwrite-device device content offset\n"
20911 #: ../fish/guestfish-actions.pod:3153
20912 msgid "See also L</pwrite>."
20916 #: ../fish/guestfish-actions.pod:3158
20921 #: ../fish/guestfish-actions.pod:3160
20924 " read-file path\n"
20929 #: ../fish/guestfish-actions.pod:3165
20931 "Unlike L</cat>, this function can correctly handle files that contain "
20932 "embedded ASCII NUL characters. However unlike L</download>, this function "
20933 "is limited in the total size of file that can be handled."
20937 #: ../fish/guestfish-actions.pod:3173
20942 #: ../fish/guestfish-actions.pod:3175
20945 " read-lines path\n"
20950 #: ../fish/guestfish-actions.pod:3182
20952 "Note that this function cannot correctly handle binary files (specifically, "
20953 "files containing C<\\0> character which is treated as end of line). For "
20954 "those you need to use the L</read-file> function which has a more complex "
20959 #: ../fish/guestfish-actions.pod:3187
20964 #: ../fish/guestfish-actions.pod:3189
20972 #: ../fish/guestfish-actions.pod:3241
20974 "This function is primarily intended for use by programs. To get a simple "
20975 "list of names, use L</ls>. To get a printable directory for human "
20976 "consumption, use L</ll>."
20980 #: ../fish/guestfish-actions.pod:3245
20985 #: ../fish/guestfish-actions.pod:3247
20993 #: ../fish/guestfish-actions.pod:3251
20994 msgid "readlinklist"
20998 #: ../fish/guestfish-actions.pod:3253
21001 " readlinklist path 'names ...'\n"
21006 #: ../fish/guestfish-actions.pod:3277
21011 #: ../fish/guestfish-actions.pod:3279
21019 #: ../fish/guestfish-actions.pod:3284
21020 msgid "removexattr"
21024 #: ../fish/guestfish-actions.pod:3286
21027 " removexattr xattr path\n"
21032 #: ../fish/guestfish-actions.pod:3291
21033 msgid "See also: L</lremovexattr>, L<attr(5)>."
21037 #: ../fish/guestfish-actions.pod:3293
21042 #: ../fish/guestfish-actions.pod:3295
21045 " resize2fs device\n"
21050 #: ../fish/guestfish-actions.pod:3300
21052 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
21053 "before calling this command. For unknown reasons C<resize2fs> sometimes "
21054 "gives an error about this and sometimes not. In any case, it is always safe "
21055 "to call L</e2fsck-f> before calling this function."
21059 #: ../fish/guestfish-actions.pod:3306
21060 msgid "resize2fs-size"
21064 #: ../fish/guestfish-actions.pod:3308
21067 " resize2fs-size device size\n"
21072 #: ../fish/guestfish-actions.pod:3310
21074 "This command is the same as L</resize2fs> except that it allows you to "
21075 "specify the new size (in bytes) explicitly."
21079 #: ../fish/guestfish-actions.pod:3313
21084 #: ../fish/guestfish-actions.pod:3315
21092 #: ../fish/guestfish-actions.pod:3319
21097 #: ../fish/guestfish-actions.pod:3321
21105 #: ../fish/guestfish-actions.pod:3327
21110 #: ../fish/guestfish-actions.pod:3329
21118 #: ../fish/guestfish-actions.pod:3333
21119 msgid "rmmountpoint"
21123 #: ../fish/guestfish-actions.pod:3335
21126 " rmmountpoint exemptpath\n"
21131 #: ../fish/guestfish-actions.pod:3337
21133 "This calls removes a mountpoint that was previously created with "
21134 "L</mkmountpoint>. See L</mkmountpoint> for full details."
21138 #: ../fish/guestfish-actions.pod:3341
21139 msgid "scrub-device"
21143 #: ../fish/guestfish-actions.pod:3343
21146 " scrub-device device\n"
21151 #: ../fish/guestfish-actions.pod:3354
21156 #: ../fish/guestfish-actions.pod:3356
21159 " scrub-file file\n"
21164 #: ../fish/guestfish-actions.pod:3366
21165 msgid "scrub-freespace"
21169 #: ../fish/guestfish-actions.pod:3368
21172 " scrub-freespace dir\n"
21177 #: ../fish/guestfish-actions.pod:3370
21179 "This command creates the directory C<dir> and then fills it with files until "
21180 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
21181 "deletes them. The intention is to scrub any free space on the partition "
21182 "containing C<dir>."
21186 #: ../fish/guestfish-actions.pod:3379
21191 #: ../fish/guestfish-actions.pod:3381
21196 #: ../fish/guestfish-actions.pod:3383
21199 " set-append append\n"
21204 #: ../fish/guestfish-actions.pod:3394
21205 msgid "set-autosync"
21209 #: ../fish/guestfish-actions.pod:3396
21214 #: ../fish/guestfish-actions.pod:3398
21217 " set-autosync true|false\n"
21222 #: ../fish/guestfish-actions.pod:3400
21224 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
21225 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
21226 "closed (also if the program exits without closing handles)."
21230 #: ../fish/guestfish-actions.pod:3408
21235 #: ../fish/guestfish-actions.pod:3410
21240 #: ../fish/guestfish-actions.pod:3412
21243 " set-direct true|false\n"
21248 #: ../fish/guestfish-actions.pod:3418
21250 "One consequence of this is that log messages aren't caught by the library "
21251 "and handled by L</set-log-message-callback>, but go straight to stdout."
21255 #: ../fish/guestfish-actions.pod:3427
21256 msgid "set-e2label"
21260 #: ../fish/guestfish-actions.pod:3429
21263 " set-e2label device label\n"
21268 #: ../fish/guestfish-actions.pod:3435
21270 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
21271 "label on a filesystem."
21275 #: ../fish/guestfish-actions.pod:3438
21280 #: ../fish/guestfish-actions.pod:3440
21283 " set-e2uuid device uuid\n"
21288 #: ../fish/guestfish-actions.pod:3447
21290 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
21291 "UUID of a filesystem."
21295 #: ../fish/guestfish-actions.pod:3450
21296 msgid "set-memsize"
21300 #: ../fish/guestfish-actions.pod:3452
21305 #: ../fish/guestfish-actions.pod:3454
21308 " set-memsize memsize\n"
21313 #: ../fish/guestfish-actions.pod:3456
21315 "This sets the memory size in megabytes allocated to the qemu subprocess. "
21316 "This only has any effect if called before L</launch>."
21320 #: ../fish/guestfish-actions.pod:3467
21321 msgid "set-network"
21325 #: ../fish/guestfish-actions.pod:3469
21330 #: ../fish/guestfish-actions.pod:3471
21333 " set-network true|false\n"
21338 #: ../fish/guestfish-actions.pod:3479
21339 msgid "You must call this before calling L</launch>, otherwise it has no effect."
21343 #: ../fish/guestfish-actions.pod:3482
21348 #: ../fish/guestfish-actions.pod:3484
21353 #: ../fish/guestfish-actions.pod:3486
21356 " set-path searchpath\n"
21361 #: ../fish/guestfish-actions.pod:3495
21366 #: ../fish/guestfish-actions.pod:3497
21371 #: ../fish/guestfish-actions.pod:3499
21379 #: ../fish/guestfish-actions.pod:3519
21380 msgid "set-recovery-proc"
21384 #: ../fish/guestfish-actions.pod:3521
21385 msgid "recovery-proc"
21389 #: ../fish/guestfish-actions.pod:3523
21392 " set-recovery-proc true|false\n"
21397 #: ../fish/guestfish-actions.pod:3525
21399 "If this is called with the parameter C<false> then L</launch> does not "
21400 "create a recovery process. The purpose of the recovery process is to stop "
21401 "runaway qemu processes in the case where the main program aborts abruptly."
21405 #: ../fish/guestfish-actions.pod:3530
21407 "This only has any effect if called before L</launch>, and the default is "
21412 #: ../fish/guestfish-actions.pod:3539
21413 msgid "set-selinux"
21417 #: ../fish/guestfish-actions.pod:3541
21422 #: ../fish/guestfish-actions.pod:3543
21425 " set-selinux true|false\n"
21430 #: ../fish/guestfish-actions.pod:3554
21435 #: ../fish/guestfish-actions.pod:3556
21440 #: ../fish/guestfish-actions.pod:3558
21443 " set-trace true|false\n"
21448 #: ../fish/guestfish-actions.pod:3574
21449 msgid "set-verbose"
21453 #: ../fish/guestfish-actions.pod:3576
21458 #: ../fish/guestfish-actions.pod:3578
21461 " set-verbose true|false\n"
21466 #: ../fish/guestfish-actions.pod:3585
21471 #: ../fish/guestfish-actions.pod:3587
21474 " setcon context\n"
21479 #: ../fish/guestfish-actions.pod:3594
21484 #: ../fish/guestfish-actions.pod:3596
21487 " setxattr xattr val vallen path\n"
21492 #: ../fish/guestfish-actions.pod:3602
21493 msgid "See also: L</lsetxattr>, L<attr(5)>."
21497 #: ../fish/guestfish-actions.pod:3604
21502 #: ../fish/guestfish-actions.pod:3606
21505 " sfdisk device cyls heads sectors 'lines ...'\n"
21510 #: ../fish/guestfish-actions.pod:3628
21511 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
21515 #: ../fish/guestfish-actions.pod:3634
21520 #: ../fish/guestfish-actions.pod:3636
21523 " sfdiskM device 'lines ...'\n"
21528 #: ../fish/guestfish-actions.pod:3638
21530 "This is a simplified interface to the L</sfdisk> command, where partition "
21531 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
21532 "you don't need to specify the cyls, heads and sectors parameters which were "
21533 "rarely if ever used anyway."
21537 #: ../fish/guestfish-actions.pod:3644
21538 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
21542 #: ../fish/guestfish-actions.pod:3650
21547 #: ../fish/guestfish-actions.pod:3652
21550 " sfdisk-N device partnum cyls heads sectors line\n"
21555 #: ../fish/guestfish-actions.pod:3657
21557 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
21558 "cyls/heads/sectors parameters."
21562 #: ../fish/guestfish-actions.pod:3660
21563 msgid "See also: L</part-add>"
21567 #: ../fish/guestfish-actions.pod:3665
21568 msgid "sfdisk-disk-geometry"
21572 #: ../fish/guestfish-actions.pod:3667
21575 " sfdisk-disk-geometry device\n"
21580 #: ../fish/guestfish-actions.pod:3669
21582 "This displays the disk geometry of C<device> read from the partition table. "
21583 "Especially in the case where the underlying block device has been resized, "
21584 "this can be different from the kernel's idea of the geometry (see "
21585 "L</sfdisk-kernel-geometry>)."
21589 #: ../fish/guestfish-actions.pod:3677
21590 msgid "sfdisk-kernel-geometry"
21594 #: ../fish/guestfish-actions.pod:3679
21597 " sfdisk-kernel-geometry device\n"
21602 #: ../fish/guestfish-actions.pod:3686
21607 #: ../fish/guestfish-actions.pod:3688
21610 " sfdisk-l device\n"
21615 #: ../fish/guestfish-actions.pod:3694
21616 msgid "See also: L</part-list>"
21620 #: ../fish/guestfish-actions.pod:3696
21625 #: ../fish/guestfish-actions.pod:3698
21633 #: ../fish/guestfish-actions.pod:3703
21634 msgid "This is like L</command>, but passes the command to:"
21638 #: ../fish/guestfish-actions.pod:3711
21639 msgid "All the provisos about L</command> apply to this call."
21643 #: ../fish/guestfish-actions.pod:3713
21648 #: ../fish/guestfish-actions.pod:3715
21651 " sh-lines command\n"
21656 #: ../fish/guestfish-actions.pod:3717
21657 msgid "This is the same as L</sh>, but splits the result into a list of lines."
21661 #: ../fish/guestfish-actions.pod:3720
21662 msgid "See also: L</command-lines>"
21666 #: ../fish/guestfish-actions.pod:3722
21671 #: ../fish/guestfish-actions.pod:3724
21679 #: ../fish/guestfish-actions.pod:3728
21684 #: ../fish/guestfish-actions.pod:3730
21692 #: ../fish/guestfish-actions.pod:3736
21697 #: ../fish/guestfish-actions.pod:3738
21705 #: ../fish/guestfish-actions.pod:3746
21710 #: ../fish/guestfish-actions.pod:3748
21718 #: ../fish/guestfish-actions.pod:3756
21723 #: ../fish/guestfish-actions.pod:3758
21726 " strings-e encoding path\n"
21731 #: ../fish/guestfish-actions.pod:3760
21733 "This is like the L</strings> command, but allows you to specify the encoding "
21734 "of strings that are looked for in the source file C<path>."
21738 #: ../fish/guestfish-actions.pod:3770
21740 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
21741 "ISO-8859-X (this is what L</strings> uses)."
21745 #: ../fish/guestfish-actions.pod:3802
21746 msgid "swapoff-device"
21750 #: ../fish/guestfish-actions.pod:3804
21753 " swapoff-device device\n"
21758 #: ../fish/guestfish-actions.pod:3806
21760 "This command disables the libguestfs appliance swap device or partition "
21761 "named C<device>. See L</swapon-device>."
21765 #: ../fish/guestfish-actions.pod:3810
21766 msgid "swapoff-file"
21770 #: ../fish/guestfish-actions.pod:3812
21773 " swapoff-file file\n"
21778 #: ../fish/guestfish-actions.pod:3816
21779 msgid "swapoff-label"
21783 #: ../fish/guestfish-actions.pod:3818
21786 " swapoff-label label\n"
21791 #: ../fish/guestfish-actions.pod:3823
21792 msgid "swapoff-uuid"
21796 #: ../fish/guestfish-actions.pod:3825
21799 " swapoff-uuid uuid\n"
21804 #: ../fish/guestfish-actions.pod:3830
21805 msgid "swapon-device"
21809 #: ../fish/guestfish-actions.pod:3832
21812 " swapon-device device\n"
21817 #: ../fish/guestfish-actions.pod:3834
21819 "This command enables the libguestfs appliance to use the swap device or "
21820 "partition named C<device>. The increased memory is made available for all "
21821 "commands, for example those run using L</command> or L</sh>."
21825 #: ../fish/guestfish-actions.pod:3846
21826 msgid "swapon-file"
21830 #: ../fish/guestfish-actions.pod:3848
21833 " swapon-file file\n"
21838 #: ../fish/guestfish-actions.pod:3850
21839 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
21843 #: ../fish/guestfish-actions.pod:3853
21844 msgid "swapon-label"
21848 #: ../fish/guestfish-actions.pod:3855
21851 " swapon-label label\n"
21856 #: ../fish/guestfish-actions.pod:3857
21858 "This command enables swap to a labeled swap partition. See "
21859 "L</swapon-device> for other notes."
21863 #: ../fish/guestfish-actions.pod:3860
21864 msgid "swapon-uuid"
21868 #: ../fish/guestfish-actions.pod:3862
21871 " swapon-uuid uuid\n"
21876 #: ../fish/guestfish-actions.pod:3864
21878 "This command enables swap to a swap partition with the given UUID. See "
21879 "L</swapon-device> for other notes."
21883 #: ../fish/guestfish-actions.pod:3867
21888 #: ../fish/guestfish-actions.pod:3869
21896 #: ../fish/guestfish-actions.pod:3877
21901 #: ../fish/guestfish-actions.pod:3879
21909 #: ../fish/guestfish-actions.pod:3887
21914 #: ../fish/guestfish-actions.pod:3889
21917 " tail-n nrlines path\n"
21922 #: ../fish/guestfish-actions.pod:3902
21927 #: ../fish/guestfish-actions.pod:3904
21930 " tar-in (tarfile|-) directory\n"
21935 #: ../fish/guestfish-actions.pod:3909
21936 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
21940 #: ../fish/guestfish-actions.pod:3914
21945 #: ../fish/guestfish-actions.pod:3916
21948 " tar-out directory (tarfile|-)\n"
21953 #: ../fish/guestfish-actions.pod:3921
21954 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
21958 #: ../fish/guestfish-actions.pod:3926
21963 #: ../fish/guestfish-actions.pod:3928
21966 " tgz-in (tarball|-) directory\n"
21971 #: ../fish/guestfish-actions.pod:3933
21972 msgid "To upload an uncompressed tarball, use L</tar-in>."
21976 #: ../fish/guestfish-actions.pod:3937
21981 #: ../fish/guestfish-actions.pod:3939
21984 " tgz-out directory (tarball|-)\n"
21989 #: ../fish/guestfish-actions.pod:3944
21990 msgid "To download an uncompressed tarball, use L</tar-out>."
21994 #: ../fish/guestfish-actions.pod:3948
21999 #: ../fish/guestfish-actions.pod:3950
22007 #: ../fish/guestfish-actions.pod:3959
22012 #: ../fish/guestfish-actions.pod:3961
22020 #: ../fish/guestfish-actions.pod:3966
22021 msgid "truncate-size"
22025 #: ../fish/guestfish-actions.pod:3968
22028 " truncate-size path size\n"
22033 #: ../fish/guestfish-actions.pod:3973
22035 "If the current file size is less than C<size> then the file is extended to "
22036 "the required size with zero bytes. This creates a sparse file (ie. disk "
22037 "blocks are not allocated for the file until you write to it). To create a "
22038 "non-sparse file of zeroes, use L</fallocate64> instead."
22042 #: ../fish/guestfish-actions.pod:3979
22047 #: ../fish/guestfish-actions.pod:3981
22050 " tune2fs-l device\n"
22055 #: ../fish/guestfish-actions.pod:3991
22060 #: ../fish/guestfish-actions.pod:3993
22063 " txz-in (tarball|-) directory\n"
22068 #: ../fish/guestfish-actions.pod:4000
22073 #: ../fish/guestfish-actions.pod:4002
22076 " txz-out directory (tarball|-)\n"
22081 #: ../fish/guestfish-actions.pod:4009
22086 #: ../fish/guestfish-actions.pod:4011
22094 #: ../fish/guestfish-actions.pod:4025
22095 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
22099 #: ../fish/guestfish-actions.pod:4030
22104 #: ../fish/guestfish-actions.pod:4032
22109 #: ../fish/guestfish-actions.pod:4034
22112 " umount pathordevice\n"
22117 #: ../fish/guestfish-actions.pod:4040
22122 #: ../fish/guestfish-actions.pod:4042
22123 msgid "unmount-all"
22127 #: ../fish/guestfish-actions.pod:4044
22135 #: ../fish/guestfish-actions.pod:4050
22140 #: ../fish/guestfish-actions.pod:4052
22143 " upload (filename|-) remotefilename\n"
22148 #: ../fish/guestfish-actions.pod:4059
22149 msgid "See also L</download>."
22153 #: ../fish/guestfish-actions.pod:4063
22154 msgid "upload-offset"
22158 #: ../fish/guestfish-actions.pod:4065
22161 " upload-offset (filename|-) remotefilename offset\n"
22166 #: ../fish/guestfish-actions.pod:4077
22168 "Note that there is no limit on the amount of data that can be uploaded with "
22169 "this call, unlike with L</pwrite>, and this call always writes the full "
22170 "amount unless an error occurs."
22174 #: ../fish/guestfish-actions.pod:4082
22175 msgid "See also L</upload>, L</pwrite>."
22179 #: ../fish/guestfish-actions.pod:4086
22184 #: ../fish/guestfish-actions.pod:4088
22187 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
22192 #: ../fish/guestfish-actions.pod:4107
22197 #: ../fish/guestfish-actions.pod:4109
22205 #: ../fish/guestfish-actions.pod:4136
22207 "I<Note:> Don't use this call to test for availability of features. In "
22208 "enterprise distributions we backport features from later versions into "
22209 "earlier versions, making this an unreliable way to test for features. Use "
22210 "L</available> instead."
22214 #: ../fish/guestfish-actions.pod:4142
22219 #: ../fish/guestfish-actions.pod:4144
22222 " vfs-label device\n"
22227 #: ../fish/guestfish-actions.pod:4151
22228 msgid "To find a filesystem from the label, use L</findfs-label>."
22232 #: ../fish/guestfish-actions.pod:4153
22237 #: ../fish/guestfish-actions.pod:4155
22240 " vfs-type device\n"
22245 #: ../fish/guestfish-actions.pod:4165
22250 #: ../fish/guestfish-actions.pod:4167
22253 " vfs-uuid device\n"
22258 #: ../fish/guestfish-actions.pod:4174
22259 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
22263 #: ../fish/guestfish-actions.pod:4176
22264 msgid "vg-activate"
22268 #: ../fish/guestfish-actions.pod:4178
22271 " vg-activate true|false 'volgroups ...'\n"
22276 #: ../fish/guestfish-actions.pod:4191
22277 msgid "vg-activate-all"
22281 #: ../fish/guestfish-actions.pod:4193
22284 " vg-activate-all true|false\n"
22289 #: ../fish/guestfish-actions.pod:4203
22294 #: ../fish/guestfish-actions.pod:4205
22297 " vgcreate volgroup 'physvols ...'\n"
22302 #: ../fish/guestfish-actions.pod:4210
22307 #: ../fish/guestfish-actions.pod:4212
22310 " vglvuuids vgname\n"
22315 #: ../fish/guestfish-actions.pod:4217
22317 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
22318 "logical volumes and volume groups."
22322 #: ../fish/guestfish-actions.pod:4220
22323 msgid "See also L</vgpvuuids>."
22327 #: ../fish/guestfish-actions.pod:4222
22332 #: ../fish/guestfish-actions.pod:4224
22335 " vgpvuuids vgname\n"
22340 #: ../fish/guestfish-actions.pod:4229
22342 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
22343 "physical volumes and volume groups."
22347 #: ../fish/guestfish-actions.pod:4232
22348 msgid "See also L</vglvuuids>."
22352 #: ../fish/guestfish-actions.pod:4234
22357 #: ../fish/guestfish-actions.pod:4236
22360 " vgremove vgname\n"
22365 #: ../fish/guestfish-actions.pod:4243
22370 #: ../fish/guestfish-actions.pod:4245
22373 " vgrename volgroup newvolgroup\n"
22378 #: ../fish/guestfish-actions.pod:4249
22383 #: ../fish/guestfish-actions.pod:4251
22391 #: ../fish/guestfish-actions.pod:4259
22392 msgid "See also L</vgs-full>."
22396 #: ../fish/guestfish-actions.pod:4261
22401 #: ../fish/guestfish-actions.pod:4263
22409 #: ../fish/guestfish-actions.pod:4268
22414 #: ../fish/guestfish-actions.pod:4270
22422 #: ../fish/guestfish-actions.pod:4275
22427 #: ../fish/guestfish-actions.pod:4277
22435 #: ../fish/guestfish-actions.pod:4281
22440 #: ../fish/guestfish-actions.pod:4283
22448 #: ../fish/guestfish-actions.pod:4288
22453 #: ../fish/guestfish-actions.pod:4290
22461 #: ../fish/guestfish-actions.pod:4295
22466 #: ../fish/guestfish-actions.pod:4297
22474 #: ../fish/guestfish-actions.pod:4302
22479 #: ../fish/guestfish-actions.pod:4304
22482 " write path content\n"
22487 #: ../fish/guestfish-actions.pod:4312
22492 #: ../fish/guestfish-actions.pod:4314
22495 " write-file path content size\n"
22500 #: ../fish/guestfish-actions.pod:4337
22505 #: ../fish/guestfish-actions.pod:4339
22508 " zegrep regex path\n"
22513 #: ../fish/guestfish-actions.pod:4347
22518 #: ../fish/guestfish-actions.pod:4349
22521 " zegrepi regex path\n"
22526 #: ../fish/guestfish-actions.pod:4357
22531 #: ../fish/guestfish-actions.pod:4359
22539 #: ../fish/guestfish-actions.pod:4367
22540 msgid "See also: L</zero-device>, L</scrub-device>."
22544 #: ../fish/guestfish-actions.pod:4369
22545 msgid "zero-device"
22549 #: ../fish/guestfish-actions.pod:4371
22552 " zero-device device\n"
22557 #: ../fish/guestfish-actions.pod:4373
22559 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
22560 "which just zeroes the first few blocks of a device."
22564 #: ../fish/guestfish-actions.pod:4380
22569 #: ../fish/guestfish-actions.pod:4382
22572 " zerofree device\n"
22577 #: ../fish/guestfish-actions.pod:4395
22582 #: ../fish/guestfish-actions.pod:4397
22585 " zfgrep pattern path\n"
22590 #: ../fish/guestfish-actions.pod:4405
22595 #: ../fish/guestfish-actions.pod:4407
22598 " zfgrepi pattern path\n"
22603 #: ../fish/guestfish-actions.pod:4415
22608 #: ../fish/guestfish-actions.pod:4417
22611 " zfile meth path\n"
22616 #: ../fish/guestfish-actions.pod:4424
22617 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
22621 #: ../fish/guestfish-actions.pod:4434
22626 #: ../fish/guestfish-actions.pod:4436
22629 " zgrep regex path\n"
22634 #: ../fish/guestfish-actions.pod:4444
22639 #: ../fish/guestfish-actions.pod:4446
22642 " zgrepi regex path\n"
22647 #: ../fish/guestfish-commands.pod:1
22652 #: ../fish/guestfish-commands.pod:3
22657 #: ../fish/guestfish-commands.pod:5
22660 " alloc filename size\n"
22665 #: ../fish/guestfish-commands.pod:7
22667 "This creates an empty (zeroed) file of the given size, and then adds so it "
22668 "can be further examined."
22672 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
22673 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
22677 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
22678 msgid "Size can be specified using standard suffixes, eg. C<1M>."
22682 #: ../fish/guestfish-commands.pod:14
22684 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
22685 "image, see L</PREPARED DISK IMAGES>."
22689 #: ../fish/guestfish-commands.pod:17
22694 #: ../fish/guestfish-commands.pod:19
22697 " copy-in local [local ...] /remotedir\n"
22702 #: ../fish/guestfish-commands.pod:21
22704 "C<copy-in> copies local files or directories recursively into the disk "
22705 "image, placing them in the directory called C</remotedir> (which must "
22706 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
22707 "other commands as necessary."
22711 #: ../fish/guestfish-commands.pod:26
22713 "Multiple local files and directories can be specified, but the last "
22714 "parameter must always be a remote directory. Wildcards cannot be used."
22718 #: ../fish/guestfish-commands.pod:30
22723 #: ../fish/guestfish-commands.pod:32
22726 " copy-out remote [remote ...] localdir\n"
22731 #: ../fish/guestfish-commands.pod:34
22733 "C<copy-out> copies remote files or directories recursively out of the disk "
22734 "image, placing them on the host disk in a local directory called C<localdir> "
22735 "(which must exist). This guestfish meta-command turns into a sequence of "
22736 "L</download>, L</tar-out> and other commands as necessary."
22740 #: ../fish/guestfish-commands.pod:40
22742 "Multiple remote files and directories can be specified, but the last "
22743 "parameter must always be a local directory. To download to the current "
22744 "directory, use C<.> as in:"
22748 #: ../fish/guestfish-commands.pod:44
22751 " copy-out /home .\n"
22756 #: ../fish/guestfish-commands.pod:46
22758 "Wildcards cannot be used in the ordinary command, but you can use them with "
22759 "the help of L</glob> like this:"
22763 #: ../fish/guestfish-commands.pod:49
22766 " glob copy-out /home/* .\n"
22771 #: ../fish/guestfish-commands.pod:51
22776 #: ../fish/guestfish-commands.pod:53
22779 " echo [params ...]\n"
22784 #: ../fish/guestfish-commands.pod:55
22785 msgid "This echos the parameters to the terminal."
22789 #: ../fish/guestfish-commands.pod:57
22794 #: ../fish/guestfish-commands.pod:59
22799 #: ../fish/guestfish-commands.pod:61
22804 #: ../fish/guestfish-commands.pod:63
22812 #: ../fish/guestfish-commands.pod:65
22814 "This is used to edit a file. It downloads the file, edits it locally using "
22815 "your editor, then uploads the result."
22819 #: ../fish/guestfish-commands.pod:68
22821 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
22822 "or C<emacs> you will get those corresponding editors."
22826 #: ../fish/guestfish-commands.pod:72
22831 #: ../fish/guestfish-commands.pod:74
22834 " glob command args...\n"
22839 #: ../fish/guestfish-commands.pod:76
22841 "Expand wildcards in any paths in the args list, and run C<command> "
22842 "repeatedly on each matching path."
22846 #: ../fish/guestfish-commands.pod:79
22847 msgid "See L</WILDCARDS AND GLOBBING>."
22851 #: ../fish/guestfish-commands.pod:81
22856 #: ../fish/guestfish-commands.pod:83
22859 " hexedit <filename|device>\n"
22860 " hexedit <filename|device> <max>\n"
22861 " hexedit <filename|device> <start> <max>\n"
22866 #: ../fish/guestfish-commands.pod:87
22868 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
22873 #: ../fish/guestfish-commands.pod:90
22875 "This command works by downloading potentially the whole file or device, "
22876 "editing it locally, then uploading it. If the file or device is large, you "
22877 "have to specify which part you wish to edit by using C<max> and/or C<start> "
22878 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
22879 "usual modifiers allowed such as C<1M> (1 megabyte)."
22883 #: ../fish/guestfish-commands.pod:97
22884 msgid "For example to edit the first few sectors of a disk you might do:"
22888 #: ../fish/guestfish-commands.pod:100
22891 " hexedit /dev/sda 1M\n"
22896 #: ../fish/guestfish-commands.pod:102
22898 "which would allow you to edit anywhere within the first megabyte of the "
22903 #: ../fish/guestfish-commands.pod:105
22904 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
22908 #: ../fish/guestfish-commands.pod:107
22911 " hexedit /dev/sda1 0x400 0x400\n"
22916 #: ../fish/guestfish-commands.pod:109
22917 msgid "(assuming the superblock is in the standard location)."
22921 #: ../fish/guestfish-commands.pod:111
22923 "This command requires the external L<hexedit(1)> program. You can specify "
22924 "another program to use by setting the C<HEXEDITOR> environment variable."
22928 #: ../fish/guestfish-commands.pod:115
22929 msgid "See also L</hexdump>."
22933 #: ../fish/guestfish-commands.pod:117
22938 #: ../fish/guestfish-commands.pod:119
22946 #: ../fish/guestfish-commands.pod:121
22947 msgid "Change the local directory, ie. the current directory of guestfish itself."
22951 #: ../fish/guestfish-commands.pod:124
22952 msgid "Note that C<!cd> won't do what you might expect."
22956 #: ../fish/guestfish-commands.pod:126
22961 #: ../fish/guestfish-commands.pod:128
22966 #: ../fish/guestfish-commands.pod:130
22974 #: ../fish/guestfish-commands.pod:132
22975 msgid "Opens the manual page for guestfish."
22979 #: ../fish/guestfish-commands.pod:134
22984 #: ../fish/guestfish-commands.pod:136
22989 #: ../fish/guestfish-commands.pod:138
22997 #: ../fish/guestfish-commands.pod:140
23005 #: ../fish/guestfish-commands.pod:142
23006 msgid "This is used to view a file."
23010 #: ../fish/guestfish-commands.pod:144
23012 "The default viewer is C<$PAGER>. However if you use the alternate command "
23013 "C<less> you will get the C<less> command specifically."
23017 #: ../fish/guestfish-commands.pod:147
23022 #: ../fish/guestfish-commands.pod:149
23030 #: ../fish/guestfish-commands.pod:151
23032 "Close and reopen the libguestfs handle. It is not necessary to use this "
23033 "normally, because the handle is closed properly when guestfish exits. "
23034 "However this is occasionally useful for testing."
23038 #: ../fish/guestfish-commands.pod:155
23043 #: ../fish/guestfish-commands.pod:157
23046 " sparse filename size\n"
23051 #: ../fish/guestfish-commands.pod:159
23053 "This creates an empty sparse file of the given size, and then adds so it can "
23054 "be further examined."
23058 #: ../fish/guestfish-commands.pod:162
23060 "In all respects it works the same as the L</alloc> command, except that the "
23061 "image file is allocated sparsely, which means that disk blocks are not "
23062 "assigned to the file until they are needed. Sparse disk files only use "
23063 "space when written to, but they are slower and there is a danger you could "
23064 "run out of real disk space during a write operation."
23068 #: ../fish/guestfish-commands.pod:172
23073 #: ../fish/guestfish-commands.pod:174
23081 #: ../fish/guestfish-commands.pod:176
23083 "This command returns a list of the optional groups known to the daemon, and "
23084 "indicates which ones are supported by this build of the libguestfs "
23089 #: ../fish/guestfish-commands.pod:180
23090 msgid "See also L<guestfs(3)/AVAILABILITY>."
23094 #: ../fish/guestfish-commands.pod:182
23099 #: ../fish/guestfish-commands.pod:184
23102 " time command args...\n"
23107 #: ../fish/guestfish-commands.pod:186
23109 "Run the command as usual, but print the elapsed time afterwards. This can "
23110 "be useful for benchmarking operations."
23114 #: ../test-tool/libguestfs-test-tool.pod:5
23115 msgid "libguestfs-test-tool - End user tests for libguestfs"
23119 #: ../test-tool/libguestfs-test-tool.pod:9
23122 " libguestfs-test-tool [--options]\n"
23127 #: ../test-tool/libguestfs-test-tool.pod:13
23129 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
23130 "and developers, to allow them to check basic libguestfs functionality is "
23131 "working. This is needed because libguestfs occasionally breaks for reasons "
23132 "beyond our control: usually because of changes in the underlying qemu or "
23133 "kernel packages, or the host environment."
23137 #: ../test-tool/libguestfs-test-tool.pod:20
23138 msgid "If you suspect a problem in libguestfs, then just run:"
23142 #: ../test-tool/libguestfs-test-tool.pod:22
23145 " libguestfs-test-tool\n"
23150 #: ../test-tool/libguestfs-test-tool.pod:24
23151 msgid "It will print lots of diagnostic messages."
23155 #: ../test-tool/libguestfs-test-tool.pod:26
23156 msgid "If it runs to completion successfully, you will see this near the end:"
23160 #: ../test-tool/libguestfs-test-tool.pod:28
23163 " ===== TEST FINISHED OK =====\n"
23168 #: ../test-tool/libguestfs-test-tool.pod:30
23169 msgid "and the test tool will exit with code 0."
23173 #: ../test-tool/libguestfs-test-tool.pod:32
23175 "If it fails (and/or exits with non-zero error code), please paste the "
23176 "B<complete, unedited> output of the test tool into a bug report. More "
23177 "information about reporting bugs can be found on the "
23178 "L<http://libguestfs.org/> website."
23182 #: ../test-tool/libguestfs-test-tool.pod:41
23187 #: ../test-tool/libguestfs-test-tool.pod:43
23188 msgid "Display short usage information and exit."
23192 #: ../test-tool/libguestfs-test-tool.pod:45
23193 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
23197 #: ../test-tool/libguestfs-test-tool.pod:47
23199 "Pass an alternate name for the helper program. libguestfs-test-tool will "
23200 "normally look in the C<$libexec> directory that was configured when the tool "
23205 #: ../test-tool/libguestfs-test-tool.pod:51
23206 msgid "I<--qemu qemu_binary>"
23210 #: ../test-tool/libguestfs-test-tool.pod:53
23212 "If you have downloaded another qemu binary, point this option at the full "
23213 "path of the binary to try it."
23217 #: ../test-tool/libguestfs-test-tool.pod:56
23218 msgid "I<--qemudir qemu_source_dir>"
23222 #: ../test-tool/libguestfs-test-tool.pod:58
23224 "If you have compiled qemu from source, point this option at the source "
23225 "directory to try it."
23229 #: ../test-tool/libguestfs-test-tool.pod:61
23230 msgid "I<--timeout N>"
23234 #: ../test-tool/libguestfs-test-tool.pod:63
23236 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
23237 "does not usually need to be adjusted unless your machine is very slow."
23241 #: ../test-tool/libguestfs-test-tool.pod:69
23242 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
23246 #: ../test-tool/libguestfs-test-tool.pod:71
23248 "If you have compiled another version of qemu from source and would like to "
23249 "try that, then you can use the I<--qemudir> option to point to the qemu "
23250 "source directory."
23254 #: ../test-tool/libguestfs-test-tool.pod:75
23256 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
23257 "option to point to the binary."
23261 #: ../test-tool/libguestfs-test-tool.pod:78
23263 "When using an alternate qemu with libguestfs, usually you would need to "
23264 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
23265 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
23266 "when you use either of the I<--qemudir> or I<--qemu> options."
23270 #: ../test-tool/libguestfs-test-tool.pod:85
23272 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
23273 "I<1> if there was an error."
23277 #: ../test-tool/libguestfs-test-tool.pod:92
23278 msgid "/usr/libexec/libguestfs-test-tool-helper"
23282 #: ../test-tool/libguestfs-test-tool.pod:94
23284 "This helper program is run inside the appliance and provides additional "
23289 #: ../test-tool/libguestfs-test-tool.pod:97
23290 msgid "/usr/bin/mkisofs"
23294 #: ../test-tool/libguestfs-test-tool.pod:99
23296 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
23297 "which is used as part of the tests."
23301 #: ../test-tool/libguestfs-test-tool.pod:106
23303 "For the full list of environment variables which may affect libguestfs, "
23304 "please see the L<guestfs(3)> manual page."
23308 #: ../test-tool/libguestfs-test-tool.pod:111
23309 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
23313 #: ../test-tool/libguestfs-test-tool.pod:121
23314 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
23318 #: ../fuse/guestmount.pod:5
23319 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
23323 #: ../fuse/guestmount.pod:9
23326 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
23331 #: ../fuse/guestmount.pod:11
23334 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
23339 #: ../fuse/guestmount.pod:13
23342 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
23347 #: ../fuse/guestmount.pod:17
23349 "You must I<not> use C<guestmount> in read-write mode on live virtual "
23350 "machines. If you do this, you risk disk corruption in the VM."
23354 #: ../fuse/guestmount.pod:22
23356 "The guestmount program can be used to mount virtual machine filesystems and "
23357 "other disk images on the host. It uses libguestfs for access to the guest "
23358 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
23359 "a mountable device."
23363 #: ../fuse/guestmount.pod:27
23365 "Along with other options, you have to give at least one device (I<-a> "
23366 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
23367 "option) or use the I<-i> inspection option. How this works is better "
23368 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
23373 #: ../fuse/guestmount.pod:33
23375 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
23376 "by you, and the filesystem will not be visible to any other users unless you "
23377 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
23378 "the filesystem, use the C<fusermount -u> command."
23382 #: ../fuse/guestmount.pod:41
23384 "For a typical Windows guest which has its main filesystem on the first "
23389 #: ../fuse/guestmount.pod:44
23392 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
23397 #: ../fuse/guestmount.pod:46
23399 "For a typical Linux guest which has a /boot filesystem on the first "
23400 "partition, and the root filesystem on a logical volume:"
23404 #: ../fuse/guestmount.pod:49
23407 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
23412 #: ../fuse/guestmount.pod:51
23413 msgid "To get libguestfs to detect guest mountpoints for you:"
23417 #: ../fuse/guestmount.pod:53
23420 " guestmount -a guest.img -i --ro /mnt\n"
23425 #: ../fuse/guestmount.pod:55
23426 msgid "For a libvirt guest called \"Guest\" you could do:"
23430 #: ../fuse/guestmount.pod:57
23433 " guestmount -d Guest -i --ro /mnt\n"
23438 #: ../fuse/guestmount.pod:59
23440 "If you don't know what filesystems are contained in a guest or disk image, "
23441 "use L<virt-list-filesystems(1)> first:"
23445 #: ../fuse/guestmount.pod:62
23448 " virt-list-filesystems MyGuest\n"
23453 #: ../fuse/guestmount.pod:64
23455 "If you want to trace the libguestfs calls but without excessive debugging "
23456 "information, we recommend:"
23460 #: ../fuse/guestmount.pod:67
23463 " guestmount [...] --trace /mnt\n"
23468 #: ../fuse/guestmount.pod:69
23469 msgid "If you want to debug the program, we recommend:"
23473 #: ../fuse/guestmount.pod:71
23476 " guestmount [...] --trace --verbose /mnt\n"
23481 #: ../fuse/guestmount.pod:79
23482 msgid "Add a block device or virtual machine image."
23486 #: ../fuse/guestmount.pod:96
23487 msgid "B<--dir-cache-timeout N>"
23491 #: ../fuse/guestmount.pod:98
23493 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
23494 "seconds. The readdir cache [actually, there are several semi-independent "
23495 "caches] is populated after a readdir(2) call with the stat and extended "
23496 "attributes of the files in the directory, in anticipation that they will be "
23497 "requested soon after."
23501 #: ../fuse/guestmount.pod:104
23503 "There is also a different attribute cache implemented by FUSE (see the FUSE "
23504 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
23505 "requests, only cache existing ones."
23509 #: ../fuse/guestmount.pod:115
23511 "If you have untrusted raw-format guest disk images, you should use this "
23512 "option to specify the disk format. This avoids a possible security problem "
23513 "with malicious guests (CVE-2010-3851). See also "
23514 "L<guestfs(3)/guestfs_add_drive_opts>."
23518 #: ../fuse/guestmount.pod:120
23519 msgid "B<--fuse-help>"
23523 #: ../fuse/guestmount.pod:122
23524 msgid "Display help on special FUSE options (see I<-o> below)."
23528 #: ../fuse/guestmount.pod:126
23529 msgid "Display brief help and exit."
23533 #: ../fuse/guestmount.pod:134
23534 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
23538 #: ../fuse/guestmount.pod:136
23540 "Mount the named partition or logical volume on the given mountpoint B<in the "
23541 "guest> (this has nothing to do with mountpoints in the host)."
23545 #: ../fuse/guestmount.pod:139
23547 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
23548 "something on C</>."
23552 #: ../fuse/guestmount.pod:144
23554 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
23555 "unmounted. If you specify this option, then we don't attempt to sync the "
23556 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
23560 #: ../fuse/guestmount.pod:149
23561 msgid "B<-o option> | B<--option option>"
23565 #: ../fuse/guestmount.pod:151
23566 msgid "Pass extra options to FUSE."
23570 #: ../fuse/guestmount.pod:153
23572 "To get a list of all the extra options supported by FUSE, use the command "
23573 "below. Note that only the FUSE I<-o> options can be passed, and only some "
23574 "of them are a good idea."
23578 #: ../fuse/guestmount.pod:157
23581 " guestmount --fuse-help\n"
23586 #: ../fuse/guestmount.pod:159
23587 msgid "Some potentially useful FUSE options:"
23591 #: ../fuse/guestmount.pod:163
23592 msgid "B<-o allow_other>"
23596 #: ../fuse/guestmount.pod:165
23597 msgid "Allow other users to see the filesystem."
23601 #: ../fuse/guestmount.pod:167
23602 msgid "B<-o attr_timeout=N>"
23606 #: ../fuse/guestmount.pod:169
23607 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
23611 #: ../fuse/guestmount.pod:171
23612 msgid "B<-o kernel_cache>"
23616 #: ../fuse/guestmount.pod:173
23618 "Allow the kernel to cache files (reduces the number of reads that have to go "
23619 "through the L<guestfs(3)> API). This is generally a good idea if you can "
23620 "afford the extra memory usage."
23624 #: ../fuse/guestmount.pod:177
23625 msgid "B<-o uid=N> B<-o gid=N>"
23629 #: ../fuse/guestmount.pod:179
23631 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
23632 "the chosen values."
23636 #: ../fuse/guestmount.pod:186
23638 "Add devices and mount everything read-only. Also disallow writes and make "
23639 "the disk appear read-only to FUSE."
23643 #: ../fuse/guestmount.pod:189
23645 "This is highly recommended if you are not going to edit the guest disk. If "
23646 "the guest is running and this option is I<not> supplied, then there is a "
23647 "strong risk of disk corruption in the guest. We try to prevent this from "
23648 "happening, but it is not always possible."
23652 #: ../fuse/guestmount.pod:196
23653 msgid "Enable SELinux support for the guest."
23657 #: ../fuse/guestmount.pod:200
23658 msgid "Enable verbose messages from underlying libguestfs."
23662 #: ../fuse/guestmount.pod:204
23663 msgid "Display the program version and exit."
23667 #: ../fuse/guestmount.pod:206
23668 msgid "B<-x> | B<--trace>"
23672 #: ../fuse/guestmount.pod:208
23673 msgid "Trace libguestfs calls."
23677 #: ../fuse/guestmount.pod:210
23678 msgid "This also stops the daemon from forking into the background."
23682 #: ../fuse/guestmount.pod:216
23684 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
23685 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
23686 "L<http://fuse.sf.net/>."
23690 #: ../inspector/virt-inspector.pl:35
23692 "virt-inspector - Display operating system version and other information "
23693 "about a virtual machine"
23697 #: ../inspector/virt-inspector.pl:39
23700 " virt-inspector [--connect URI] domname\n"
23705 #: ../inspector/virt-inspector.pl:41
23708 " virt-inspector guest.img [guest.img ...]\n"
23713 #: ../inspector/virt-inspector.pl:45
23715 "B<virt-inspector> examines a virtual machine or disk image and tries to "
23716 "determine the version of the operating system and other information about "
23717 "the virtual machine."
23721 #: ../inspector/virt-inspector.pl:49
23722 msgid "Virt-inspector produces XML output for feeding into other programs."
23726 #: ../inspector/virt-inspector.pl:51
23728 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
23729 "libvirt domain (see: C<virsh list --all>)."
23733 #: ../inspector/virt-inspector.pl:54
23735 "You can also run virt-inspector directly on disk images from a single "
23736 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
23737 "has several block devices, in which case you should list them one after "
23738 "another, with the first corresponding to the guest's C</dev/sda>, the second "
23739 "to the guest's C</dev/sdb> and so on."
23743 #: ../inspector/virt-inspector.pl:60
23745 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
23746 "inspect several virtual machines, you have to run virt-inspector several "
23747 "times (for example, from a shell script for-loop)."
23751 #: ../inspector/virt-inspector.pl:65
23753 "Because virt-inspector needs direct access to guest images, it won't "
23754 "normally work over remote libvirt connections."
23758 #: ../inspector/virt-inspector.pl:78 ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:181 ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88 ../tools/virt-list-filesystems.pl:60 ../tools/virt-cat.pl:89 ../tools/virt-tar.pl:108 ../tools/virt-rescue.pl:113 ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:61
23759 msgid "Display brief help."
23763 #: ../inspector/virt-inspector.pl:84 ../tools/virt-edit.pl:88 ../tools/virt-win-reg.pl:187 ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94 ../tools/virt-resize.pl:273 ../tools/virt-list-filesystems.pl:66 ../tools/virt-cat.pl:95 ../tools/virt-tar.pl:114 ../tools/virt-rescue.pl:119 ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:67
23764 msgid "B<--version>"
23768 #: ../inspector/virt-inspector.pl:86 ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:189 ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96 ../tools/virt-resize.pl:275 ../tools/virt-list-filesystems.pl:68 ../tools/virt-cat.pl:97 ../tools/virt-tar.pl:116 ../tools/virt-rescue.pl:121 ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:69
23769 msgid "Display version number and exit."
23773 #: ../inspector/virt-inspector.pl:92 ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:203 ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102 ../tools/virt-list-filesystems.pl:74 ../tools/virt-cat.pl:103 ../tools/virt-tar.pl:122 ../tools/virt-rescue.pl:135 ../tools/virt-list-partitions.pl:75
23774 msgid "B<--connect URI> | B<-c URI>"
23778 #: ../inspector/virt-inspector.pl:94 ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:205 ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104 ../tools/virt-list-filesystems.pl:76 ../tools/virt-cat.pl:105 ../tools/virt-tar.pl:124 ../tools/virt-rescue.pl:137 ../tools/virt-list-partitions.pl:77
23780 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
23781 "to the default libvirt hypervisor."
23785 #: ../inspector/virt-inspector.pl:97
23787 "Libvirt is only used if you specify a C<domname> on the command line. If "
23788 "you specify guest block devices directly, then libvirt is not used at all."
23792 #: ../inspector/virt-inspector.pl:105 ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:215 ../tools/virt-df.pl:117 ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523 ../tools/virt-list-filesystems.pl:86 ../tools/virt-cat.pl:115 ../tools/virt-tar.pl:134 ../tools/virt-rescue.pl:147 ../tools/virt-list-partitions.pl:87
23793 msgid "B<--format> raw"
23797 #: ../inspector/virt-inspector.pl:107 ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:217 ../tools/virt-df.pl:119 ../tools/virt-ls.pl:116 ../tools/virt-list-filesystems.pl:88 ../tools/virt-cat.pl:117 ../tools/virt-tar.pl:136 ../tools/virt-rescue.pl:149 ../tools/virt-list-partitions.pl:89
23799 "Specify the format of disk images given on the command line. If this is "
23800 "omitted then the format is autodetected from the content of the disk image."
23804 #: ../inspector/virt-inspector.pl:111 ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:221 ../tools/virt-df.pl:123 ../tools/virt-ls.pl:120 ../tools/virt-list-filesystems.pl:92 ../tools/virt-cat.pl:121 ../tools/virt-tar.pl:140 ../tools/virt-rescue.pl:153 ../tools/virt-list-partitions.pl:93
23806 "If disk images are requested from libvirt, then this program asks libvirt "
23807 "for this information. In this case, the value of the format parameter is "
23812 #: ../inspector/virt-inspector.pl:115 ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:225 ../tools/virt-df.pl:127 ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528 ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96 ../tools/virt-cat.pl:125 ../tools/virt-tar.pl:144 ../tools/virt-rescue.pl:157 ../tools/virt-list-partitions.pl:97
23814 "If working with untrusted raw-format guest disk images, you should ensure "
23815 "the format is always specified."
23819 #: ../inspector/virt-inspector.pl:350 ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:141 ../tools/virt-win-reg.pl:477 ../tools/virt-df.pl:633 ../tools/virt-ls.pl:225 ../tools/virt-resize.pl:1479 ../tools/virt-list-filesystems.pl:179 ../tools/virt-cat.pl:178 ../tools/virt-tar.pl:274 ../tools/virt-rescue.pl:260 ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:247
23820 msgid "SHELL QUOTING"
23824 #: ../inspector/virt-inspector.pl:352 ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:479 ../tools/virt-df.pl:635 ../tools/virt-ls.pl:227 ../tools/virt-resize.pl:1481 ../tools/virt-list-filesystems.pl:181 ../tools/virt-cat.pl:180 ../tools/virt-tar.pl:276 ../tools/virt-rescue.pl:262 ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:249
23826 "Libvirt guest names can contain arbitrary characters, some of which have "
23827 "meaning to the shell such as C<#> and space. You may need to quote or "
23828 "escape these characters on the command line. See the shell manual page "
23829 "L<sh(1)> for details."
23833 #: ../inspector/virt-inspector.pl:359 ../tools/virt-df.pl:642
23835 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
23836 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23840 #: ../inspector/virt-inspector.pl:372 ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:512 ../tools/virt-df.pl:651 ../tools/virt-ls.pl:245 ../tools/virt-resize.pl:1510 ../tools/virt-list-filesystems.pl:200 ../tools/virt-cat.pl:197 ../tools/virt-tar.pl:294 ../tools/virt-rescue.pl:279 ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:267
23841 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
23845 #: ../inspector/virt-inspector.pl:376
23846 msgid "Matthew Booth L<mbooth@redhat.com>"
23850 #: ../inspector/virt-inspector.pl:382 ../tools/virt-win-reg.pl:516 ../tools/virt-resize.pl:1514 ../tools/virt-make-fs.pl:565
23851 msgid "Copyright (C) 2010 Red Hat Inc."
23855 #: ../tools/virt-edit.pl:34
23856 msgid "virt-edit - Edit a file in a virtual machine"
23860 #: ../tools/virt-edit.pl:38
23863 " virt-edit [--options] domname file\n"
23868 #: ../tools/virt-edit.pl:40
23871 " virt-edit [--options] disk.img [disk.img ...] file\n"
23876 #: ../tools/virt-edit.pl:42
23879 " virt-edit [domname|disk.img] file -e 'expr'\n"
23884 #: ../tools/virt-edit.pl:46
23886 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
23887 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
23888 "doing this, but doesn't catch all cases."
23892 #: ../tools/virt-edit.pl:52
23894 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
23895 "the named virtual machine (or disk image)."
23899 #: ../tools/virt-edit.pl:55
23901 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
23902 "you should look at the L<guestfish(1)> tool."
23906 #: ../tools/virt-edit.pl:60
23907 msgid "Edit the named files interactively:"
23911 #: ../tools/virt-edit.pl:62
23914 " virt-edit mydomain /boot/grub/grub.conf\n"
23919 #: ../tools/virt-edit.pl:64
23922 " virt-edit mydomain /etc/passwd\n"
23927 #: ../tools/virt-edit.pl:66
23929 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
23930 "below). To change the init default level to 5:"
23934 #: ../tools/virt-edit.pl:70
23937 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
23942 #: ../tools/virt-edit.pl:96
23943 msgid "B<--backup extension> | B<-b extension>"
23947 #: ../tools/virt-edit.pl:98
23949 "Create a backup of the original file I<in the guest disk image>. The backup "
23950 "has the original filename with C<extension> added."
23954 #: ../tools/virt-edit.pl:101
23956 "Usually the first character of C<extension> would be a dot C<.> so you would "
23961 #: ../tools/virt-edit.pl:104
23964 " virt-edit -b .orig [etc]\n"
23969 #: ../tools/virt-edit.pl:106
23970 msgid "By default, no backup file is made."
23974 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208 ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107 ../tools/virt-list-filesystems.pl:79 ../tools/virt-cat.pl:108 ../tools/virt-tar.pl:127 ../tools/virt-rescue.pl:140 ../tools/virt-list-partitions.pl:80
23976 "If you specify guest block devices directly, then libvirt is not used at "
23981 #: ../tools/virt-edit.pl:141
23982 msgid "B<--expr EXPR> | B<-e EXPR>"
23986 #: ../tools/virt-edit.pl:143
23988 "Instead of launching the external editor, non-interactively apply the Perl "
23989 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
23994 #: ../tools/virt-edit.pl:147
23996 "Be careful to properly quote the expression to prevent it from being altered "
24001 #: ../tools/virt-edit.pl:268
24002 msgid "NON-INTERACTIVE EDITING"
24006 #: ../tools/virt-edit.pl:270
24008 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
24009 "administrator can interactively edit the file."
24013 #: ../tools/virt-edit.pl:273
24015 "There are two ways also to use C<virt-edit> from scripts in order to make "
24016 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
24017 "like this, it's less error-prone to write scripts directly using the "
24018 "libguestfs API and Augeas for configuration file editing.)"
24022 #: ../tools/virt-edit.pl:279
24024 "The first method is to temporarily set C<$EDITOR> to any script or program "
24025 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
24026 "update C<tmpfile> in place however it likes."
24030 #: ../tools/virt-edit.pl:283
24032 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
24033 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
24034 "instances of C<foo> with C<bar> in a file:"
24038 #: ../tools/virt-edit.pl:287
24041 " virt-edit domname filename -e 's/foo/bar/'\n"
24046 #: ../tools/virt-edit.pl:289
24048 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
24049 "For example to delete root's password you could do:"
24053 #: ../tools/virt-edit.pl:292
24056 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
24061 #: ../tools/virt-edit.pl:294
24063 "What really happens is that the snippet is evaluated as a Perl expression "
24064 "for each line of the file. The line, including the final C<\\n>, is passed "
24065 "in C<$_> and the expression should update C<$_> or leave it unchanged."
24069 #: ../tools/virt-edit.pl:299
24071 "To delete a line, set C<$_> to the empty string. For example, to delete the "
24072 "C<apache> user account from the password file you can do:"
24076 #: ../tools/virt-edit.pl:302
24079 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
24084 #: ../tools/virt-edit.pl:304
24086 "To insert a line, prepend or append it to C<$_>. However appending lines to "
24087 "the end of the file is rather difficult this way since there is no concept "
24088 "of \"last line of the file\" - your expression just doesn't get called "
24089 "again. You might want to use the first method (setting C<$EDITOR>) if you "
24094 #: ../tools/virt-edit.pl:310
24096 "The variable C<$lineno> contains the current line number. As is "
24097 "traditional, the first line in the file is number C<1>."
24101 #: ../tools/virt-edit.pl:313
24103 "The return value from the expression is ignored, but the expression may call "
24104 "C<die> in order to abort the whole program, leaving the original file "
24109 #: ../tools/virt-edit.pl:317
24111 "Remember when matching the end of a line that C<$_> may contain the final "
24112 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
24113 "newline then neither of these. Thus to match or substitute some text at the "
24114 "end of a line, use this regular expression:"
24118 #: ../tools/virt-edit.pl:322
24121 " /some text(\\r?\\n)?$/\n"
24126 #: ../tools/virt-edit.pl:324
24128 "Alternately, use the perl C<chomp> function, being careful not to chomp "
24129 "C<$_> itself (since that would remove all newlines from the file):"
24133 #: ../tools/virt-edit.pl:328
24136 " my $m = $_; chomp $m; $m =~ /some text$/\n"
24141 #: ../tools/virt-edit.pl:334
24146 #: ../tools/virt-edit.pl:336
24148 "If set, this string is used as the editor. It may contain arguments, "
24149 "eg. C<\"emacs -nw\">"
24153 #: ../tools/virt-edit.pl:339
24154 msgid "If not set, C<vi> is used."
24158 #: ../tools/virt-edit.pl:352
24160 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
24161 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, "
24162 "L<perl(1)>, L<perlre(1)>."
24166 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510 ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243 ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198 ../tools/virt-cat.pl:195 ../tools/virt-tar.pl:292 ../tools/virt-rescue.pl:277 ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:265
24171 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655 ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
24172 msgid "Copyright (C) 2009-2010 Red Hat Inc."
24176 #: ../tools/virt-win-reg.pl:37
24178 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
24183 #: ../tools/virt-win-reg.pl:41
24186 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
24191 #: ../tools/virt-win-reg.pl:43
24194 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
24199 #: ../tools/virt-win-reg.pl:45
24202 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
24207 #: ../tools/virt-win-reg.pl:47
24210 " virt-win-reg --merge domname [input.reg ...]\n"
24215 #: ../tools/virt-win-reg.pl:49
24218 " virt-win-reg [--options] disk.img ... # instead of domname\n"
24223 #: ../tools/virt-win-reg.pl:53
24225 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
24226 "virtual machines. If you do this, you I<will> get irreversible disk "
24227 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
24228 "but doesn't catch all cases."
24232 #: ../tools/virt-win-reg.pl:58
24234 "Modifying the Windows Registry is an inherently risky operation. The format "
24235 "is deliberately obscure and undocumented, and Registry changes can leave the "
24236 "system unbootable. Therefore when using the C<--merge> option, make sure "
24237 "you have a reliable backup first."
24241 #: ../tools/virt-win-reg.pl:65
24243 "This program can export and merge Windows Registry entries from a Windows "
24248 #: ../tools/virt-win-reg.pl:68
24250 "The first parameter is the libvirt guest name or the raw disk image of a "
24255 #: ../tools/virt-win-reg.pl:71
24257 "If C<--merge> is I<not> specified, then the chosen registry key is "
24258 "displayed/exported (recursively). For example:"
24262 #: ../tools/virt-win-reg.pl:74
24265 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
24270 #: ../tools/virt-win-reg.pl:76
24271 msgid "You can also display single values from within registry keys, for example:"
24275 #: ../tools/virt-win-reg.pl:79
24278 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
24279 " $ virt-win-reg Windows7 $cvkey ProductName\n"
24280 " Windows 7 Enterprise\n"
24285 #: ../tools/virt-win-reg.pl:83
24287 "With C<--merge>, you can merge a textual regedit file into the Windows "
24292 #: ../tools/virt-win-reg.pl:86
24295 " $ virt-win-reg --merge Windows7 changes.reg\n"
24300 #: ../tools/virt-win-reg.pl:88
24301 msgid "SUPPORTED SYSTEMS"
24305 #: ../tools/virt-win-reg.pl:90
24307 "The program currently supports Windows NT-derived guests starting with "
24308 "Windows XP through to at least Windows 7."
24312 #: ../tools/virt-win-reg.pl:93
24314 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
24315 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
24316 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
24320 #: ../tools/virt-win-reg.pl:97
24322 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
24327 #: ../tools/virt-win-reg.pl:100
24329 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
24334 #: ../tools/virt-win-reg.pl:103
24339 #: ../tools/virt-win-reg.pl:105
24341 "This program is only meant for simple access to the registry. If you want "
24342 "to do complicated things with the registry, we suggest you download the "
24343 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
24344 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
24345 "L<hivexregedit(1)>."
24349 #: ../tools/virt-win-reg.pl:111
24354 #: ../tools/virt-win-reg.pl:113
24356 "C<virt-win-reg> expects that regedit files have already been reencoded in "
24357 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
24358 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
24359 "with Windows-style line endings, you may need to reencode the whole file "
24360 "before or after processing."
24364 #: ../tools/virt-win-reg.pl:119
24366 "To reencode a file from Windows format to Linux (before processing it with "
24367 "the C<--merge> option), you would do something like this:"
24371 #: ../tools/virt-win-reg.pl:122
24374 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
24379 #: ../tools/virt-win-reg.pl:124
24381 "To go in the opposite direction, after exporting and before sending the file "
24382 "to a Windows user, do something like this:"
24386 #: ../tools/virt-win-reg.pl:127
24389 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
24394 #: ../tools/virt-win-reg.pl:129
24395 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
24399 #: ../tools/virt-win-reg.pl:131
24401 "If you are unsure about the current encoding, use the L<file(1)> command. "
24402 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
24403 "Windows-style (CRLF) line endings, like this:"
24407 #: ../tools/virt-win-reg.pl:135
24410 " $ file software.reg\n"
24411 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
24412 " with CRLF line terminators\n"
24417 #: ../tools/virt-win-reg.pl:139
24418 msgid "This file would need conversion before you could C<--merge> it."
24422 #: ../tools/virt-win-reg.pl:143
24424 "Be careful when passing parameters containing C<\\> (backslash) in the "
24425 "shell. Usually you will have to use 'single quotes' or double backslashes "
24426 "(but not both) to protect them from the shell."
24430 #: ../tools/virt-win-reg.pl:147
24431 msgid "Paths and value names are case-insensitive."
24435 #: ../tools/virt-win-reg.pl:149
24436 msgid "CurrentControlSet etc."
24440 #: ../tools/virt-win-reg.pl:151
24442 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
24443 "Registry at the level of the hive file, and therefore you cannot modify "
24448 #: ../tools/virt-win-reg.pl:155
24450 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
24451 "circumstances it might refer to another control set. The way to find out is "
24452 "to look at the C<HKLM\\SYSTEM\\Select> key:"
24456 #: ../tools/virt-win-reg.pl:159
24459 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
24460 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
24461 " \"Current\"=dword:00000001\n"
24462 " \"Default\"=dword:00000001\n"
24463 " \"Failed\"=dword:00000000\n"
24464 " \"LastKnownGood\"=dword:00000002\n"
24469 #: ../tools/virt-win-reg.pl:166
24470 msgid "\"Default\" is the one which Windows will choose when it boots."
24474 #: ../tools/virt-win-reg.pl:168
24475 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
24479 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
24484 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
24485 msgid "Enable debugging messages."
24489 #: ../tools/virt-win-reg.pl:232
24494 #: ../tools/virt-win-reg.pl:234
24496 "In merge mode, this merges a textual regedit file into the Windows Registry "
24497 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
24498 "displays or exports Registry entries instead."
24502 #: ../tools/virt-win-reg.pl:238
24504 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
24505 "result in disk corruption. However exporting (without this flag) is always "
24510 #: ../tools/virt-win-reg.pl:246
24511 msgid "B<--encoding> UTF-16LE|ASCII"
24515 #: ../tools/virt-win-reg.pl:248
24517 "When merging (only), you may need to specify the encoding for strings to be "
24518 "used in the hive file. This is explained in detail in "
24519 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
24523 #: ../tools/virt-win-reg.pl:252
24525 "The default is to use UTF-16LE, which should work with recent versions of "
24530 #: ../tools/virt-win-reg.pl:486
24532 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
24533 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
24534 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
24535 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24539 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
24541 "When reporting bugs, please enable debugging and capture the I<complete> "
24546 #: ../tools/virt-win-reg.pl:504
24549 " export LIBGUESTFS_DEBUG=1\n"
24550 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
24555 #: ../tools/virt-win-reg.pl:507
24557 "Attach /tmp/virt-win-reg.log to a new bug report at "
24558 "L<https://bugzilla.redhat.com/>"
24562 #: ../tools/virt-df.pl:36
24563 msgid "virt-df - Display free space on virtual filesystems"
24567 #: ../tools/virt-df.pl:40
24570 " virt-df [--options]\n"
24575 #: ../tools/virt-df.pl:42
24578 " virt-df [--options] domname\n"
24583 #: ../tools/virt-df.pl:44
24586 " virt-df [--options] disk.img [disk.img ...]\n"
24591 #: ../tools/virt-df.pl:48
24593 "C<virt-df> is a command line tool to display free space on virtual machine "
24594 "filesystems. Unlike other tools, it doesn't just display the amount of "
24595 "space allocated to a virtual machine, but can look inside the virtual "
24596 "machine to see how much space is really being used."
24600 #: ../tools/virt-df.pl:53
24602 "It is like the L<df(1)> command, but for virtual machines, except that it "
24603 "also works for Windows virtual machines."
24607 #: ../tools/virt-df.pl:56
24609 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
24610 "of all active and inactive guests, and performs a C<df>-type operation on "
24611 "each one in turn, printing out the results."
24615 #: ../tools/virt-df.pl:60
24617 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
24618 "either the single named libvirt domain, or on the disk image(s) listed on "
24619 "the command line (which must all belong to a single VM). In this mode (with "
24620 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
24621 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
24625 #: ../tools/virt-df.pl:67
24627 "Use the C<--csv> option to get a format which can be easily parsed by other "
24628 "programs. Other options are mostly similar to standard C<df> options. See "
24629 "below for the complete list."
24633 #: ../tools/virt-df.pl:107
24638 #: ../tools/virt-df.pl:109
24640 "Write out the results in CSV format (comma-separated values). This format "
24641 "can be imported easily into databases and spreadsheets, but read L</NOTE "
24642 "ABOUT CSV FORMAT> below."
24646 #: ../tools/virt-df.pl:134
24647 msgid "B<--human-readable> | B<-h>"
24651 #: ../tools/virt-df.pl:136
24652 msgid "Print sizes in human-readable format."
24656 #: ../tools/virt-df.pl:138
24657 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
24661 #: ../tools/virt-df.pl:144
24662 msgid "B<--inodes> | B<-i>"
24666 #: ../tools/virt-df.pl:146
24667 msgid "Print inodes instead of blocks."
24671 #: ../tools/virt-df.pl:152
24672 msgid "B<--one-per-guest>"
24676 #: ../tools/virt-df.pl:154
24678 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
24679 "disks from several guests to a single libguestfs appliance."
24683 #: ../tools/virt-df.pl:157
24684 msgid "You might use this option in the following circumstances:"
24688 #: ../tools/virt-df.pl:163
24690 "If you think an untrusted guest might actively try to exploit the libguestfs "
24691 "appliance kernel, then this prevents one guest from interfering with the "
24692 "stats printed for another guest."
24696 #: ../tools/virt-df.pl:169
24698 "If the kernel has a bug which stops it from accessing a filesystem in one "
24699 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
24700 "and report stats for further guests."
24704 #: ../tools/virt-df.pl:180
24709 #: ../tools/virt-df.pl:182
24711 "Print UUIDs instead of names. This is useful for following a guest even "
24712 "when the guest is migrated or renamed, or when two guests happen to have the "
24717 #: ../tools/virt-df.pl:186
24719 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
24720 "images, we still print the disk image name even when this option is "
24725 #: ../tools/virt-df.pl:609
24726 msgid "NOTE ABOUT CSV FORMAT"
24730 #: ../tools/virt-df.pl:611
24732 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
24733 "should be easy to parse, but it is definitely not easy to parse."
24737 #: ../tools/virt-df.pl:614
24739 "Myth: Just split fields at commas. Reality: This does I<not> work "
24740 "reliably. This example has two columns:"
24744 #: ../tools/virt-df.pl:617
24747 " \"foo,bar\",baz\n"
24752 #: ../tools/virt-df.pl:619
24754 "Myth: Read the file one line at a time. Reality: This does I<not> work "
24755 "reliably. This example has one row:"
24759 #: ../tools/virt-df.pl:622
24768 #: ../tools/virt-df.pl:625
24770 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
24771 "packaged in major Linux distributions)."
24775 #: ../tools/virt-df.pl:628
24777 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
24778 "or Python's built-in csv library)."
24782 #: ../tools/virt-df.pl:631
24783 msgid "Most spreadsheets and databases can import CSV directly."
24787 #: ../tools/virt-ls.pl:34
24788 msgid "virt-ls - List files in a virtual machine"
24792 #: ../tools/virt-ls.pl:38
24795 " virt-ls [--options] domname directory\n"
24800 #: ../tools/virt-ls.pl:40
24803 " virt-ls [--options] disk.img [disk.img ...] directory\n"
24808 #: ../tools/virt-ls.pl:44
24810 "C<virt-ls> is a command line tool to list the names of files in a directory "
24811 "inside a virtual machine or disk image."
24815 #: ../tools/virt-ls.pl:47
24817 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
24818 "For more complex cases you should look at the L<guestfish(1)> tool."
24822 #: ../tools/virt-ls.pl:51
24824 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
24825 "simple listing is like the ordinary L<ls(1)> command:"
24829 #: ../tools/virt-ls.pl:54
24832 " $ virt-ls myguest /\n"
24840 #: ../tools/virt-ls.pl:59
24841 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
24845 #: ../tools/virt-ls.pl:61
24848 " $ virt-ls -l myguest /\n"
24850 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
24851 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
24857 #: ../tools/virt-ls.pl:67
24859 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
24860 "and directories recursively:"
24864 #: ../tools/virt-ls.pl:70
24867 " $ virt-ls -R myguest /tmp\n"
24875 #: ../tools/virt-ls.pl:75
24877 "You I<cannot> combine these options. To do more complicated things, use "
24882 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103 ../tools/virt-list-partitions.pl:112
24883 msgid "B<-l> | B<--long>"
24887 #: ../tools/virt-ls.pl:133
24888 msgid "B<-R> | B<--recursive>"
24892 #: ../tools/virt-ls.pl:135
24894 "Select the mode. With neither of these options, C<virt-ls> produces a "
24895 "simple, flat list of the files in the named directory."
24899 #: ../tools/virt-ls.pl:138
24901 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
24902 "like the plain C<ls -l> command)."
24906 #: ../tools/virt-ls.pl:141
24908 "C<virt-ls -R> produces a recursive list of files starting at the named "
24909 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
24914 #: ../tools/virt-ls.pl:145
24915 msgid "You cannot combine these options."
24919 #: ../tools/virt-ls.pl:234
24921 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
24922 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
24923 "L<http://libguestfs.org/>."
24927 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204 ../tools/virt-cat.pl:201 ../tools/virt-tar.pl:298
24928 msgid "Copyright (C) 2009 Red Hat Inc."
24932 #: ../tools/virt-resize.pl:42
24933 msgid "virt-resize - Resize a virtual machine disk"
24937 #: ../tools/virt-resize.pl:46
24940 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
24941 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
24942 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
24947 #: ../tools/virt-resize.pl:52
24949 "Virt-resize is a tool which can resize a virtual machine disk, making it "
24950 "larger or smaller overall, and resizing or deleting any partitions contained "
24955 #: ../tools/virt-resize.pl:56
24957 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
24958 "not> be used on live virtual machines - for consistent results, shut the "
24959 "virtual machine down before resizing it."
24963 #: ../tools/virt-resize.pl:60
24965 "If you are not familiar with the associated tools: "
24966 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)> and L<virt-df(1)>, "
24967 "we recommend you go and read those manual pages first."
24971 #: ../tools/virt-resize.pl:68
24973 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
24974 "fill the extra 5GB of space."
24978 #: ../tools/virt-resize.pl:71
24981 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
24982 " virt-list-partitions -lht olddisk\n"
24983 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
24984 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
24989 #: ../tools/virt-resize.pl:76
24991 "As above, but make the /boot partition 200MB bigger, while giving the "
24992 "remaining space to /dev/sda2:"
24996 #: ../tools/virt-resize.pl:79
24999 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
25004 #: ../tools/virt-resize.pl:81
25005 msgid "As above, but the output format will be uncompressed qcow2:"
25009 #: ../tools/virt-resize.pl:83
25012 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
25013 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
25018 #: ../tools/virt-resize.pl:86
25019 msgid "DETAILED USAGE"
25023 #: ../tools/virt-resize.pl:88
25024 msgid "EXPANDING A VIRTUAL MACHINE DISK"
25028 #: ../tools/virt-resize.pl:92
25029 msgid "1. Shut down the virtual machine"
25033 #: ../tools/virt-resize.pl:94
25034 msgid "2. Locate input disk image"
25038 #: ../tools/virt-resize.pl:96
25040 "Locate the input disk image (ie. the file or device on the host containing "
25041 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
25042 "dumpxml> like this to find the disk image name:"
25046 #: ../tools/virt-resize.pl:100
25049 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
25050 " Found 1 nodes:\n"
25052 " <source dev=\"/dev/vg/lv_guest\" />\n"
25057 #: ../tools/virt-resize.pl:105
25058 msgid "3. Look at current sizing"
25062 #: ../tools/virt-resize.pl:107
25063 msgid "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
25067 #: ../tools/virt-resize.pl:110
25070 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
25071 " /dev/sda1 ext3 101.9M\n"
25072 " /dev/sda2 pv 7.9G\n"
25073 " /dev/sda device 8.0G\n"
25078 #: ../tools/virt-resize.pl:115
25080 "(This example is a virtual machine with an 8 GB disk which we would like to "
25081 "expand up to 10 GB)."
25085 #: ../tools/virt-resize.pl:118
25086 msgid "4. Create output disk"
25090 #: ../tools/virt-resize.pl:120
25092 "Virt-resize cannot do in-place disk modifications. You have to have space "
25093 "to store the resized output disk."
25097 #: ../tools/virt-resize.pl:123
25098 msgid "To store the resized disk image in a file, create a file of a suitable size:"
25102 #: ../tools/virt-resize.pl:126
25105 " # rm -f outdisk\n"
25106 " # truncate -s 10G outdisk\n"
25111 #: ../tools/virt-resize.pl:129
25112 msgid "Or use L<lvcreate(1)> to create a logical volume:"
25116 #: ../tools/virt-resize.pl:131
25119 " # lvcreate -L 10G -n lv_name vg_name\n"
25124 #: ../tools/virt-resize.pl:133
25125 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
25129 #: ../tools/virt-resize.pl:135
25132 " # virsh pool-list\n"
25133 " # virsh vol-create-as poolname newvol 10G\n"
25138 #: ../tools/virt-resize.pl:138
25143 #: ../tools/virt-resize.pl:140
25145 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
25146 "file) and the output disk. The output disk is the one created in the "
25151 #: ../tools/virt-resize.pl:144
25154 " # virt-resize indisk outdisk\n"
25159 #: ../tools/virt-resize.pl:146
25161 "This command just copies disk image C<indisk> to disk image C<outdisk> "
25162 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
25163 "larger, then an extra, empty partition is created at the end of the disk "
25164 "covering the extra space. If C<outdisk> is smaller, then it will give an "
25169 #: ../tools/virt-resize.pl:152
25171 "More realistically you'd want to expand existing partitions in the disk "
25172 "image by passing extra options (for the full list see the L</OPTIONS> "
25177 #: ../tools/virt-resize.pl:156
25179 "L</--expand> is the most useful option. It expands the named partition "
25180 "within the disk to fill any extra space:"
25184 #: ../tools/virt-resize.pl:159
25187 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
25192 #: ../tools/virt-resize.pl:161
25194 "(In this case, an extra partition is I<not> created at the end of the disk, "
25195 "because there will be no unused space)."
25199 #: ../tools/virt-resize.pl:164
25201 "L</--resize> is the other commonly used option. The following would "
25202 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
25203 "rest of the available space:"
25207 #: ../tools/virt-resize.pl:168
25210 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
25211 " indisk outdisk\n"
25216 #: ../tools/virt-resize.pl:171
25218 "If the expanded partition in the image contains a filesystem or LVM PV, then "
25219 "if virt-resize knows how, it will resize the contents, the equivalent of "
25220 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or "
25221 "L<ntfsresize(8)>. However virt-resize does not know how to resize some "
25222 "filesystems, so you would have to online resize them after booting the "
25223 "guest. And virt-resize also does not resize anything inside an LVM PV, it "
25224 "just resizes the PV itself and leaves the user to resize any LVs inside that "
25229 #: ../tools/virt-resize.pl:180
25230 msgid "Other options are covered below."
25234 #: ../tools/virt-resize.pl:182
25239 #: ../tools/virt-resize.pl:184
25240 msgid "Thoroughly test the new disk image I<before> discarding the old one."
25244 #: ../tools/virt-resize.pl:186
25245 msgid "If you are using libvirt, edit the XML to point at the new disk:"
25249 #: ../tools/virt-resize.pl:188
25252 " # virsh edit guestname\n"
25257 #: ../tools/virt-resize.pl:190
25259 "Change E<lt>source ...E<gt>, see "
25260 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
25264 #: ../tools/virt-resize.pl:193
25265 msgid "Then start up the domain with the new, resized disk:"
25269 #: ../tools/virt-resize.pl:195
25272 " # virsh start guestname\n"
25277 #: ../tools/virt-resize.pl:197
25279 "and check that it still works. See also the L</NOTES> section below for "
25280 "additional information."
25284 #: ../tools/virt-resize.pl:200
25285 msgid "7. Resize LVs etc inside the guest"
25289 #: ../tools/virt-resize.pl:202
25290 msgid "(This can also be done offline using L<guestfish(1)>)"
25294 #: ../tools/virt-resize.pl:204
25296 "Once the guest has booted you should see the new space available, at least "
25297 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
25298 "may need to resize LVs inside PVs, and also resize filesystem types that "
25299 "virt-resize does not know how to expand."
25303 #: ../tools/virt-resize.pl:211
25304 msgid "SHRINKING A VIRTUAL MACHINE DISK"
25308 #: ../tools/virt-resize.pl:213
25310 "Shrinking is somewhat more complex than expanding, and only an overview is "
25315 #: ../tools/virt-resize.pl:216
25317 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
25318 "filesystems). The user has to shrink content before passing the disk image "
25319 "to virt-resize, and virt-resize will check that the content has been shrunk "
25324 #: ../tools/virt-resize.pl:221
25325 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
25329 #: ../tools/virt-resize.pl:223
25331 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
25332 "steps 3 and 4 above to allocate a new disk image."
25336 #: ../tools/virt-resize.pl:226
25337 msgid "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
25341 #: ../tools/virt-resize.pl:229
25342 msgid "IGNORING OR DELETING PARTITIONS"
25346 #: ../tools/virt-resize.pl:231
25348 "virt-resize also gives a convenient way to ignore or delete partitions when "
25349 "copying from the input disk to the output disk. Ignoring a partition speeds "
25350 "up the copy where you don't care about the existing contents of a "
25351 "partition. Deleting a partition removes it completely, but note that it "
25352 "also renumbers any partitions after the one which is deleted, which can "
25353 "leave some guests unbootable."
25357 #: ../tools/virt-resize.pl:238
25358 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
25362 #: ../tools/virt-resize.pl:240
25364 "If the input disk is in qcow2 format, then you may prefer that the output is "
25365 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
25366 "the fly. The output format is simply determined by the format of the empty "
25367 "output container that you provide. Thus to create qcow2 output, use:"
25371 #: ../tools/virt-resize.pl:246
25374 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
25379 #: ../tools/virt-resize.pl:248
25380 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
25384 #: ../tools/virt-resize.pl:250
25385 msgid "Similarly, to get non-sparse raw output use:"
25389 #: ../tools/virt-resize.pl:252
25392 " fallocate -l size outdisk\n"
25397 #: ../tools/virt-resize.pl:254
25399 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
25400 "if=/dev/zero of=outdisk bs=1M count=..>)"
25404 #: ../tools/virt-resize.pl:267
25405 msgid "Display help."
25409 #: ../tools/virt-resize.pl:281
25410 msgid "B<--resize part=size>"
25414 #: ../tools/virt-resize.pl:283
25416 "Resize the named partition (expanding or shrinking it) so that it has the "
25421 #: ../tools/virt-resize.pl:286
25423 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
25424 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
25425 "Exabytes; or as a percentage of the current size; or as a relative number or "
25426 "percentage. For example:"
25430 #: ../tools/virt-resize.pl:291
25433 " --resize /dev/sda2=10G\n"
25438 #: ../tools/virt-resize.pl:293
25441 " --resize /dev/sda4=90%\n"
25446 #: ../tools/virt-resize.pl:295
25449 " --resize /dev/sda2=+1G\n"
25454 #: ../tools/virt-resize.pl:297
25457 " --resize /dev/sda2=-200M\n"
25462 #: ../tools/virt-resize.pl:299
25465 " --resize /dev/sda1=+128K\n"
25470 #: ../tools/virt-resize.pl:301
25473 " --resize /dev/sda1=+10%\n"
25478 #: ../tools/virt-resize.pl:303
25481 " --resize /dev/sda1=-10%\n"
25486 #: ../tools/virt-resize.pl:305
25488 "You can increase the size of any partition. Virt-resize will expand the "
25489 "direct content of the partition if it knows how (see C<--expand> below)."
25493 #: ../tools/virt-resize.pl:309
25495 "You can only I<decrease> the size of partitions that contain filesystems or "
25496 "PVs which have already been shrunk. Virt-resize will check this has been "
25497 "done before proceeding, or else will print an error (see also "
25498 "C<--resize-force>)."
25502 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406 ../tools/virt-resize.pl:423
25503 msgid "You can give this option multiple times."
25507 #: ../tools/virt-resize.pl:320
25508 msgid "B<--resize-force part=size>"
25512 #: ../tools/virt-resize.pl:322
25514 "This is the same as C<--resize> except that it will let you decrease the "
25515 "size of any partition. Generally this means you will lose any data which "
25516 "was at the end of the partition you shrink, but you may not care about that "
25517 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25518 "as a swap partition)."
25522 #: ../tools/virt-resize.pl:328
25523 msgid "See also the C<--ignore> option."
25527 #: ../tools/virt-resize.pl:334
25528 msgid "B<--expand part>"
25532 #: ../tools/virt-resize.pl:336
25534 "Expand the named partition so it uses up all extra space (space left over "
25535 "after any other resize changes that you request have been done)."
25539 #: ../tools/virt-resize.pl:339
25541 "If virt-resize knows how, it will expand the direct content of the "
25542 "partition. For example, if the partition is an LVM PV, it will expand the "
25543 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
25544 "content it doesn't know about alone."
25548 #: ../tools/virt-resize.pl:344
25549 msgid "Currently virt-resize can resize:"
25553 #: ../tools/virt-resize.pl:350
25555 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
25560 #: ../tools/virt-resize.pl:355
25562 "NTFS filesystems contained directly in a partition, if libguestfs was "
25563 "compiled with support for NTFS."
25567 #: ../tools/virt-resize.pl:358
25569 "The filesystem must have been shut down consistently last time it was used. "
25570 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
25571 "consistency check, so at the first boot after resizing Windows will check "
25576 #: ../tools/virt-resize.pl:365
25578 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
25579 "inside the PV. The user will have to resize LVs as desired."
25583 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
25584 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
25588 #: ../tools/virt-resize.pl:377
25589 msgid "B<--shrink part>"
25593 #: ../tools/virt-resize.pl:379
25595 "Shrink the named partition until the overall disk image fits in the "
25596 "destination. The named partition B<must> contain a filesystem or PV which "
25597 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25598 "online tools). Virt-resize will check this and give an error if it has not "
25603 #: ../tools/virt-resize.pl:385
25605 "The amount by which the overall disk must be shrunk (after carrying out all "
25606 "other operations requested by the user) is called the \"deficit\". For "
25607 "example, a straight copy (assume no other operations) from a 5GB disk image "
25608 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25609 "would give an error unless the user specified a partition to shrink and that "
25610 "partition had more than a gigabyte of free space."
25614 #: ../tools/virt-resize.pl:399
25615 msgid "B<--ignore part>"
25619 #: ../tools/virt-resize.pl:401
25621 "Ignore the named partition. Effectively this means the partition is "
25622 "allocated on the destination disk, but the content is not copied across from "
25623 "the source disk. The content of the partition will be blank (all zero "
25628 #: ../tools/virt-resize.pl:412
25629 msgid "B<--delete part>"
25633 #: ../tools/virt-resize.pl:414
25635 "Delete the named partition. It would be more accurate to describe this as "
25636 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
25637 "the original disk image is left intact."
25641 #: ../tools/virt-resize.pl:418
25643 "Note that when you delete a partition, then anything contained in the "
25644 "partition is also deleted. Furthermore, this causes any partitions that "
25645 "come after to be I<renumbered>, which can easily make your guest unbootable."
25649 #: ../tools/virt-resize.pl:429
25650 msgid "B<--LV-expand logvol>"
25654 #: ../tools/virt-resize.pl:431
25656 "This takes the logical volume and, as a final step, expands it to fill all "
25657 "the space available in its volume group. A typical usage, assuming a Linux "
25658 "guest with a single PV C</dev/sda2> and a root device called "
25659 "C</dev/vg_guest/lv_root> would be:"
25663 #: ../tools/virt-resize.pl:436
25666 " virt-resize indisk outdisk \\\n"
25667 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
25672 #: ../tools/virt-resize.pl:439
25674 "This would first expand the partition (and PV), and then expand the root "
25675 "device to fill the extra space in the PV."
25679 #: ../tools/virt-resize.pl:442
25681 "The contents of the LV are also resized if virt-resize knows how to do "
25682 "that. You can stop virt-resize from trying to expand the content by using "
25683 "the option C<--no-expand-content>."
25687 #: ../tools/virt-resize.pl:446
25688 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
25692 #: ../tools/virt-resize.pl:449
25694 "You can give this option multiple times, I<but> it doesn't make sense to do "
25695 "this unless the logical volumes you specify are all in different volume "
25700 #: ../tools/virt-resize.pl:457
25701 msgid "B<--no-copy-boot-loader>"
25705 #: ../tools/virt-resize.pl:459
25707 "By default, virt-resize copies over some sectors at the start of the disk "
25708 "(up to the beginning of the first partition). Commonly these sectors "
25709 "contain the Master Boot Record (MBR) and the boot loader, and are required "
25710 "in order for the guest to boot correctly."
25714 #: ../tools/virt-resize.pl:464
25716 "If you specify this flag, then this initial copy is not done. You may need "
25717 "to reinstall the boot loader in this case."
25721 #: ../tools/virt-resize.pl:472
25722 msgid "B<--no-extra-partition>"
25726 #: ../tools/virt-resize.pl:474
25728 "By default, virt-resize creates an extra partition if there is any extra, "
25729 "unused space after all resizing has happened. Use this option to prevent "
25730 "the extra partition from being created. If you do this then the extra space "
25731 "will be inaccessible until you run fdisk, parted, or some other partitioning "
25732 "tool in the guest."
25736 #: ../tools/virt-resize.pl:480
25738 "Note that if the surplus space is smaller than 10 MB, no extra partition "
25743 #: ../tools/virt-resize.pl:487
25744 msgid "B<--no-expand-content>"
25748 #: ../tools/virt-resize.pl:489
25750 "By default, virt-resize will try to expand the direct contents of "
25751 "partitions, if it knows how (see C<--expand> option above)."
25755 #: ../tools/virt-resize.pl:492
25757 "If you give the C<--no-expand-content> option then virt-resize will not "
25762 #: ../tools/virt-resize.pl:499
25763 msgid "B<-d> | B<--debug>"
25767 #: ../tools/virt-resize.pl:507
25768 msgid "B<-n> | B<--dryrun>"
25772 #: ../tools/virt-resize.pl:509
25773 msgid "Print a summary of what would be done, but don't do anything."
25777 #: ../tools/virt-resize.pl:515
25778 msgid "B<-q> | B<--quiet>"
25782 #: ../tools/virt-resize.pl:517
25783 msgid "Don't print the summary."
25787 #: ../tools/virt-resize.pl:525
25789 "Specify the format of the input disk image. If this flag is not given then "
25790 "it is auto-detected from the image itself."
25794 #: ../tools/virt-resize.pl:531
25796 "Note that this option I<does not> affect the output format. See L</QCOW2 "
25797 "AND NON-SPARSE RAW FORMATS>."
25801 #: ../tools/virt-resize.pl:538
25802 msgid "B<--output-format> raw"
25806 #: ../tools/virt-resize.pl:540
25808 "Specify the format of the output disk image. If this flag is not given then "
25809 "it is auto-detected from the image itself."
25813 #: ../tools/virt-resize.pl:546
25815 "Note that you still need to create the output disk with the right format. "
25816 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
25820 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
25825 #: ../tools/virt-resize.pl:1424
25826 msgid "\"Partition 1 does not end on cylinder boundary.\""
25830 #: ../tools/virt-resize.pl:1426
25832 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
25833 "means the partitions will not be aligned to the ancient CHS geometry. "
25834 "However CHS geometry is meaningless for disks manufactured since the early "
25835 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
25836 "cylinders is not required by any modern operating system."
25840 #: ../tools/virt-resize.pl:1433
25841 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25845 #: ../tools/virt-resize.pl:1435
25847 "In Windows Vista and later versions, Microsoft switched to using a separate "
25848 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
25849 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
25850 "the boot partition. Doing so seems to break the guest completely. However "
25851 "expanding the second partition (ie. C: drive) should work."
25855 #: ../tools/virt-resize.pl:1442
25857 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
25858 "NTFS partitions have been expanded. This is just a safety check and (unless "
25859 "it find errors) is nothing to worry about."
25863 #: ../tools/virt-resize.pl:1446
25864 msgid "GUEST BOOT STUCK AT \"GRUB\""
25868 #: ../tools/virt-resize.pl:1448
25870 "If a Linux guest does not boot after resizing, and the boot is stuck after "
25871 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
25872 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
25873 "although we think is to do with partition alignment."
25877 #: ../tools/virt-resize.pl:1453
25880 " guestfish -i -a newdisk\n"
25881 " ><fs> cat /boot/grub/device.map\n"
25882 " # check the contents of this file are sensible or\n"
25883 " # edit the file if necessary\n"
25884 " ><fs> grub-install / /dev/vda\n"
25890 #: ../tools/virt-resize.pl:1460
25892 "For more flexible guest reconfiguration, including if you need to specify "
25893 "other parameters to grub-install, use L<virt-rescue(1)>."
25897 #: ../tools/virt-resize.pl:1463
25898 msgid "ALTERNATIVE TOOLS"
25902 #: ../tools/virt-resize.pl:1465
25904 "There are several proprietary tools for resizing partitions. We won't "
25905 "mention any here."
25909 #: ../tools/virt-resize.pl:1468
25911 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
25912 "operations on disk images. They can resize and move partitions, but I don't "
25913 "think they can do anything with the contents, and they certainly don't "
25918 #: ../tools/virt-resize.pl:1473
25920 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
25921 "but at a much lower level. You will probably end up hand-calculating sector "
25922 "offsets, which is something that virt-resize was designed to avoid. If you "
25923 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
25928 #: ../tools/virt-resize.pl:1488
25930 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
25931 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
25932 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, "
25933 "L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, "
25934 "L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
25938 #: ../tools/virt-list-filesystems.pl:32
25939 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
25943 #: ../tools/virt-list-filesystems.pl:36
25946 " virt-list-filesystems [--options] domname\n"
25951 #: ../tools/virt-list-filesystems.pl:38
25954 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
25959 #: ../tools/virt-list-filesystems.pl:42
25961 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
25962 "are contained in a virtual machine or disk image."
25966 #: ../tools/virt-list-filesystems.pl:46
25968 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
25969 "functionality. For more complex cases you should look at the "
25970 "L<guestfish(1)> tool."
25974 #: ../tools/virt-list-filesystems.pl:105
25976 "With this option, C<virt-list-filesystems> displays the type of each "
25977 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
25981 #: ../tools/virt-list-filesystems.pl:112
25982 msgid "B<-a> | B<--all>"
25986 #: ../tools/virt-list-filesystems.pl:114
25988 "Normally we only show mountable filesystems. If this option is given then "
25989 "swap devices are shown too."
25993 #: ../tools/virt-list-filesystems.pl:188
25995 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
25996 "L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
25997 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26001 #: ../tools/virt-cat.pl:33
26002 msgid "virt-cat - Display a file in a virtual machine"
26006 #: ../tools/virt-cat.pl:37
26009 " virt-cat [--options] domname file\n"
26014 #: ../tools/virt-cat.pl:39
26017 " virt-cat [--options] disk.img [disk.img ...] file\n"
26022 #: ../tools/virt-cat.pl:43
26024 "C<virt-cat> is a command line tool to display the contents of C<file> where "
26025 "C<file> exists in the named virtual machine (or disk image)."
26029 #: ../tools/virt-cat.pl:46
26031 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
26032 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
26037 #: ../tools/virt-cat.pl:52
26038 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
26042 #: ../tools/virt-cat.pl:55
26045 " virt-cat mydomain /etc/fstab\n"
26050 #: ../tools/virt-cat.pl:57
26051 msgid "List syslog messages from a VM:"
26055 #: ../tools/virt-cat.pl:59
26058 " virt-cat mydomain /var/log/messages | tail\n"
26063 #: ../tools/virt-cat.pl:61
26064 msgid "Find out what DHCP IP address a VM acquired:"
26068 #: ../tools/virt-cat.pl:63
26071 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
26076 #: ../tools/virt-cat.pl:65
26077 msgid "Find out what packages were recently installed:"
26081 #: ../tools/virt-cat.pl:67
26084 " virt-cat mydomain /var/log/yum.log | tail\n"
26089 #: ../tools/virt-cat.pl:69
26090 msgid "Find out who is logged on inside a virtual machine:"
26094 #: ../tools/virt-cat.pl:71
26097 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
26103 #: ../tools/virt-cat.pl:74
26104 msgid "or who was logged on:"
26108 #: ../tools/virt-cat.pl:76
26111 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
26112 " last -f /tmp/wtmp\n"
26117 #: ../tools/virt-cat.pl:187
26119 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, "
26120 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26124 #: ../tools/virt-tar.pl:33
26125 msgid "virt-tar - Extract or upload files to a virtual machine"
26129 #: ../tools/virt-tar.pl:37
26132 " virt-tar [--options] -x domname directory tarball\n"
26137 #: ../tools/virt-tar.pl:39
26140 " virt-tar [--options] -u domname tarball directory\n"
26145 #: ../tools/virt-tar.pl:41
26148 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
26153 #: ../tools/virt-tar.pl:43
26156 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
26161 #: ../tools/virt-tar.pl:47
26162 msgid "Download C</home> from the VM into a local tarball:"
26166 #: ../tools/virt-tar.pl:49
26169 " virt-tar -x domname /home home.tar\n"
26174 #: ../tools/virt-tar.pl:51
26177 " virt-tar -zx domname /home home.tar.gz\n"
26182 #: ../tools/virt-tar.pl:53
26183 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
26187 #: ../tools/virt-tar.pl:55
26190 " virt-tar -u domname uploadstuff.tar /tmp\n"
26195 #: ../tools/virt-tar.pl:57
26198 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
26203 #: ../tools/virt-tar.pl:61
26205 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
26206 "virtual machines. If you do this, you risk disk corruption in the VM. "
26207 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
26211 #: ../tools/virt-tar.pl:66
26213 "You can use C<-x> (extract) on live virtual machines, but you might get "
26214 "inconsistent results or errors if there is filesystem activity inside the "
26215 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
26216 "work, but the only way to guarantee consistent results is if the virtual "
26217 "machine is shut down."
26221 #: ../tools/virt-tar.pl:74
26223 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
26224 "parts of a guest filesystem. There are many possibilities: making backups, "
26225 "uploading data files, snooping on guest activity, fixing or customizing "
26230 #: ../tools/virt-tar.pl:79
26232 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
26233 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
26234 "should look at the L<guestfish(1)> tool."
26238 #: ../tools/virt-tar.pl:83
26240 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
26241 "its contents (recursively) from the virtual machine into a local tarball. "
26242 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
26243 "virtual machine. You cannot use these two options together."
26247 #: ../tools/virt-tar.pl:89
26249 "In addition, you may need to use the C<-z> (gZip) option to enable "
26250 "compression. When uploading, you have to specify C<-z> if the upload file "
26251 "is compressed because virt-tar won't detect this on its own."
26255 #: ../tools/virt-tar.pl:93
26257 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
26258 "example it cannot do PKZip files or bzip2 compression. If you want that "
26259 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
26260 "the L<libguestfs(3)> API)."
26264 #: ../tools/virt-tar.pl:151
26265 msgid "B<-x> | B<--extract> | B<--download>"
26269 #: ../tools/virt-tar.pl:153
26270 msgid "B<-u> | B<--upload>"
26274 #: ../tools/virt-tar.pl:155
26276 "Use C<-x> to extract (download) a directory from a virtual machine to a "
26281 #: ../tools/virt-tar.pl:158
26283 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
26284 "Please read the L</WARNING> section above before using this option."
26288 #: ../tools/virt-tar.pl:162
26289 msgid "You must specify exactly one of these options."
26293 #: ../tools/virt-tar.pl:168
26294 msgid "B<-z> | B<--gzip>"
26298 #: ../tools/virt-tar.pl:170
26299 msgid "Specify that the input or output tarball is gzip-compressed."
26303 #: ../tools/virt-tar.pl:283
26305 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26306 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
26307 "L<http://libguestfs.org/>."
26311 #: ../tools/virt-rescue.pl:33
26312 msgid "virt-rescue - Run a rescue shell on a virtual machine"
26316 #: ../tools/virt-rescue.pl:37
26319 " virt-rescue [--options] domname\n"
26324 #: ../tools/virt-rescue.pl:39
26327 " virt-rescue [--options] disk.img [disk.img ...]\n"
26332 #: ../tools/virt-rescue.pl:43
26334 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
26335 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
26336 "you from doing this, but doesn't catch all cases."
26340 #: ../tools/virt-rescue.pl:47
26342 "However if you use the I<--ro> (read only) option, then you can attach a "
26343 "shell to a live virtual machine. The results might be strange or "
26344 "inconsistent at times but you won't get disk corruption."
26348 #: ../tools/virt-rescue.pl:53
26350 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
26351 "need for a CD. virt-rescue gives you a rescue shell and some simple "
26352 "recovery tools which you can use to examine or rescue a virtual machine or "
26357 #: ../tools/virt-rescue.pl:58
26359 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
26360 "on disk image(s):"
26364 #: ../tools/virt-rescue.pl:61
26367 " virt-rescue GuestName\n"
26372 #: ../tools/virt-rescue.pl:63
26375 " virt-rescue --ro /path/to/disk.img\n"
26380 #: ../tools/virt-rescue.pl:65
26383 " virt-rescue /dev/sdc\n"
26388 #: ../tools/virt-rescue.pl:67
26389 msgid "For live VMs you I<must> use the --ro option."
26393 #: ../tools/virt-rescue.pl:69
26395 "When you run virt-rescue on a virtual machine or disk image, you are placed "
26396 "in an interactive bash shell where you can use many ordinary Linux "
26397 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
26398 "appliance. You must mount the virtual machine's filesystems by hand. There "
26399 "is an empty directory called C</sysroot> where you can mount filesystems."
26403 #: ../tools/virt-rescue.pl:76
26405 "In the example below, we list logical volumes, then choose one to mount "
26406 "under C</sysroot>:"
26410 #: ../tools/virt-rescue.pl:79
26414 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
26415 " lv_root vg_f11x64 -wi-a- 8.83G\n"
26416 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
26417 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
26418 " ><rescue> ls /sysroot\n"
26423 #: ../tools/virt-rescue.pl:86
26425 "If you don't know what filesystems are available on the virtual machine then "
26426 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
26430 #: ../tools/virt-rescue.pl:92
26432 "Virt-rescue can be used on I<any> disk image file or device, not just a "
26433 "virtual machine. For example you can use it on a blank file if you want to "
26434 "partition that file (although we would recommend using L<guestfish(1)> "
26435 "instead as it is more suitable for this purpose). You can even use "
26436 "virt-rescue on things like SD cards."
26440 #: ../tools/virt-rescue.pl:98
26442 "This tool is just designed for quick interactive hacking on a virtual "
26443 "machine. For more structured access to a virtual machine disk image, you "
26444 "should use L<guestfs(3)>. To get a structured shell that you can use to "
26445 "make scripted changes to guests, use L<guestfish(1)>."
26449 #: ../tools/virt-rescue.pl:127
26450 msgid "B<--append kernelopts>"
26454 #: ../tools/virt-rescue.pl:129
26455 msgid "Pass additional options to the rescue kernel."
26459 #: ../tools/virt-rescue.pl:164
26460 msgid "B<--memsize MB> | B<-m MB>"
26464 #: ../tools/virt-rescue.pl:166
26466 "Change the amount of memory allocated to the rescue system. The default is "
26467 "set by libguestfs and is small but adequate for running system tools. The "
26468 "occasional program might need more memory. The parameter is specified in "
26473 #: ../tools/virt-rescue.pl:175
26474 msgid "B<--network MB>"
26478 #: ../tools/virt-rescue.pl:177
26479 msgid "Enable QEMU user networking in the guest."
26483 #: ../tools/virt-rescue.pl:183
26484 msgid "B<--ro> | B<-r>"
26488 #: ../tools/virt-rescue.pl:185
26489 msgid "Open the image read-only."
26493 #: ../tools/virt-rescue.pl:197
26495 "Enable SELinux in the rescue appliance. You should read "
26496 "L<guestfs(3)/SELINUX> before using this option."
26500 #: ../tools/virt-rescue.pl:257
26502 "Several environment variables affect virt-rescue. See "
26503 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
26507 #: ../tools/virt-rescue.pl:269
26509 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
26510 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26514 #: ../tools/virt-make-fs.pl:37
26515 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
26519 #: ../tools/virt-make-fs.pl:41
26522 " virt-make-fs [--options] input.tar output.img\n"
26527 #: ../tools/virt-make-fs.pl:43
26530 " virt-make-fs [--options] input.tar.gz output.img\n"
26535 #: ../tools/virt-make-fs.pl:45
26538 " virt-make-fs [--options] directory output.img\n"
26543 #: ../tools/virt-make-fs.pl:49
26545 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
26546 "archive or some files in a directory. It is similar to tools like "
26547 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
26548 "it can create common filesystem types like ext2/3 or NTFS, which can be "
26549 "useful if you want to attach these filesystems to existing virtual machines "
26550 "(eg. to import large amounts of read-only data to a VM)."
26554 #: ../tools/virt-make-fs.pl:57
26555 msgid "Basic usage is:"
26559 #: ../tools/virt-make-fs.pl:59
26562 " virt-make-fs input output\n"
26567 #: ../tools/virt-make-fs.pl:61
26569 "where C<input> is either a directory containing files that you want to add, "
26570 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
26571 "C<output> is a disk image. The input type is detected automatically. The "
26572 "output disk image defaults to a raw ext2 image unless you specify extra "
26573 "flags (see L</OPTIONS> below)."
26577 #: ../tools/virt-make-fs.pl:67
26578 msgid "EXTRA SPACE"
26582 #: ../tools/virt-make-fs.pl:69
26584 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
26585 "the files that it contains, but might have extra space. Depending on how "
26586 "you are going to use the output, you might think this extra space is wasted "
26587 "and want to minimize it, or you might want to leave space so that more files "
26588 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
26589 "but you can use the C<--size> flag to leave space in the filesystem if you "
26594 #: ../tools/virt-make-fs.pl:77
26596 "An alternative way to leave extra space but not make the output image any "
26597 "bigger is to use an alternative disk image format (instead of the default "
26598 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
26599 "image format (check your hypervisor supports this before using it). This "
26600 "allows you to choose a large C<--size> but the extra space won't actually be "
26601 "allocated in the image until you try to store something in it."
26605 #: ../tools/virt-make-fs.pl:85
26607 "Don't forget that you can also use local commands including L<resize2fs(8)> "
26608 "and L<virt-resize(1)> to resize existing filesystems, or rerun "
26609 "virt-make-resize to build another image from scratch."
26613 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
26618 #: ../tools/virt-make-fs.pl:91
26621 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
26626 #: ../tools/virt-make-fs.pl:93
26627 msgid "FILESYSTEM TYPE"
26631 #: ../tools/virt-make-fs.pl:95
26633 "The default filesystem type is C<ext2>. Just about any filesystem type that "
26634 "libguestfs supports can be used (but I<not> read-only formats like "
26635 "ISO9660). Here are some of the more common choices:"
26639 #: ../tools/virt-make-fs.pl:101
26644 #: ../tools/virt-make-fs.pl:103
26646 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
26647 "you are not going to use the filesystem in a way that requires the journal, "
26648 "then this is just wasted overhead."
26652 #: ../tools/virt-make-fs.pl:107
26653 msgid "I<ntfs> or I<vfat>"
26657 #: ../tools/virt-make-fs.pl:109
26658 msgid "Useful if exporting data to a Windows guest."
26662 #: ../tools/virt-make-fs.pl:111
26664 "I<Note for vfat>: The tar archive or local directory must only contain files "
26665 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
26666 "program running within libguestfs is unable to change the ownership of "
26667 "non-root files, since vfat itself does not support this."
26671 #: ../tools/virt-make-fs.pl:116
26676 #: ../tools/virt-make-fs.pl:118
26678 "Lower overhead than C<ext2>, but certain limitations on filename length and "
26679 "total filesystem size."
26683 #: ../tools/virt-make-fs.pl:125
26686 " virt-make-fs --type=minix input minixfs.img\n"
26691 #: ../tools/virt-make-fs.pl:127
26692 msgid "TO PARTITION OR NOT TO PARTITION"
26696 #: ../tools/virt-make-fs.pl:129
26697 msgid "Optionally virt-make-fs can add a partition table to the output disk."
26701 #: ../tools/virt-make-fs.pl:131
26703 "Adding a partition can make the disk image more compatible with certain "
26704 "virtualized operating systems which don't expect to see a filesystem "
26705 "directly located on a block device (Linux doesn't care and will happily "
26706 "handle both types)."
26710 #: ../tools/virt-make-fs.pl:136
26712 "On the other hand, if you have a partition table then the output image is no "
26713 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
26714 "directly on a partitioned disk image. (However libguestfs tools such as "
26715 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
26719 #: ../tools/virt-make-fs.pl:144
26720 msgid "Add an MBR partition:"
26724 #: ../tools/virt-make-fs.pl:146
26727 " virt-make-fs --partition -- input disk.img\n"
26732 #: ../tools/virt-make-fs.pl:148
26734 "If the output disk image could be terabyte-sized or larger, it's better to "
26735 "use an EFI/GPT-compatible partition table:"
26739 #: ../tools/virt-make-fs.pl:151
26742 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
26747 #: ../tools/virt-make-fs.pl:179
26748 msgid "Enable debugging information."
26752 #: ../tools/virt-make-fs.pl:185
26753 msgid "B<--size=E<lt>NE<gt>>"
26757 #: ../tools/virt-make-fs.pl:187
26758 msgid "B<--size=+E<lt>NE<gt>>"
26762 #: ../tools/virt-make-fs.pl:189
26763 msgid "B<-s E<lt>NE<gt>>"
26767 #: ../tools/virt-make-fs.pl:191
26768 msgid "B<-s +E<lt>NE<gt>>"
26772 #: ../tools/virt-make-fs.pl:193
26773 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
26777 #: ../tools/virt-make-fs.pl:196
26779 "If this option is I<not> given, then the output image will be just large "
26780 "enough to contain all the files, with not much wasted space."
26784 #: ../tools/virt-make-fs.pl:199
26786 "To choose a fixed size output disk, specify an absolute number followed by "
26787 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
26788 "Petabytes or Exabytes. This must be large enough to contain all the input "
26789 "files, else you will get an error."
26793 #: ../tools/virt-make-fs.pl:204
26795 "To leave extra space, specify C<+> (plus sign) and a number followed by "
26796 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
26797 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
26798 "the input files, and (approximately) an extra 200 MB free space."
26802 #: ../tools/virt-make-fs.pl:210
26804 "Note that virt-make-fs estimates free space, and therefore will not produce "
26805 "filesystems containing precisely the free space requested. (It is much more "
26806 "expensive and time-consuming to produce a filesystem which has precisely the "
26807 "desired free space)."
26811 #: ../tools/virt-make-fs.pl:219
26812 msgid "B<--format=E<lt>fmtE<gt>>"
26816 #: ../tools/virt-make-fs.pl:221
26817 msgid "B<-F E<lt>fmtE<gt>>"
26821 #: ../tools/virt-make-fs.pl:223
26822 msgid "Choose the output disk image format."
26826 #: ../tools/virt-make-fs.pl:225
26827 msgid "The default is C<raw> (raw disk image)."
26831 #: ../tools/virt-make-fs.pl:227
26833 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
26834 "that would really make sense here is C<qcow2>."
26838 #: ../tools/virt-make-fs.pl:234
26839 msgid "B<--type=E<lt>fsE<gt>>"
26843 #: ../tools/virt-make-fs.pl:236
26844 msgid "B<-t E<lt>fsE<gt>>"
26848 #: ../tools/virt-make-fs.pl:238
26849 msgid "Choose the output filesystem type."
26853 #: ../tools/virt-make-fs.pl:240
26854 msgid "The default is C<ext2>."
26858 #: ../tools/virt-make-fs.pl:242
26859 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
26863 #: ../tools/virt-make-fs.pl:249
26864 msgid "B<--partition>"
26868 #: ../tools/virt-make-fs.pl:251
26869 msgid "B<--partition=E<lt>parttypeE<gt>>"
26873 #: ../tools/virt-make-fs.pl:253
26875 "If specified, this flag adds an MBR partition table to the output disk "
26880 #: ../tools/virt-make-fs.pl:256
26882 "You can change the partition table type, eg. C<--partition=gpt> for large "
26887 #: ../tools/virt-make-fs.pl:259
26889 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
26890 "might consider the next parameter to be the partition type. For example:"
26894 #: ../tools/virt-make-fs.pl:263
26897 " virt-make-fs --partition input.tar ...\n"
26902 #: ../tools/virt-make-fs.pl:265
26904 "would cause virt-make-fs to think you wanted to use a partition type of "
26905 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
26906 "dash) between options and the input file argument:"
26910 #: ../tools/virt-make-fs.pl:269
26913 " virt-make-fs --partition -- input.tar ...\n"
26918 #: ../tools/virt-make-fs.pl:536
26920 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
26921 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
26922 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
26926 #: ../tools/virt-make-fs.pl:553
26929 " export LIBGUESTFS_DEBUG=1\n"
26930 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
26935 #: ../tools/virt-make-fs.pl:556
26937 "Attach /tmp/virt-make-fs.log to a new bug report at "
26938 "L<https://bugzilla.redhat.com/>"
26942 #: ../tools/virt-list-partitions.pl:32
26943 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
26947 #: ../tools/virt-list-partitions.pl:36
26950 " virt-list-partitions [--options] domname\n"
26955 #: ../tools/virt-list-partitions.pl:38
26958 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
26963 #: ../tools/virt-list-partitions.pl:42
26965 "C<virt-list-partitions> is a command line tool to list the partitions that "
26966 "are contained in a virtual machine or disk image. It is mainly useful as a "
26967 "first step to using L<virt-resize(1)>."
26971 #: ../tools/virt-list-partitions.pl:47
26973 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
26974 "functionality. For more complex cases you should look at the "
26975 "L<guestfish(1)> tool."
26979 #: ../tools/virt-list-partitions.pl:104
26980 msgid "B<-h> | B<--human-readable>"
26984 #: ../tools/virt-list-partitions.pl:106
26985 msgid "Show sizes in human-readable form (eg. \"1G\")."
26989 #: ../tools/virt-list-partitions.pl:114
26991 "With this option, C<virt-list-partitions> displays the type and size of each "
26992 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
26996 #: ../tools/virt-list-partitions.pl:121
26997 msgid "B<-t> | B<--total>"
27001 #: ../tools/virt-list-partitions.pl:123
27002 msgid "Display the total size of each block device (as a separate row or rows)."
27006 #: ../tools/virt-list-partitions.pl:256
27008 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, "
27009 "L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
27010 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."