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] Make xiu add a vnc-port entry in XenStore

To: Xen-API <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] Make xiu add a vnc-port entry in XenStore
From: Ewan Mellor <ewan.mellor@xxxxxxxxxxxxx>
Date: Thu, 5 Aug 2010 11:28:36 +0100
Delivery-date: Thu, 05 Aug 2010 03:28:49 -0700
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
User-agent: Mutt/1.5.18 (2008-05-17)
Starting simulated VMs when using xiu is completely broken at the moment.
xapi waits for a vnc-port to be written to XenStore (in one of two
places, depending upon whether the VM is HVM or PV).  xiu doesn't 
currently write a value for this field, and so the VM start hangs for 20
minutes until the watch times out.

The first patch here fixes all the compile-time warnings in xiu.

The second patch writes a vnc-port entry in the two necessary places, for 
every VM that is created.

Ewan.

diff -r 9e71f6b54bfc ocaml/xiu/xiu.ml
--- a/ocaml/xiu/xiu.ml  Wed Aug 04 20:42:21 2010 +0100
+++ b/ocaml/xiu/xiu.ml  Wed Aug 04 23:16:36 2010 +0100
@@ -120,10 +120,11 @@
 
 type sysctl = Sysctl_getdomaininfolist | Sysctl_physinfo | Sysctl_getcpuinfo | 
Sysctl_unknown of int
 
-type hypcall = Hypcall_domain_shutdown
+type hypcall = Hypcall_domain_shutdown | Hypcall_unknown
 
 let hypcall_of_int = function
   | 1 -> Hypcall_domain_shutdown
+  | _ -> Hypcall_unknown
 
 let domctl_of_int = function
        | 1  -> Domctl_create | 2 -> Domctl_destroy
@@ -199,8 +200,8 @@
 
 (** Perform the module (re)loading *)
 let initialise_dummy_devices () = 
-  Unix.system("/sbin/rmmod dummy");
-  Unix.system(sprintf "/sbin/modprobe dummy numdummies=%d" max_dummy_vifs)
+  ignore(Unix.system("/sbin/rmmod dummy"));
+  ignore(Unix.system(sprintf "/sbin/modprobe dummy numdummies=%d" 
max_dummy_vifs))
 
 (** Free list of dummy<N> devices, used to simulate guest VIF backends *)
 let vif_free_list = ref (List.map (fun x -> sprintf "dummy%d" x) 
(Range.to_list (Range.make 0 max_dummy_vifs)))
@@ -273,7 +274,6 @@
                        | Xenbus.InitWait -> ()
                        | Xenbus.Closing ->
                                xs.Xs.write w (Xenbus.string_of Xenbus.Closed);
-                               let hotplugpath = sprintf 
"/xapi/%s/hotplug/%s/%s/hotplug" domid ty id in
                                if ty = "vif" then (
                                        let device_path = sprintf 
"/xapi/%s/hotplug/vif/%s/vif" domid id in
                                        let device = xs.Xs.read device_path in


---


diff -r 9e71f6b54bfc ocaml/xiu/xiu.ml
--- a/ocaml/xiu/xiu.ml  Wed Aug 04 20:42:21 2010 +0100
+++ b/ocaml/xiu/xiu.ml  Thu Aug 05 11:18:01 2010 +0100
@@ -349,6 +349,12 @@
                                xs.Xs.unwatch (sprintf 
"/local/domain/%d/device" dom) "frontend";
                                xs.Xs.unwatch (sprintf 
"/local/domain/0/device-model/%d" dom) "devicemodel"
                                in
+                       let write_vnc_port dom =
+                               let port = sprintf "%d" (5900 + dom) in
+                               xs.Xs.write (sprintf 
"/local/domain/%d/serial/0/vnc-port" dom) port; (* PV *)
+                               xs.Xs.write (sprintf 
"/local/domain/%d/console/vnc-port" dom) port (* HVM *)
+                        in
+
                        (* diff old list and new list *)
                        let currents = Hashtbl.fold (fun k v acc -> k :: acc) 
domains [] in
                        
@@ -359,6 +365,7 @@
                        
                        List.iter (fun old -> remove_watch_for_olddomain old) 
disappeared;
                        List.iter (fun n -> add_watch_for_newdomain n) news;
+                       List.iter write_vnc_port news;
                        olds := currents;
                        ()
                        in

Attachment: xiu-warnings.patch
Description: Text Data

Attachment: xiu-vnc-port.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>