[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] Set the VM.affinity field when BIOS strings are set.


  • To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Rob Hoes <rob.hoes@xxxxxxxxxx>
  • Date: Tue, 24 Nov 2009 13:24:05 +0000
  • Delivery-date: Tue, 24 Nov 2009 05:24:28 -0800
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

# 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
        

Attachment: bios-affinity
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.