diff mbox series

[v5,08/21] tools/libvchan: notify server when client is connected

Message ID 20200428040433.23504-9-jandryuk@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add support for qemu-xen runnning in a Linux-based stubdomain | expand

Commit Message

Jason Andryuk April 28, 2020, 4:04 a.m. UTC
From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

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).

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>
---
Marek: I had this patch in Qubes for a long time and totally forgot it
wasn't upstream thing...
---
 tools/libvchan/init.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ian Jackson May 14, 2020, 4:27 p.m. UTC | #1
Jason Andryuk writes ("[PATCH v5 08/21] tools/libvchan: notify server when client is connected"):
> From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> 
> 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).
> 
> 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>
> ---
> Marek: I had this patch in Qubes for a long time and totally forgot it
> wasn't upstream thing...

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

CCing Daniel De Graaf in case he feels like having an opinion....

Thanks,
Ian.
diff mbox series

Patch

diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 180833dc2f..ad4b64fbe3 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -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);