All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] drop RO socket from oxenstored
@ 2020-10-02 16:06 Edwin Török
  2020-10-02 16:06 ` [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket Edwin Török
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Edwin Török @ 2020-10-02 16:06 UTC (permalink / raw)
  To: xen-devel
  Cc: Edwin Török, Christian Lindig, David Scott,
	Ian Jackson, Wei Liu

See https://lore.kernel.org/xen-devel/20201002154141.11677-6-jgross@suse.com/T/#u

Edwin Török (1):
  tools/ocaml/xenstored: drop the creation of the RO socket

 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(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket
  2020-10-02 16:06 [PATCH v1 0/1] drop RO socket from oxenstored Edwin Török
@ 2020-10-02 16:06 ` Edwin Török
  2020-10-05  8:40   ` Christian Lindig
  2020-10-02 16:14 ` [PATCH v1 0/1] drop RO socket from oxenstored Jürgen Groß
  2020-10-08 12:54 ` Wei Liu
  2 siblings, 1 reply; 5+ messages in thread
From: Edwin Török @ 2020-10-02 16:06 UTC (permalink / raw)
  To: xen-devel
  Cc: Edwin Török, Christian Lindig, David Scott,
	Ian Jackson, Wei Liu

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>
---
 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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 0/1] drop RO socket from oxenstored
  2020-10-02 16:06 [PATCH v1 0/1] drop RO socket from oxenstored Edwin Török
  2020-10-02 16:06 ` [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket Edwin Török
@ 2020-10-02 16:14 ` Jürgen Groß
  2020-10-08 12:54 ` Wei Liu
  2 siblings, 0 replies; 5+ messages in thread
From: Jürgen Groß @ 2020-10-02 16:14 UTC (permalink / raw)
  To: Edwin Török, xen-devel
  Cc: Christian Lindig, David Scott, Ian Jackson, Wei Liu

On 02.10.20 18:06, Edwin Török wrote:
> See https://lore.kernel.org/xen-devel/20201002154141.11677-6-jgross@suse.com/T/#u
> 
> Edwin Török (1):
>    tools/ocaml/xenstored: drop the creation of the RO socket
> 
>   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(-)
> 

FWIW:

Acked-by: Juergen Gross <jgross@suse.com>


Juergen


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket
  2020-10-02 16:06 ` [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket Edwin Török
@ 2020-10-05  8:40   ` Christian Lindig
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Lindig @ 2020-10-05  8:40 UTC (permalink / raw)
  To: Edwin Torok, xen-devel; +Cc: David Scott, Ian Jackson, Wei Liu

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

________________________________________
From: Edwin Török <edvin.torok@citrix.com>
Sent: 02 October 2020 17:06
To: xen-devel@lists.xenproject.org
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@citrix.com>
---
 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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 0/1] drop RO socket from oxenstored
  2020-10-02 16:06 [PATCH v1 0/1] drop RO socket from oxenstored Edwin Török
  2020-10-02 16:06 ` [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket Edwin Török
  2020-10-02 16:14 ` [PATCH v1 0/1] drop RO socket from oxenstored Jürgen Groß
@ 2020-10-08 12:54 ` Wei Liu
  2 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2020-10-08 12:54 UTC (permalink / raw)
  To: Edwin Török
  Cc: xen-devel, Christian Lindig, David Scott, Ian Jackson, Wei Liu

On Fri, Oct 02, 2020 at 05:06:31PM +0100, Edwin Török wrote:
> See https://lore.kernel.org/xen-devel/20201002154141.11677-6-jgross@suse.com/T/#u
> 
> Edwin Török (1):
>   tools/ocaml/xenstored: drop the creation of the RO socket
> 
>  tools/ocaml/xenstored/connections.ml |  2 +-
>  tools/ocaml/xenstored/define.ml      |  1 -
>  tools/ocaml/xenstored/xenstored.ml   | 15 ++++++---------

Applied.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-08 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02 16:06 [PATCH v1 0/1] drop RO socket from oxenstored Edwin Török
2020-10-02 16:06 ` [PATCH v1 1/1] tools/ocaml/xenstored: drop the creation of the RO socket Edwin Török
2020-10-05  8:40   ` Christian Lindig
2020-10-02 16:14 ` [PATCH v1 0/1] drop RO socket from oxenstored Jürgen Groß
2020-10-08 12:54 ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.