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

Re: [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket


  • To: Edwin Torok <edvin.torok@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Christian Lindig <christian.lindig@xxxxxxxxxx>
  • Date: Mon, 5 Oct 2020 08:40:31 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X5x/wKUN848vzuEGdVqXm88LxLsR0dTcojzg97lUdSQ=; b=J2yR/gMQ/Hrb/g3Q4Hv70I55Nbil19R/y8Wjw/4J40eeWJAiTtmDy8ND0Nw45o0S0zXDf0aSWWiSdXZgdEOvt2b/7vZ91c1a2PqynT9VAYP3XwpUXdEwkIrjwpO1zI+JQgRGVQXXEpS0GIAMmoZFFRPB5EIpSsZNlYuVuJzyLH8m/zXEgKpJ8Qy/0pvxPxiD7U1RZHKHD58Pt+2O1dWn72mtPdBOfkmUQlodn3PXjzgML+wV7djWqsA8kilJJAxBBOOFM46s1qEcVsiCND6/M70VaAoePfRcbGzp7bJEkTOcaGNZyY5RQwJW1+rINiF/CNojiAc5BVrpFKIdYkezNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RDI+te7A30rYc9YVctY0PgFcu7amdGNAStU/5KldwTGfe6hDCMnNz5ZOgoTcQ/oDQfbyt5OzZ+Ul0+fmev/We3wYMJaNMiV+fYnWaKZGBIArxiEZL2dSyv1vvIonmgAtrJeR9/2WSDOVVoOMDuHG+WvwovR34X4GscQiY53A8b6A+zMvo2/VPek6Cza5IQGF9aa0vpEAtuIh51PQuevG8ZjEmk11QYf9umWJUi/fVD0XainrIiO0mA5qKkj7L+BopnkoH81WDkWROZWcSjfcEiWUWNN7n30udal5Xk2MNYWF/WZRS/TFCr77nxkgThIP9ZX/fUWTLJEbSoOwUpd0qw==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: David Scott <dave@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 05 Oct 2020 08:41:55 +0000
  • Ironport-sdr: OnpN2/uv4joqDM0ZjLWDKk9DoeXZuMOYiZQPtBenXpWiGchcOne74pQjmiLLSdArZifMG750UE XZb/PMgCnU7U3YBZpkeaiF5H480peptsNfTjo+P/wcNwXViFiI4DYEFa0S3Z1ur4M5ClN6sNTW dnfTWqvZr0Jyldge18f2MwJrfowL5GOFCyymYnRut9rWqAdRvV8FjdzpnHNEmPiqwTgJZrLqOx Pq06lnkMWJqMn8H8sLkPq0yNTG3Z1mUTKWuQwL9pj7gDdhGD4AMyDKTr6UIMXBRYX5Qkdc2oyG T30=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWmNZM2MiF3TuZZUy8keCMro/BnqmItKvH
  • Thread-topic: [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket

--
Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>

________________________________________
From: Edwin Török <edvin.torok@xxxxxxxxxx>
Sent: 02 October 2020 17:06
To: xen-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Edwin Torok; Christian Lindig; David Scott; Ian Jackson; Wei Liu
Subject: [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO 
socket

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@xxxxxxxxxx>
---
 tools/ocaml/xenstored/connections.ml |  2 +-
 tools/ocaml/xenstored/define.ml      |  1 -
 tools/ocaml/xenstored/xenstored.ml   | 15 ++++++---------
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/tools/ocaml/xenstored/connections.ml 
b/tools/ocaml/xenstored/connections.ml
index f02ef6b526..f2c4318c88 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -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
diff --git a/tools/ocaml/xenstored/define.ml b/tools/ocaml/xenstored/define.ml
index 2965c08534..ea9e1b7620 100644
--- a/tools/ocaml/xenstored/define.ml
+++ b/tools/ocaml/xenstored/define.ml
@@ -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

diff --git a/tools/ocaml/xenstored/xenstored.ml 
b/tools/ocaml/xenstored/xenstored.ml
index 5b96f1852a..7e7824761b 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -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

--
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.