summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuro Bystricky <juro.bystricky@intel.com>2018-01-11 21:16:57 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-13 10:15:20 (GMT)
commitbc112b8368eb3842ccb2430fdf17e736ea39a742 (patch)
tree2a084bd43d2892988654c7deb4bcc4cf9c3508e4
parent979587c2bc0251bc5f9822184a1e75a2b19d29b9 (diff)
downloadpoky-bc112b8368eb3842ccb2430fdf17e736ea39a742.zip
poky-bc112b8368eb3842ccb2430fdf17e736ea39a742.tar.gz
poky-bc112b8368eb3842ccb2430fdf17e736ea39a742.tar.bz2
qemu-2.10.1.bb: support mingw build
The patch chardev-connect-socket-to-a-spawned-command.patch calls "socketpair". This function is missing in mingw, so the patch needs to be modified accordingly, otherwise we end up with a broken mingw build. While it is possible to simply remove the patch on a recipe level for mingw platform, it makes more sense to modify the patch itself. (From OE-Core rev: fd978a5ddf6938404f2043c9f9ede47dcdb47180) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch37
1 files changed, 29 insertions, 8 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch b/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch
index 49d4af2..4f85397 100644
--- a/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch
+++ b/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch
@@ -55,10 +55,11 @@ diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 1ae730a4..c366a02a 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
-@@ -854,6 +854,66 @@ static gboolean socket_reconnect_timeout(gpointer opaque)
+@@ -854,6 +854,68 @@ static gboolean socket_reconnect_timeout(gpointer opaque)
return false;
}
++#ifndef _WIN32
+static void chardev_open_socket_cmd(Chardev *chr,
+ const char *cmd,
+ Error **errp)
@@ -118,42 +119,51 @@ index 1ae730a4..c366a02a 100644
+ object_unref(OBJECT(sioc));
+ }
+}
++#endif
+
static void qmp_chardev_open_socket(Chardev *chr,
ChardevBackend *backend,
bool *be_opened,
-@@ -861,6 +921,7 @@ static void qmp_chardev_open_socket(Chardev *chr,
+@@ -861,6 +923,9 @@ static void qmp_chardev_open_socket(Chardev *chr,
{
SocketChardev *s = SOCKET_CHARDEV(chr);
ChardevSocket *sock = backend->u.socket.data;
++#ifndef _WIN32
+ const char *cmd = sock->cmd;
++#endif
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;
-@@ -928,7 +989,12 @@ static void qmp_chardev_open_socket(Chardev *chr,
+@@ -928,7 +993,15 @@ static void qmp_chardev_open_socket(Chardev *chr,
s->reconnect_time = reconnect;
}
- if (s->reconnect_time) {
++#ifndef _WIN32
+ if (cmd) {
+ chardev_open_socket_cmd(chr, cmd, errp);
+
+ /* everything ready (or failed permanently) before we return */
+ *be_opened = true;
-+ } else if (s->reconnect_time) {
++ } else
++#endif
++ if (s->reconnect_time) {
sioc = qio_channel_socket_new();
tcp_chr_set_client_ioc_name(chr, sioc);
qio_channel_socket_connect_async(sioc, s->addr,
-@@ -987,11 +1053,22 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
+@@ -987,11 +1060,27 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
const char *host = qemu_opt_get(opts, "host");
const char *port = qemu_opt_get(opts, "port");
const char *tls_creds = qemu_opt_get(opts, "tls-creds");
++#ifndef _WIN32
+ const char *cmd = qemu_opt_get(opts, "cmd");
++#endif
SocketAddressLegacy *addr;
ChardevSocket *sock;
backend->type = CHARDEV_BACKEND_KIND_SOCKET;
- if (!path) {
++#ifndef _WIN32
+ if (cmd) {
+ /*
+ * Here we have to ensure that no options are set which are incompatible with
@@ -164,24 +174,35 @@ index 1ae730a4..c366a02a 100644
+ error_setg(errp, "chardev: socket: cmd does not support any additional options");
+ return;
+ }
-+ } else if (!path) {
++ } else
++#endif
++ if (!path) {
if (!host) {
error_setg(errp, "chardev: socket: no host given");
return;
-@@ -1023,13 +1100,14 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
+@@ -1023,13 +1112,24 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend,
sock->has_reconnect = true;
sock->reconnect = reconnect;
sock->tls_creds = g_strdup(tls_creds);
++#ifndef _WIN32
+ sock->cmd = g_strdup(cmd);
++#endif
addr = g_new0(SocketAddressLegacy, 1);
-- if (path) {
++#ifndef _WIN32
+ if (path || cmd) {
++#else
+ if (path) {
++#endif
UnixSocketAddress *q_unix;
addr->type = SOCKET_ADDRESS_LEGACY_KIND_UNIX;
q_unix = addr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
- q_unix->path = g_strdup(path);
++#ifndef _WIN32
+ q_unix->path = cmd ? g_strdup_printf("cmd:%s", cmd) : g_strdup(path);
++#else
++ q_unix->path = g_strdup(path);
++#endif
} else {
addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET;
addr->u.inet.data = g_new(InetSocketAddress, 1);