From: Vincent Hanquez Date: Fri, 21 Aug 2009 15:30:00 +0000 (+0100) Subject: prepend a uuid_ to bus name uuid part X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=48e0474ce334cc1471b49423d1dd31765ef93ce5;p=xenclient%2Ftoolstack.git prepend a uuid_ to bus name uuid part fix bug when the bus name starts with a digit 0-9 (uuid starts with 0-9) and elements between should not start with a digit unless the bus name start with a colon character. --- diff --git a/xenvm/xenvm.ml b/xenvm/xenvm.ml index 4f9ec72..32e0a3a 100644 --- a/xenvm/xenvm.ml +++ b/xenvm/xenvm.ml @@ -642,7 +642,7 @@ let monitor_rpc_json socket state = let monitor_rpc_dbus state = let use_session = state.vm_monitors.monitor_use_dbus_session in - let intf = Printf.sprintf "org.xen.vm.%s" (String.replace "-" "_" state.vm_uuid) in + let intf = Printf.sprintf "org.xen.vm.uuid_%s" (String.replace "-" "_" state.vm_uuid) in let match_s = sprintf "type='method',interface='%s'" intf in let bus = DBus.Bus.get (if use_session then DBus.Bus.Session else DBus.Bus.System) in let reply = DBus.Bus.request_name bus intf [ DBus.Bus.DoNotQueue ] in diff --git a/xenvm/xenvmlib.ml b/xenvm/xenvmlib.ml index 57a95ec..0942da7 100644 --- a/xenvm/xenvmlib.ml +++ b/xenvm/xenvmlib.ml @@ -169,7 +169,7 @@ let request ?timeout id query = let bus = connect () in let timeout = match timeout with None -> 0 | Some t -> int_of_float (t *. 1000.) in - let intf = Printf.sprintf "org.xen.vm.%s" (String.replace "-" "_" id) in + let intf = Printf.sprintf "org.xen.vm.uuid_%s" (String.replace "-" "_" id) in let dest = intf in let method_name, params = query in @@ -187,7 +187,7 @@ let request ?timeout id query = let check ?timeout id = let bus = connect () in - let intf = Printf.sprintf "org.xen.vm.%s" (String.replace "-" "_" id) in + let intf = Printf.sprintf "org.xen.vm.uuid_%s" (String.replace "-" "_" id) in DBus.Bus.has_owner bus intf end