Skip to content

Commit

Permalink
CA-396743: forbid setting NBD purpose on unmanaged networks
Browse files Browse the repository at this point in the history
We wouldn't be able to add the correct firewall rules,
and you're not meant to use the boot from SAN network for NBD.

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Aug 6, 2024
1 parent 3bbf558 commit 4b3f82f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ocaml/xapi/xapi_network.ml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ let assert_can_add_purpose ~__context ~network:_ ~current:_ newval =
assert_no_net_has_bad_porpoise [`nbd]

let add_purpose ~__context ~self ~value =
assert_network_is_managed ~__context ~self:value ;
let current = Db.Network.get_purpose ~__context ~self in
if not (List.mem value current) then (
assert_can_add_purpose ~__context ~network:self ~current value ;
Expand Down

0 comments on commit 4b3f82f

Please sign in to comment.