From: Richard W.M. Jones Date: Thu, 27 Oct 2011 12:45:22 +0000 (+0100) Subject: generator: Remove DangerWillRobinson. X-Git-Tag: 1.14.0~2 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=6edd6cdebadab0117bc602f02e0dc68ea7d1a2ef;ds=sidebyside generator: Remove DangerWillRobinson. This warning was applied unevenly. Potentially any command can be dangerous or safe, so it was a needless warning. --- diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 9844b94..d3fa3e0 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -2257,7 +2257,7 @@ example C."); ("sfdisk", (RErr, [Device "device"; Int "cyls"; Int "heads"; Int "sectors"; - StringList "lines"], []), 43, [DangerWillRobinson; DeprecatedBy "part_add"], + StringList "lines"], []), 43, [DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -2358,7 +2358,7 @@ This unmounts all mounted filesystems. Some internal mounts are not unmounted by this call."); - ("lvm_remove_all", (RErr, [], []), 48, [DangerWillRobinson; Optional "lvm2"], + ("lvm_remove_all", (RErr, [], []), 48, [Optional "lvm2"], [], "remove all LVM LVs, VGs and PVs", "\ @@ -3371,7 +3371,7 @@ volume to match the new size of the underlying device."); ("sfdisk_N", (RErr, [Device "device"; Int "partnum"; Int "cyls"; Int "heads"; Int "sectors"; - String "line"], []), 99, [DangerWillRobinson; DeprecatedBy "part_add"], + String "line"], []), 99, [DeprecatedBy "part_add"], [], "modify a single partition on a block device", "\ @@ -3617,7 +3617,7 @@ It is just a wrapper around the C L function with flags C. See that manual page for more details."); - ("scrub_device", (RErr, [Device "device"], []), 114, [DangerWillRobinson; Optional "scrub"], + ("scrub_device", (RErr, [Device "device"], []), 114, [Optional "scrub"], [InitNone, Always, TestRun ( (* use /dev/sdc because it's smaller *) [["scrub_device"; "/dev/sdc"]])], "scrub (securely wipe) a device", @@ -3996,7 +3996,7 @@ This function is primarily intended for use by programs. To get a simple list of names, use C. To get a printable directory for human consumption, use C."); - ("sfdiskM", (RErr, [Device "device"; StringList "lines"], []), 139, [DangerWillRobinson; DeprecatedBy "part_add"], + ("sfdiskM", (RErr, [Device "device"; StringList "lines"], []), 139, [DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -5059,7 +5059,7 @@ backwards from the end of the disk (C<-1> is the last sector). Creating a partition which covers the whole disk is not so easy. Use C to do that."); - ("part_disk", (RErr, [Device "device"; String "parttype"], []), 210, [DangerWillRobinson], + ("part_disk", (RErr, [Device "device"; String "parttype"], []), 210, [], [InitEmpty, Always, TestRun ( [["part_disk"; "/dev/sda"; "mbr"]]); InitEmpty, Always, TestRun ( @@ -5341,7 +5341,7 @@ or file C to another destination device or file C. Note this will fail if the source is too short or if the destination is not large enough."); - ("zero_device", (RErr, [Device "device"], []), 228, [DangerWillRobinson; Progress], + ("zero_device", (RErr, [Device "device"], []), 228, [Progress], [InitBasicFSonLVM, Always, TestRun ( [["zero_device"; "/dev/VG/LV"]])], "write zeroes to an entire device", @@ -5760,7 +5760,7 @@ C parameter must be the name of the LUKS mapping device (ie. C) and I the name of the underlying block device."); - ("luks_format", (RErr, [Device "device"; Key "key"; Int "keyslot"], []), 260, [Optional "luks"; DangerWillRobinson], + ("luks_format", (RErr, [Device "device"; Key "key"; Int "keyslot"], []), 260, [Optional "luks"], [], "format a block device as a LUKS encrypted device", "\ @@ -5769,7 +5769,7 @@ the device as a LUKS encrypted device. C is the initial key, which is added to key slot C. (LUKS supports 8 key slots, numbered 0-7)."); - ("luks_format_cipher", (RErr, [Device "device"; Key "key"; Int "keyslot"; String "cipher"], []), 261, [Optional "luks"; DangerWillRobinson], + ("luks_format_cipher", (RErr, [Device "device"; Key "key"; Int "keyslot"; String "cipher"], []), 261, [Optional "luks"], [], "format a block device as a LUKS encrypted device", "\ diff --git a/generator/generator_c.ml b/generator/generator_c.ml index e6023b8..b392809 100644 --- a/generator/generator_c.ml +++ b/generator/generator_c.ml @@ -254,8 +254,6 @@ I.\n\n" pr "%s\n\n" progress_message; if List.mem ProtocolLimitWarning flags then pr "%s\n\n" protocol_limit_warning; - if List.mem DangerWillRobinson flags then - pr "%s\n\n" danger_will_robinson; if List.exists (function Key _ -> true | _ -> false) (args@optargs) then pr "This function takes a key or passphrase parameter which could contain sensitive material. Read the section diff --git a/generator/generator_checks.ml b/generator/generator_checks.ml index 8ee06b5..11fc9cb 100644 --- a/generator/generator_checks.ml +++ b/generator/generator_checks.ml @@ -194,7 +194,6 @@ let () = List.iter ( function | ProtocolLimitWarning - | DangerWillRobinson | FishOutput _ | NotInFish | NotInDocs diff --git a/generator/generator_docstrings.ml b/generator/generator_docstrings.ml index 406bd55..082014c 100644 --- a/generator/generator_docstrings.ml +++ b/generator/generator_docstrings.ml @@ -36,10 +36,6 @@ let protocol_limit_warning = "Because of the message protocol, there is a transfer limit of somewhere between 2MB and 4MB. See L." -let danger_will_robinson = - "B." - let deprecation_notice ?(prefix = "") flags = try let alt = diff --git a/generator/generator_fish.ml b/generator/generator_fish.ml index dc2dc3e..6d6a571 100644 --- a/generator/generator_fish.ml +++ b/generator/generator_fish.ml @@ -136,16 +136,6 @@ Guestfish will prompt for these separately." ("\n\n" ^ protocol_limit_warning) else "" in - (* For DangerWillRobinson commands, we should probably have - * guestfish prompt before allowing you to use them (especially - * in interactive mode). XXX - *) - let warnings = - warnings ^ - if List.mem DangerWillRobinson flags then - ("\n\n" ^ danger_will_robinson) - else "" in - let warnings = warnings ^ match deprecation_notice flags with @@ -865,9 +855,6 @@ Guestfish will prompt for these separately.\n\n"; if List.mem ProtocolLimitWarning flags then pr "%s\n\n" protocol_limit_warning; - if List.mem DangerWillRobinson flags then - pr "%s\n\n" danger_will_robinson; - match deprecation_notice flags with | None -> () | Some txt -> pr "%s\n\n" txt diff --git a/generator/generator_java.ml b/generator/generator_java.ml index 0152bb3..68972bc 100644 --- a/generator/generator_java.ml +++ b/generator/generator_java.ml @@ -113,10 +113,6 @@ public class GuestFS { doc ^ "\n\n" ^ protocol_limit_warning else doc in let doc = - if List.mem DangerWillRobinson flags then - doc ^ "\n\n" ^ danger_will_robinson - else doc in - let doc = match deprecation_notice flags with | None -> doc | Some txt -> doc ^ "\n\n" ^ txt in diff --git a/generator/generator_perl.ml b/generator/generator_perl.ml index f42bc87..d24e775 100644 --- a/generator/generator_perl.ml +++ b/generator/generator_perl.ml @@ -804,8 +804,6 @@ handlers and threads. pr "%s\n\n" longdesc; if List.mem ProtocolLimitWarning flags then pr "%s\n\n" protocol_limit_warning; - if List.mem DangerWillRobinson flags then - pr "%s\n\n" danger_will_robinson; match deprecation_notice flags with | None -> () | Some txt -> pr "%s\n\n" txt diff --git a/generator/generator_python.ml b/generator/generator_python.ml index 48dd24f..c8448aa 100644 --- a/generator/generator_python.ml +++ b/generator/generator_python.ml @@ -642,10 +642,6 @@ class GuestFS: doc ^ "\n\n" ^ protocol_limit_warning else doc in let doc = - if List.mem DangerWillRobinson flags then - doc ^ "\n\n" ^ danger_will_robinson - else doc in - let doc = match deprecation_notice flags with | None -> doc | Some txt -> doc ^ "\n\n" ^ txt in diff --git a/generator/generator_ruby.ml b/generator/generator_ruby.ml index 38121b5..a8416b4 100644 --- a/generator/generator_ruby.ml +++ b/generator/generator_ruby.ml @@ -346,10 +346,6 @@ ruby_user_cancel (VALUE gv) doc ^ "\n\n" ^ protocol_limit_warning else doc in let doc = - if List.mem DangerWillRobinson flags then - doc ^ "\n\n" ^ danger_will_robinson - else doc in - let doc = match deprecation_notice flags with | None -> doc | Some txt -> doc ^ "\n\n" ^ txt in diff --git a/generator/generator_types.ml b/generator/generator_types.ml index 50e9604..9da7e45 100644 --- a/generator/generator_types.ml +++ b/generator/generator_types.ml @@ -207,7 +207,6 @@ type errcode = [ `CannotReturnError | `ErrorIsMinusOne | `ErrorIsNULL ] type flags = | ProtocolLimitWarning (* display warning about protocol size limits *) - | DangerWillRobinson (* flags particularly dangerous commands *) | FishAlias of string (* provide an alias for this cmd in guestfish *) | FishOutput of fish_output_t (* how to display output in guestfish *) | NotInFish (* do not export via guestfish *)