From: Prashanth Mundkur Date: Sat, 20 Jun 2009 02:58:58 +0000 (-0700) Subject: XC-66: Default vm mac address generation to be deterministic; add a random option... X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1ed05bdef6934f47b76332c20c840919ec0aec6e;p=xenclient%2Ftoolstack.git XC-66: Default vm mac address generation to be deterministic; add a random option to get random addresses. --- diff --git a/xenvm/vmconfig.ml b/xenvm/vmconfig.ml index 9405da8..43b3670 100644 --- a/xenvm/vmconfig.ml +++ b/xenvm/vmconfig.ml @@ -180,13 +180,11 @@ let config_nic_of_string vm_uuid s = | _ -> ()) ls; begin match !mac with - | "" -> (* unspecified then just generate a random one *) + | "random" -> mac := generate_random_mac (); - | "vm" -> (* we generate one based on devid/model and vm's uuid *) - mac := generate_vm_mac !id !model vm_uuid; - | _ -> (* otherwise verify and use a random one if unvalid *) + | _ -> (* otherwise verify and use a vm-specific one if invalid *) if not (is_valid_mac !mac) then - mac := generate_random_mac (); + mac := generate_vm_mac !id !model vm_uuid; end; {