diff mbox series

[2/2] um: daemon: make default socket configurable

Message ID 20220324131344.3cd44e85efab.I8bb1282abea3119025f79507f01c0d951bb1bede@changeid
State Accepted
Headers show
Series [1/2] um: xterm: make default terminal emulator configurable | expand

Commit Message

Johannes Berg March 24, 2022, 12:13 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Even if daemon network is deprecated, some configurations may
still use it (e.g. Debian), and not want to default to the
/tmp/uml.ctl socket location. Allow configuring the default
socket location.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 arch/um/drivers/Kconfig       | 8 ++++++++
 arch/um/drivers/daemon_kern.c | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

Anton Ivanov March 24, 2022, 12:18 p.m. UTC | #1
On 24/03/2022 12:13, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Even if daemon network is deprecated, some configurations may
> still use it (e.g. Debian), and not want to default to the
> /tmp/uml.ctl socket location. Allow configuring the default
> socket location.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>   arch/um/drivers/Kconfig       | 8 ++++++++
>   arch/um/drivers/daemon_kern.c | 2 +-
>   2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/um/drivers/Kconfig b/arch/um/drivers/Kconfig
> index 521ae0d46076..914da774bd39 100644
> --- a/arch/um/drivers/Kconfig
> +++ b/arch/um/drivers/Kconfig
> @@ -238,6 +238,14 @@ config UML_NET_DAEMON
>   
>   	  If unsure, say N.
>   
> +config UML_NET_DAEMON_DEFAULT_SOCK
> +	string "Default socket for daemon transport"
> +	default "/tmp/uml.ctl"
> +	depends on UML_NET_DAEMON
> +	help
> +	  This option allows setting the default socket for the daemon
> +	  transport, normally it defaults to /tmp/uml.ctl.
> +
>   config UML_NET_VECTOR
>   	bool "Vector I/O high performance network devices"
>   	depends on UML_NET
> diff --git a/arch/um/drivers/daemon_kern.c b/arch/um/drivers/daemon_kern.c
> index fd2402669c49..afde1e82c056 100644
> --- a/arch/um/drivers/daemon_kern.c
> +++ b/arch/um/drivers/daemon_kern.c
> @@ -65,7 +65,7 @@ static int daemon_setup(char *str, char **mac_out, void *data)
>   
>   	*init = ((struct daemon_init)
>   		{ .sock_type 		= "unix",
> -		  .ctl_sock 		= "/tmp/uml.ctl" });
> +		  .ctl_sock 		= CONFIG_UML_NET_DAEMON_DEFAULT_SOCK });
>   
>   	remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock,
>   			       NULL);
> 

Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Ritesh Raj Sarraf March 24, 2022, 4:22 p.m. UTC | #2
On Thu, 2022-03-24 at 13:13 +0100, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Even if daemon network is deprecated, some configurations may
> still use it (e.g. Debian), and not want to default to the
> /tmp/uml.ctl socket location. Allow configuring the default
> socket location.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  arch/um/drivers/Kconfig       | 8 ++++++++
>  arch/um/drivers/daemon_kern.c | 2 +-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/um/drivers/Kconfig b/arch/um/drivers/Kconfig
> index 521ae0d46076..914da774bd39 100644
> --- a/arch/um/drivers/Kconfig
> +++ b/arch/um/drivers/Kconfig
> @@ -238,6 +238,14 @@ config UML_NET_DAEMON
>  
>           If unsure, say N.
>  
> +config UML_NET_DAEMON_DEFAULT_SOCK
> +       string "Default socket for daemon transport"
> +       default "/tmp/uml.ctl"
> +       depends on UML_NET_DAEMON
> +       help
> +         This option allows setting the default socket for the
> daemon
> +         transport, normally it defaults to /tmp/uml.ctl.
> +
>  config UML_NET_VECTOR
>         bool "Vector I/O high performance network devices"
>         depends on UML_NET
> diff --git a/arch/um/drivers/daemon_kern.c
> b/arch/um/drivers/daemon_kern.c
> index fd2402669c49..afde1e82c056 100644
> --- a/arch/um/drivers/daemon_kern.c
> +++ b/arch/um/drivers/daemon_kern.c
> @@ -65,7 +65,7 @@ static int daemon_setup(char *str, char **mac_out,
> void *data)
>  
>         *init = ((struct daemon_init)
>                 { .sock_type            = "unix",
> -                 .ctl_sock             = "/tmp/uml.ctl" });
> +                 .ctl_sock             =
> CONFIG_UML_NET_DAEMON_DEFAULT_SOCK });
>  
>         remain = split_if_spec(str, mac_out, &init->sock_type, &init-
> >ctl_sock,
>                                NULL);

Tested-by: Ritesh Raj Sarraf <ritesh@collabora.com>
diff mbox series

Patch

diff --git a/arch/um/drivers/Kconfig b/arch/um/drivers/Kconfig
index 521ae0d46076..914da774bd39 100644
--- a/arch/um/drivers/Kconfig
+++ b/arch/um/drivers/Kconfig
@@ -238,6 +238,14 @@  config UML_NET_DAEMON
 
 	  If unsure, say N.
 
+config UML_NET_DAEMON_DEFAULT_SOCK
+	string "Default socket for daemon transport"
+	default "/tmp/uml.ctl"
+	depends on UML_NET_DAEMON
+	help
+	  This option allows setting the default socket for the daemon
+	  transport, normally it defaults to /tmp/uml.ctl.
+
 config UML_NET_VECTOR
 	bool "Vector I/O high performance network devices"
 	depends on UML_NET
diff --git a/arch/um/drivers/daemon_kern.c b/arch/um/drivers/daemon_kern.c
index fd2402669c49..afde1e82c056 100644
--- a/arch/um/drivers/daemon_kern.c
+++ b/arch/um/drivers/daemon_kern.c
@@ -65,7 +65,7 @@  static int daemon_setup(char *str, char **mac_out, void *data)
 
 	*init = ((struct daemon_init)
 		{ .sock_type 		= "unix",
-		  .ctl_sock 		= "/tmp/uml.ctl" });
+		  .ctl_sock 		= CONFIG_UML_NET_DAEMON_DEFAULT_SOCK });
 
 	remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock,
 			       NULL);