qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [multiprocess RFC PATCH 28/37] multi-process: remote: use fd for socket from parent process
@ 2019-03-07  7:22 elena.ufimtseva
  0 siblings, 0 replies; only message in thread
From: elena.ufimtseva @ 2019-03-07  7:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: elena.ufimtseva, ross.lagerwall, stefanha, liran.alon,
	kanth.ghatraju, john.g.johnson, jag.raman, konrad.wilk,
	sstabellini

From: Elena Ufimtseva <elena.ufimtseva@oracle.com>

Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
---
 remote/remote-main.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/remote/remote-main.c b/remote/remote-main.c
index 52da3c8..fa32f2a 100644
--- a/remote/remote-main.c
+++ b/remote/remote-main.c
@@ -63,6 +63,7 @@
 #include "block/qdict.h"
 #include "qapi/qmp/qlist.h"
 #include "qemu/log.h"
+#include "qemu/cutils.h"
 
 static ProxyLinkState *proxy_link;
 PCIDevice *remote_pci_dev;
@@ -437,6 +438,7 @@ int main(int argc, char *argv[])
 {
     Error *err = NULL;
     QemuThread main_loop_thread;
+    int fd = -1;
 
     module_call_init(MODULE_INIT_QOM);
 
@@ -461,7 +463,13 @@ int main(int argc, char *argv[])
         return -1;
     }
 
-    proxy_link_set_sock(proxy_link, STDIN_FILENO);
+    fd = qemu_parse_fd(argv[1]);
+    if (fd == -1) {
+        printf("Failed to parse fd for remote process.\n");
+        return -EINVAL;
+    }
+
+    proxy_link_set_sock(proxy_link, fd);
     proxy_link_set_callback(proxy_link, process_msg);
 
     qemu_thread_create(&main_loop_thread, "remote-main-loop", remote_main_loop,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-07  7:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-07  7:22 [Qemu-devel] [multiprocess RFC PATCH 28/37] multi-process: remote: use fd for socket from parent process elena.ufimtseva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).