Skip to content

Commit 5b23efd

Browse files
committed
Move the --offline argument definition to Xenvm_common
Offline mode will be supported by multiple commands, not just lvchange. Signed-off-by: David Scott <[email protected]>
1 parent 64ea4ed commit 5b23efd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

xenvm/lvchange.ml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,11 @@ let del_tag_arg =
170170
let doc = "Remove the given tag from the LV" in
171171
Arg.(value & opt (some string) None & info ["deltag"] ~docv:"DELTAG" ~doc)
172172

173-
let offline_arg =
174-
let doc = "Assume xenvmd is offline and read metadata from the disk" in
175-
Arg.(value & flag & info [ "offline" ] ~docv:"OFFLINE" ~doc)
176-
177173
let lvchange_cmd =
178174
let doc = "Change the attributes of a logical volume" in
179175
let man = [
180176
`S "DESCRIPTION";
181177
`P "lvchange allows you to change the attributes of a logical volume including making them known to the kernel ready for use."
182178
] in
183-
Term.(pure lvchange $ Xenvm_common.copts_t $ Xenvm_common.name_arg $ Xenvm_common.physical_device_arg $ action_arg $ perm_arg $ refresh_arg $ add_tag_arg $ del_tag_arg $ offline_arg),
179+
Term.(pure lvchange $ Xenvm_common.copts_t $ Xenvm_common.name_arg $ Xenvm_common.physical_device_arg $ action_arg $ perm_arg $ refresh_arg $ add_tag_arg $ del_tag_arg $ Xenvm_common.offline_arg),
184180
Term.info "lvchange" ~sdocs:"COMMON OPTIONS" ~doc ~man

xenvm/xenvm_common.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,8 @@ let action_arg =
493493
Activation of a logical volume creates a symbolic link /dev/VolumeGroupName/LogicalVolumeName pointing to the device node. This link is removed on deactivation. All software and scripts should access the device through this symbolic link and present this as the name of the device. The location and name of the underlying device node may depend on the distribution and configuration (e.g. udev) and might change from release to release." in
494494
let a = Arg.(value & opt (some char) None & info ["a"] ~docv:"ACTIVATE" ~doc) in
495495
Term.(pure parse_action $ a)
496+
497+
let offline_arg =
498+
let doc = "Assume xenvmd is offline and read metadata from the disk"
499+
in
500+
Arg.(value & flag & info [ "offline" ] ~docv:"OFFLINE" ~doc)

0 commit comments

Comments
 (0)