diff mbox series

[RESEND,v6,29/36] multi-process: handle heartbeat messages in remote process

Message ID 5c66c9f8df2278401b7ad58ff8606ae027f1fcec.1587614626.git.elena.ufimtseva@oracle.com (mailing list archive)
State New, archived
Headers show
Series [RESEND,v6,01/36] memory: alloc RAM from file at offset | expand

Commit Message

Elena Ufimtseva April 23, 2020, 4:14 a.m. UTC
From: Elena Ufimtseva <elena.ufimtseva@oracle.com>

If the remote process is alive, it responds to proxy's heartbeat
messages

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 | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/remote/remote-main.c b/remote/remote-main.c
index b37802151a..beac591fac 100644
--- a/remote/remote-main.c
+++ b/remote/remote-main.c
@@ -216,6 +216,7 @@  static void process_msg(GIOCondition cond, MPQemuLinkState *link,
     g_autofree gchar *pid_exec = NULL;
 
     pid_exec = g_malloc(PROC_INFO_LENGTH);
+    int wait;
 
     if ((cond & G_IO_HUP) || (cond & G_IO_ERR)) {
         goto finalize_loop;
@@ -269,6 +270,10 @@  static void process_msg(GIOCondition cond, MPQemuLinkState *link,
     case GET_PCI_INFO:
         process_get_pci_info_msg(link, msg);
         break;
+    case PROXY_PING:
+        wait = msg->fds[0];
+        notify_proxy(wait, 0);
+        break;
     default:
         error_setg(&err, "Unknown command in %s", print_pid_exec(pid_exec));
         goto finalize_loop;