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

RE: [Xen-API] [PATCH] Make xiu add a vnc-port entry in XenStore


  • To: Ewan Mellor <Ewan.Mellor@xxxxxxxxxxxxx>, Xen-API <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
  • Date: Thu, 5 Aug 2010 16:06:37 +0100
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc:
  • Delivery-date: Thu, 05 Aug 2010 08:28:59 -0700
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
  • Thread-index: Acs0iP030+k9wv4hS1WF3gEoErwPWgAJoJSg
  • Thread-topic: [Xen-API] [PATCH] Make xiu add a vnc-port entry in XenStore

Thanks for this...

What's probably happened is that the old SDK .xva had a fake qemu-dm-wrapper 
which did a bit of xenstore-write'ing. This has been lost (probably a good 
thing) by the move to the new SDK-from-main.iso.

Cheers,
Dave

> -----Original Message-----
> From: xen-api-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-api-
> bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Ewan Mellor
> Sent: 05 August 2010 10:29
> To: Xen-API
> Subject: [Xen-API] [PATCH] Make xiu add a vnc-port entry in XenStore
> 
> 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

_______________________________________________
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®.