]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
XC-66: Default vm mac address generation to be deterministic; add a random option...
authorPrashanth Mundkur <prashanth.mundkur@citrix.com>
Sat, 20 Jun 2009 02:58:58 +0000 (19:58 -0700)
committerPrashanth Mundkur <prashanth.mundkur@citrix.com>
Sat, 20 Jun 2009 02:58:58 +0000 (19:58 -0700)
xenvm/vmconfig.ml

index 9405da8572378e8f774d87d31dc8906489fab9c0..43b36702972e49dd7d950988f88ef16e629c0228 100644 (file)
@@ -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;
 
        {