This does not return logical volumes. For that you will need to
call C<guestfs_lvs>.");
-(*
- ("pvs", (RPVList "physvols", P0), 9, [],
+ ("pvs", (RStringList "physvols", P0), 9, [],
"list the LVM physical volumes (PVs)",
"\
List all the physical volumes detected. This is the equivalent
-of the L<pvs(8)> command.");
+of the L<pvs(8)> command.
- ("vgs", (RVGList "volgroups", P0), 10, [],
+This returns a list of just the device names that contain
+PVs (eg. C</dev/sda2>).
+
+See also C<guestfs_pvs_full>.");
+
+ ("vgs", (RStringList "volgroups", P0), 10, [],
"list the LVM volume groups (VGs)",
"\
List all the volumes groups detected. This is the equivalent
-of the L<vgs(8)> command.");
+of the L<vgs(8)> command.
+
+This returns a list of just the volume group names that were
+detected (eg. C<VolGroup00>).
- ("lvs", (RLVList "logvols", P0), 11, [],
+See also C<guestfs_vgs_full>.");
+
+ ("lvs", (RStringList "logvols", P0), 11, [],
"list the LVM logical volumes (LVs)",
"\
List all the logical volumes detected. This is the equivalent
-of the L<lvs(8)> command.");
-*)
+of the L<lvs(8)> command.
+
+This returns a list of the logical volume device names
+(eg. C</dev/VolGroup00/LogVol00>).
+
+See also C<guestfs_lvs_full>.");
("pvs_full", (RPVList "physvols", P0), 12, [],
"list the LVM physical volumes (PVs)",
"\
List all the physical volumes detected. This is the equivalent
-of the L<pvs(8)> command.");
+of the L<pvs(8)> command. The \"full\" version includes all fields.");
("vgs_full", (RVGList "volgroups", P0), 13, [],
"list the LVM volume groups (VGs)",
"\
List all the volumes groups detected. This is the equivalent
-of the L<vgs(8)> command.");
+of the L<vgs(8)> command. The \"full\" version includes all fields.");
("lvs_full", (RLVList "logvols", P0), 14, [],
"list the LVM logical volumes (LVs)",
"\
List all the logical volumes detected. This is the equivalent
-of the L<lvs(8)> command.");
+of the L<lvs(8)> command. The \"full\" version includes all fields.");
]
(* Column names and types from LVM PVs/VGs/LVs. *)
pr " return rv.ret.%s; /* caller will free */\n" n
| RStringList n ->
pr " /* caller will free this, but we need to add a NULL entry */\n";
- pr " rv.ret.%s.%s_val = safe_realloc (g, rv.ret.%s.%s_val, rv.ret.%s.%s_len + 1);\n" n n n n n n;
+ pr " rv.ret.%s.%s_val =" n n;
+ pr " safe_realloc (g, rv.ret.%s.%s_val,\n" n n;
+ pr " sizeof (char *) * (rv.ret.%s.%s_len + 1));\n"
+ n n;
pr " rv.ret.%s.%s_val[rv.ret.%s.%s_len] = NULL;\n" n n n n;
pr " return rv.ret.%s.%s_val;\n" n n
| RPVList n ->
pr "}\n";
pr "\n"
+(* Generate the POD documentation for guestfish. *)
+and generate_fish_actions_pod () =
+ List.iter (
+ fun (name, style, _, _, _, longdesc) ->
+ let name = replace name '_' '-' in
+ pr "=head2 %s\n\n" name;
+ pr " %s" name;
+ iter_args (
+ function
+ | String n -> pr " %s" n
+ ) (snd style);
+ pr "\n";
+ pr "\n";
+ pr "%s\n\n" longdesc
+ ) sorted_functions
+
(* Generate a C function prototype. *)
and generate_prototype ?(extern = true) ?(static = false) ?(semicolon = true)
?(single_line = false) ?(newline = false) ?(in_daemon = false)
let close = output_to "guestfs-actions.pod" in
generate_actions_pod ();
+ close ();
+
+ let close = output_to "guestfish-actions.pod" in
+ generate_fish_actions_pod ();
close ()