diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch b/meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch index 0810ae84c0..98fd5e9133 100644 --- a/meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch +++ b/meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch @@ -51,11 +51,11 @@ Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> qapi/char.json | 5 +++ 3 files changed, 109 insertions(+) -diff --git a/chardev/char-socket.c b/chardev/char-socket.c -index 185fe38d..54fa4234 100644 ---- a/chardev/char-socket.c -+++ b/chardev/char-socket.c -@@ -1288,6 +1288,67 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock, +Index: qemu-5.1.0/chardev/char-socket.c +=================================================================== +--- qemu-5.1.0.orig/chardev/char-socket.c ++++ qemu-5.1.0/chardev/char-socket.c +@@ -1292,6 +1292,67 @@ static bool qmp_chardev_validate_socket( return true; } @@ -123,7 +123,7 @@ index 185fe38d..54fa4234 100644 static void qmp_chardev_open_socket(Chardev *chr, ChardevBackend *backend, -@@ -1296,6 +1357,9 @@ static void qmp_chardev_open_socket(Chardev *chr, +@@ -1300,6 +1361,9 @@ static void qmp_chardev_open_socket(Char { SocketChardev *s = SOCKET_CHARDEV(chr); ChardevSocket *sock = backend->u.socket.data; @@ -133,7 +133,7 @@ index 185fe38d..54fa4234 100644 bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; bool is_listen = sock->has_server ? sock->server : true; bool is_telnet = sock->has_telnet ? sock->telnet : false; -@@ -1361,6 +1425,14 @@ static void qmp_chardev_open_socket(Chardev *chr, +@@ -1365,6 +1429,14 @@ static void qmp_chardev_open_socket(Char update_disconnected_filename(s); @@ -148,13 +148,15 @@ index 185fe38d..54fa4234 100644 if (s->is_listen) { if (qmp_chardev_open_socket_server(chr, is_telnet || is_tn3270, is_waitconnect, errp) < 0) { -@@ -1380,9 +1452,26 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, +@@ -1384,11 +1456,27 @@ static void qemu_chr_parse_socket(QemuOp const char *host = qemu_opt_get(opts, "host"); const char *port = qemu_opt_get(opts, "port"); const char *fd = qemu_opt_get(opts, "fd"); +#ifndef _WIN32 + const char *cmd = qemu_opt_get(opts, "cmd"); +#endif + bool tight = qemu_opt_get_bool(opts, "tight", true); + bool abstract = qemu_opt_get_bool(opts, "abstract", false); SocketAddressLegacy *addr; ChardevSocket *sock; @@ -171,19 +173,19 @@ index 185fe38d..54fa4234 100644 + } + } else +#endif -+ if ((!!path + !!fd + !!host) != 1) { error_setg(errp, "Exactly one of 'path', 'fd' or 'host' required"); -@@ -1425,12 +1514,24 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, +@@ -1431,12 +1519,24 @@ static void qemu_chr_parse_socket(QemuOp sock->has_tls_authz = qemu_opt_get(opts, "tls-authz"); sock->tls_authz = g_strdup(qemu_opt_get(opts, "tls-authz")); +- addr = g_new0(SocketAddressLegacy, 1); +#ifndef _WIN32 + sock->cmd = g_strdup(cmd); +#endif + - addr = g_new0(SocketAddressLegacy, 1); ++ addr = g_new0(SocketAddressLegacy, 1); +#ifndef _WIN32 + if (path || cmd) { +#else @@ -197,28 +199,28 @@ index 185fe38d..54fa4234 100644 +#else q_unix->path = g_strdup(path); +#endif + q_unix->tight = tight; + q_unix->abstract = abstract; } else if (host) { - addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET; - addr->u.inet.data = g_new(InetSocketAddress, 1); -diff --git a/chardev/char.c b/chardev/char.c -index 7b6b2cb1..0c2ca64b 100644 ---- a/chardev/char.c -+++ b/chardev/char.c -@@ -837,6 +837,9 @@ QemuOptsList qemu_chardev_opts = { - },{ +Index: qemu-5.1.0/chardev/char.c +=================================================================== +--- qemu-5.1.0.orig/chardev/char.c ++++ qemu-5.1.0/chardev/char.c +@@ -826,6 +826,9 @@ QemuOptsList qemu_chardev_opts = { .name = "path", .type = QEMU_OPT_STRING, -+ },{ + },{ + .name = "cmd", + .type = QEMU_OPT_STRING, - },{ ++ },{ .name = "host", .type = QEMU_OPT_STRING, -diff --git a/qapi/char.json b/qapi/char.json -index a6e81ac7..517962c6 100644 ---- a/qapi/char.json -+++ b/qapi/char.json -@@ -247,6 +247,10 @@ + },{ +Index: qemu-5.1.0/qapi/char.json +=================================================================== +--- qemu-5.1.0.orig/qapi/char.json ++++ qemu-5.1.0/qapi/char.json +@@ -250,6 +250,10 @@ # # @addr: socket address to listen on (server=true) # or connect to (server=false) @@ -229,7 +231,7 @@ index a6e81ac7..517962c6 100644 # @tls-creds: the ID of the TLS credentials object (since 2.6) # @tls-authz: the ID of the QAuthZ authorization object against which # the client's x509 distinguished name will be validated. This -@@ -272,6 +276,7 @@ +@@ -276,6 +280,7 @@ ## { 'struct': 'ChardevSocket', 'data': { 'addr': 'SocketAddressLegacy', |