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 5 of 8] VSwitch controller field may be blank on pool j

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 5 of 8] VSwitch controller field may be blank on pool join
From: Rob Hoes <rob.hoes@xxxxxxxxxx>
Date: Fri, 9 Jul 2010 15:59:51 +0100
Delivery-date: Fri, 09 Jul 2010 08:05:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1278687586@xxxxxxxxxxxxxxxxxxxxx>
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>
References: <patchbomb.1278687586@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
# Date 1278673890 -3600
# Node ID 9e70e8fd232cc15d766362078a53571328e8f28b
# Parent  6294016ba6c3817a2423206f4ba76bd607e7d386
VSwitch controller field may be blank on pool join

If the pool.vswitch_controller field is blank on a joining host, but not on the 
pool, the join is allowed. The openvswitch in the joining host will be 
controlled by the pool's controller.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 6294016ba6c3 -r 9e70e8fd232c ocaml/idl/datamodel.ml
--- a/ocaml/idl/datamodel.ml
+++ b/ocaml/idl/datamodel.ml
@@ -5210,6 +5210,9 @@
 let pool_set_vswitch_controller = call
   ~in_oss_since:None
   ~in_product_since:rel_midnight_ride
+  ~lifecycle:[
+    Published, rel_midnight_ride, "Set the IP address of the vswitch 
controller.";
+    Extended, rel_cowley, "Allow to be set to the empty string (no controller 
is used)."]
   ~name:"set_vswitch_controller"
   ~params:[String, "address", "IP address of the vswitch controller."]
   ~doc:"Set the IP address of the vswitch controller."
diff -r 6294016ba6c3 -r 9e70e8fd232c ocaml/xapi/xapi_pool.ml
--- a/ocaml/xapi/xapi_pool.ml
+++ b/ocaml/xapi/xapi_pool.ml
@@ -226,7 +226,7 @@
                        let my_controller = Db.Pool.get_vswitch_controller 
~__context ~self:my_pool in
                        let pool = List.hd (Client.Pool.get_all rpc session_id) 
in
                        let controller = Client.Pool.get_vswitch_controller 
~rpc ~session_id ~self:pool in
-                       if my_controller <> controller then
+                       if my_controller <> controller && my_controller <> "" 
then
                                raise 
(Api_errors.Server_error(Api_errors.operation_not_allowed, ["vswitch controller 
address differs"]))
                | _ -> ()
        in
@@ -655,7 +655,7 @@
                (* delete me from the database - this will in turn cause PBDs 
and PIFs to be GCed *)
                Db.Host.destroy ~__context ~self:host;
 
-               debug "Reset CPU features";
+               debug "Pool.eject: resetting CPU features";
                (* Clear the CPU feature masks from the Xen command line *)
                ignore (Xen_cmdline.delete_cpuid_masks
                        ["cpuid_mask_ecx"; "cpuid_mask_edx"; 
"cpuid_mask_ext_ecx"; "cpuid_mask_ext_edx"]);
@@ -1396,7 +1396,8 @@
                let pool = Helpers.get_pool ~__context in
                let current_address = Db.Pool.get_vswitch_controller ~__context 
~self:pool in
                if current_address <> address then begin
-                       assert_is_valid_ip address;
+                       if address <> "" then
+                               assert_is_valid_ip address;
                        Db.Pool.set_vswitch_controller ~__context ~self:pool 
~value:address;
                        List.iter (fun host -> 
Helpers.update_vswitch_controller ~__context ~host) (Db.Host.get_all ~__context)
                end
 ocaml/idl/datamodel.ml  |  3 +++
 ocaml/xapi/xapi_pool.ml |  7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)


Attachment: xen-api.hg-5.patch
Description: Text Data

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