]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
tools/ocaml/xenstored: drop the creation of the RO socket
authorEdwin Török <edvin.torok@citrix.com>
Fri, 2 Oct 2020 16:06:32 +0000 (17:06 +0100)
committerWei Liu <wl@xen.org>
Thu, 8 Oct 2020 12:54:00 +0000 (12:54 +0000)
The readonly flag was propagated but ignored, so this was essentially
equivalent to a RW socket.

C xenstored is dropping the RO socket too, so drop it from oxenstored too.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wl@xen.org>
tools/ocaml/xenstored/connections.ml
tools/ocaml/xenstored/define.ml
tools/ocaml/xenstored/xenstored.ml

index f02ef6b5267cf9e87f525c16d86a7f10ec445a7a..f2c4318c8891fcf7f095bf74eacf853ce6acd882 100644 (file)
@@ -31,7 +31,7 @@ let create () = {
        watches = Trie.create ()
 }
 
-let add_anonymous cons fd _can_write =
+let add_anonymous cons fd =
        let xbcon = Xenbus.Xb.open_fd fd in
        let con = Connection.create xbcon None in
        Hashtbl.add cons.anonymous (Xenbus.Xb.get_fd xbcon) con
index 2965c085340e321851dbf8cdc3d60e91a7d1fde3..ea9e1b7620e936b8b38639cc32c85e3ada53d5c7 100644 (file)
@@ -18,7 +18,6 @@ let xenstored_major = 1
 let xenstored_minor = 0
 
 let xs_daemon_socket = Paths.xen_run_stored ^ "/socket"
-let xs_daemon_socket_ro = Paths.xen_run_stored ^ "/socket_ro"
 
 let default_config_dir = Paths.xen_config_dir
 
index 5b96f1852a916058ec7f6d2daedbf06b613f893f..7e7824761be5d30047914f9882d8b6d57508a2c3 100644 (file)
@@ -242,12 +242,11 @@ let _ =
                ()
        );
 
-       let rw_sock, ro_sock =
+       let rw_sock =
                if cf.disable_socket then
-                       None, None
+                       None
                else
-                       Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket),
-                       Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket_ro)
+                       Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket)
                in
 
        if cf.daemonize then
@@ -320,15 +319,14 @@ let _ =
 
        let spec_fds =
                (match rw_sock with None -> [] | Some x -> [ x ]) @
-               (match ro_sock with None -> [] | Some x -> [ x ]) @
                (if cf.domain_init then [ Event.fd eventchn ] else [])
                in
 
        let process_special_fds rset =
-               let accept_connection can_write fd =
+               let accept_connection fd =
                        let (cfd, _addr) = Unix.accept fd in
                        debug "new connection through socket";
-                       Connections.add_anonymous cons cfd can_write
+                       Connections.add_anonymous cons cfd
                and handle_eventchn _fd =
                        let port = Event.pending eventchn in
                        debug "pending port %d" (Xeneventchn.to_int port);
@@ -348,8 +346,7 @@ let _ =
                        if List.mem fd set then
                                fct fd in
 
-               maybe (fun fd -> do_if_set fd rset (accept_connection true)) rw_sock;
-               maybe (fun fd -> do_if_set fd rset (accept_connection false)) ro_sock;
+               maybe (fun fd -> do_if_set fd rset accept_connection) rw_sock;
                do_if_set (Event.fd eventchn) rset (handle_eventchn)
        in