WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

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

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] Set the VM.affinity field when BIOS strings are set.
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# 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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Set the VM.affinity field when BIOS strings are set., Rob Hoes <=