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> | |||
51 | qapi/char.json | 5 +++ | 51 | qapi/char.json | 5 +++ |
52 | 3 files changed, 109 insertions(+) | 52 | 3 files changed, 109 insertions(+) |
53 | 53 | ||
54 | diff --git a/chardev/char-socket.c b/chardev/char-socket.c | 54 | Index: qemu-5.1.0/chardev/char-socket.c |
55 | index 185fe38d..54fa4234 100644 | 55 | =================================================================== |
56 | --- a/chardev/char-socket.c | 56 | --- qemu-5.1.0.orig/chardev/char-socket.c |
57 | +++ b/chardev/char-socket.c | 57 | +++ qemu-5.1.0/chardev/char-socket.c |
58 | @@ -1288,6 +1288,67 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock, | 58 | @@ -1292,6 +1292,67 @@ static bool qmp_chardev_validate_socket( |
59 | return true; | 59 | return true; |
60 | } | 60 | } |
61 | 61 | ||
@@ -123,7 +123,7 @@ index 185fe38d..54fa4234 100644 | |||
123 | 123 | ||
124 | static void qmp_chardev_open_socket(Chardev *chr, | 124 | static void qmp_chardev_open_socket(Chardev *chr, |
125 | ChardevBackend *backend, | 125 | ChardevBackend *backend, |
126 | @@ -1296,6 +1357,9 @@ static void qmp_chardev_open_socket(Chardev *chr, | 126 | @@ -1300,6 +1361,9 @@ static void qmp_chardev_open_socket(Char |
127 | { | 127 | { |
128 | SocketChardev *s = SOCKET_CHARDEV(chr); | 128 | SocketChardev *s = SOCKET_CHARDEV(chr); |
129 | ChardevSocket *sock = backend->u.socket.data; | 129 | ChardevSocket *sock = backend->u.socket.data; |
@@ -133,7 +133,7 @@ index 185fe38d..54fa4234 100644 | |||
133 | bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; | 133 | bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; |
134 | bool is_listen = sock->has_server ? sock->server : true; | 134 | bool is_listen = sock->has_server ? sock->server : true; |
135 | bool is_telnet = sock->has_telnet ? sock->telnet : false; | 135 | bool is_telnet = sock->has_telnet ? sock->telnet : false; |
136 | @@ -1361,6 +1425,14 @@ static void qmp_chardev_open_socket(Chardev *chr, | 136 | @@ -1365,6 +1429,14 @@ static void qmp_chardev_open_socket(Char |
137 | 137 | ||
138 | update_disconnected_filename(s); | 138 | update_disconnected_filename(s); |
139 | 139 | ||
@@ -148,13 +148,15 @@ index 185fe38d..54fa4234 100644 | |||
148 | if (s->is_listen) { | 148 | if (s->is_listen) { |
149 | if (qmp_chardev_open_socket_server(chr, is_telnet || is_tn3270, | 149 | if (qmp_chardev_open_socket_server(chr, is_telnet || is_tn3270, |
150 | is_waitconnect, errp) < 0) { | 150 | is_waitconnect, errp) < 0) { |
151 | @@ -1380,9 +1452,26 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, | 151 | @@ -1384,11 +1456,27 @@ static void qemu_chr_parse_socket(QemuOp |
152 | const char *host = qemu_opt_get(opts, "host"); | 152 | const char *host = qemu_opt_get(opts, "host"); |
153 | const char *port = qemu_opt_get(opts, "port"); | 153 | const char *port = qemu_opt_get(opts, "port"); |
154 | const char *fd = qemu_opt_get(opts, "fd"); | 154 | const char *fd = qemu_opt_get(opts, "fd"); |
155 | +#ifndef _WIN32 | 155 | +#ifndef _WIN32 |
156 | + const char *cmd = qemu_opt_get(opts, "cmd"); | 156 | + const char *cmd = qemu_opt_get(opts, "cmd"); |
157 | +#endif | 157 | +#endif |
158 | bool tight = qemu_opt_get_bool(opts, "tight", true); | ||
159 | bool abstract = qemu_opt_get_bool(opts, "abstract", false); | ||
158 | SocketAddressLegacy *addr; | 160 | SocketAddressLegacy *addr; |
159 | ChardevSocket *sock; | 161 | ChardevSocket *sock; |
160 | 162 | ||
@@ -171,19 +173,19 @@ index 185fe38d..54fa4234 100644 | |||
171 | + } | 173 | + } |
172 | + } else | 174 | + } else |
173 | +#endif | 175 | +#endif |
174 | + | ||
175 | if ((!!path + !!fd + !!host) != 1) { | 176 | if ((!!path + !!fd + !!host) != 1) { |
176 | error_setg(errp, | 177 | error_setg(errp, |
177 | "Exactly one of 'path', 'fd' or 'host' required"); | 178 | "Exactly one of 'path', 'fd' or 'host' required"); |
178 | @@ -1425,12 +1514,24 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, | 179 | @@ -1431,12 +1519,24 @@ static void qemu_chr_parse_socket(QemuOp |
179 | sock->has_tls_authz = qemu_opt_get(opts, "tls-authz"); | 180 | sock->has_tls_authz = qemu_opt_get(opts, "tls-authz"); |
180 | sock->tls_authz = g_strdup(qemu_opt_get(opts, "tls-authz")); | 181 | sock->tls_authz = g_strdup(qemu_opt_get(opts, "tls-authz")); |
181 | 182 | ||
183 | - addr = g_new0(SocketAddressLegacy, 1); | ||
182 | +#ifndef _WIN32 | 184 | +#ifndef _WIN32 |
183 | + sock->cmd = g_strdup(cmd); | 185 | + sock->cmd = g_strdup(cmd); |
184 | +#endif | 186 | +#endif |
185 | + | 187 | + |
186 | addr = g_new0(SocketAddressLegacy, 1); | 188 | + addr = g_new0(SocketAddressLegacy, 1); |
187 | +#ifndef _WIN32 | 189 | +#ifndef _WIN32 |
188 | + if (path || cmd) { | 190 | + if (path || cmd) { |
189 | +#else | 191 | +#else |
@@ -197,28 +199,28 @@ index 185fe38d..54fa4234 100644 | |||
197 | +#else | 199 | +#else |
198 | q_unix->path = g_strdup(path); | 200 | q_unix->path = g_strdup(path); |
199 | +#endif | 201 | +#endif |
202 | q_unix->tight = tight; | ||
203 | q_unix->abstract = abstract; | ||
200 | } else if (host) { | 204 | } else if (host) { |
201 | addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET; | 205 | Index: qemu-5.1.0/chardev/char.c |
202 | addr->u.inet.data = g_new(InetSocketAddress, 1); | 206 | =================================================================== |
203 | diff --git a/chardev/char.c b/chardev/char.c | 207 | --- qemu-5.1.0.orig/chardev/char.c |
204 | index 7b6b2cb1..0c2ca64b 100644 | 208 | +++ qemu-5.1.0/chardev/char.c |
205 | --- a/chardev/char.c | 209 | @@ -826,6 +826,9 @@ QemuOptsList qemu_chardev_opts = { |
206 | +++ b/chardev/char.c | ||
207 | @@ -837,6 +837,9 @@ QemuOptsList qemu_chardev_opts = { | ||
208 | },{ | ||
209 | .name = "path", | 210 | .name = "path", |
210 | .type = QEMU_OPT_STRING, | 211 | .type = QEMU_OPT_STRING, |
211 | + },{ | 212 | },{ |
212 | + .name = "cmd", | 213 | + .name = "cmd", |
213 | + .type = QEMU_OPT_STRING, | 214 | + .type = QEMU_OPT_STRING, |
214 | },{ | 215 | + },{ |
215 | .name = "host", | 216 | .name = "host", |
216 | .type = QEMU_OPT_STRING, | 217 | .type = QEMU_OPT_STRING, |
217 | diff --git a/qapi/char.json b/qapi/char.json | 218 | },{ |
218 | index a6e81ac7..517962c6 100644 | 219 | Index: qemu-5.1.0/qapi/char.json |
219 | --- a/qapi/char.json | 220 | =================================================================== |
220 | +++ b/qapi/char.json | 221 | --- qemu-5.1.0.orig/qapi/char.json |
221 | @@ -247,6 +247,10 @@ | 222 | +++ qemu-5.1.0/qapi/char.json |
223 | @@ -250,6 +250,10 @@ | ||
222 | # | 224 | # |
223 | # @addr: socket address to listen on (server=true) | 225 | # @addr: socket address to listen on (server=true) |
224 | # or connect to (server=false) | 226 | # or connect to (server=false) |
@@ -229,7 +231,7 @@ index a6e81ac7..517962c6 100644 | |||
229 | # @tls-creds: the ID of the TLS credentials object (since 2.6) | 231 | # @tls-creds: the ID of the TLS credentials object (since 2.6) |
230 | # @tls-authz: the ID of the QAuthZ authorization object against which | 232 | # @tls-authz: the ID of the QAuthZ authorization object against which |
231 | # the client's x509 distinguished name will be validated. This | 233 | # the client's x509 distinguished name will be validated. This |
232 | @@ -272,6 +276,7 @@ | 234 | @@ -276,6 +280,7 @@ |
233 | ## | 235 | ## |
234 | { 'struct': 'ChardevSocket', | 236 | { 'struct': 'ChardevSocket', |
235 | 'data': { 'addr': 'SocketAddressLegacy', | 237 | 'data': { 'addr': 'SocketAddressLegacy', |