|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-api
[Xen-API] [PATCH] Set the VM.affinity field when BIOS strings are	set.
 
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
Set the VM.affinity field when BIOS strings are set.
Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>
diff -r e04a0c5c3423 ocaml/xapi/xapi_vm.ml
--- a/ocaml/xapi/xapi_vm.ml     Mon Nov 23 15:39:21 2009 +0000
+++ b/ocaml/xapi/xapi_vm.ml     Tue Nov 24 13:18:17 2009 +0000
@@ -1108,7 +1108,10 @@
        let current_strings = Db.VM.get_bios_strings ~__context ~self:vm in
        if List.length current_strings > 0 then
                raise 
(Api_errors.Server_error(Api_errors.vm_bios_strings_already_set, []))
-       else
+       else begin
                let bios_strings = Db.Host.get_bios_strings ~__context 
~self:host in
-               Db.VM.set_bios_strings ~__context ~self:vm ~value:bios_strings
+               Db.VM.set_bios_strings ~__context ~self:vm ~value:bios_strings;
+               (* also set the affinity field to push the VM to start on this 
host *)
+               Db.VM.set_affinity ~__context ~self:vm ~value:host
+       end
        
 
bios-affinity 
Description: Text document 
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
 
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread> |  
- [Xen-API] [PATCH] Set the VM.affinity field when BIOS strings are	set.,
Rob Hoes <=
  
 |  
  
 | 
    | 
  
  
    |   | 
    |