Skip to content

Commit

Permalink
um: Add an option to make serial driver non-raw
Browse files Browse the repository at this point in the history
In some cases, for example when the program(s) running inside UML
isn't/aren't interactive (like the hwsim tests for wpa_supplicant)
there's really no value in having the serial lines configured to
be raw as they are now by default. Setting them to non-raw lets
one abort the whole UML with Ctrl-C, which is really the right
thing to do in these cases, basically the whole UML instance is
more like a single (testing) program.

Add a "ssl-non-raw" option to UML to support such a mode.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Johannes Berg authored and Richard Weinberger committed Jan 19, 2020
1 parent b3a987b commit f1dc67d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arch/um/drivers/chan_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
struct chan_opts {
void (*const announce)(char *dev_name, int dev);
char *xterm_title;
const int raw;
int raw;
};

struct chan_ops {
Expand Down
8 changes: 8 additions & 0 deletions arch/um/drivers/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,11 @@ static int ssl_chan_setup(char *str)

__setup("ssl", ssl_chan_setup);
__channel_help(ssl_chan_setup, "ssl");

static int ssl_non_raw_setup(char *str)
{
opts.raw = 0;
return 1;
}
__setup("ssl-non-raw", ssl_non_raw_setup);
__channel_help(ssl_non_raw_setup, "set serial lines to non-raw mode");

0 comments on commit f1dc67d

Please sign in to comment.