tools/libvchan: notify server when client is connected
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Tue, 19 May 2020 01:54:53 +0000 (21:54 -0400)
committerWei Liu <wl@xen.org>
Tue, 19 May 2020 15:19:15 +0000 (16:19 +0100)
Let the server know when the client is connected. Otherwise server will
notice only when client send some data.
This change does not break existing clients, as libvchan user should
handle spurious notifications anyway (for example acknowledge of remote
side reading the data).

Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Replace spaces with tabs to match the file's whitespace.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libvchan/init.c

index 180833dc2f6edb98b8c0bff88866d4e94052547f..ad4b64fbe3d372025ba7fa1355bd1a23d7773b86 100644 (file)
@@ -447,6 +447,9 @@ struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
        ctrl->ring->cli_live = 1;
        ctrl->ring->srv_notify = VCHAN_NOTIFY_WRITE;
 
+       /* wake up the server */
+       xenevtchn_notify(ctrl->event, ctrl->event_port);
+
  out:
        if (xs)
                xs_daemon_close(xs);