From patchwork Mon May 18 01:13:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 11554485 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4056912 for ; Mon, 18 May 2020 01:16:57 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 906272067D for ; Mon, 18 May 2020 01:16:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mCL9Oj5O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 906272067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jaUNG-0000DE-L9; Mon, 18 May 2020 01:15:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jaUNF-0000Ch-SK for xen-devel@lists.xenproject.org; Mon, 18 May 2020 01:15:21 +0000 X-Inumbo-ID: ff2e7cfe-98a4-11ea-b9cf-bc764e2007e4 Received: from mail-qv1-xf43.google.com (unknown [2607:f8b0:4864:20::f43]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ff2e7cfe-98a4-11ea-b9cf-bc764e2007e4; Mon, 18 May 2020 01:15:01 +0000 (UTC) Received: by mail-qv1-xf43.google.com with SMTP id fb16so3938787qvb.5 for ; Sun, 17 May 2020 18:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2CXxR3/fu54dMwhCVd1DE62O7N45m5o1SIg5x3dwKzg=; b=mCL9Oj5OXtEdRROI5LWby0nOvw900mzZIO5quk28U2jZm7/NqQivU/+iz8T33e8u7n 0Rdw/N3idGWCnRxdlKRP6uBL757h6LtBgRE8M+JB7jfXk8LADSvphGsrJB3s2o8/qY+o K0NSDTLYpotXWpS4QQ3Y2lq7Rk1yvJ8gNLzNoh951rp2ZET3V74ubyPS2Fw2zenZN9y3 krvC9GyvDK/4v/RFW3exy7p6rnFYRy1NAdUzBvGglAVgxEUgwQjdfk6FHGozg+bLlY31 Io/uKp/qNsde8PkJ1e+/FgTGLjLZUcFYZwbuG9ULUAnmAElEa4aIxFEpZ/dx2FSkcGDi 7awQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2CXxR3/fu54dMwhCVd1DE62O7N45m5o1SIg5x3dwKzg=; b=V+GgUHS1dAJAKf0fMREca28VNsF3dAxI1K/bqFLeG3qVN87wWOYu5quo5IclOmwO6X VempTt90uk/CoBA8cQdmlqE1X55aLlYoMgEjSX5ePK2aQ9oa56EhdSR373dilX6FiDVE y26TKdYgQ/5uj68pAtlC5h79spwDW0OmWwfIH0DJqFBdVjggupzEx6iqzUq6y/myoiO8 h6lHrE0xloVBHNOJR623wBI5cHsVa3s5UOdQCX25+ZmKQqT6zdpVemgeKT5VjaYSITTZ ObbX9matIhjOfZLl2/falr6Ce21vbfMLOVq1n4f1uKedm+kqOLcn34XYEh+ruEBSHIiS xSHQ== X-Gm-Message-State: AOAM530w+mC7DzCtIPtnFPLl+jKlmSLwN2WNEr7x4dVgOdiV4Nr1LMy5 uadhDWHnt2qCwjasLZNjEviSgjjC X-Google-Smtp-Source: ABdhPJzsmUptP5Ebhlwr3EDVbW73cYfMgRTMTBrbkkwiyvDk64mLowA/Oynu9LaJ72tUt7A9HNHUUg== X-Received: by 2002:a0c:99d3:: with SMTP id y19mr13638364qve.72.1589764500653; Sun, 17 May 2020 18:15:00 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:ec68:c92e:af5a:2d3a]) by smtp.gmail.com with ESMTPSA id l2sm7072864qkd.57.2020.05.17.18.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 18:15:00 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Subject: [PATCH v6 08/18] tools/libvchan: notify server when client is connected Date: Sun, 17 May 2020 21:13:43 -0400 Message-Id: <20200518011353.326287-9-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200518011353.326287-1-jandryuk@gmail.com> References: <20200518011353.326287-1-jandryuk@gmail.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Jason Andryuk , Ian Jackson , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , Ian Jackson , Daniel De Graaf Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Marek Marczykowski-Górecki 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 Signed-off-by: Marek Marczykowski-Górecki Replace spaces with tabs to match the file's whitespace. Signed-off-by: Jason Andryuk Acked-by: Ian Jackson --- Marek: I had this patch in Qubes for a long time and totally forgot it wasn't upstream thing... Changes in v6: - Add Acked-by: Ian Jackson - CC Daniel De Graaf --- tools/libvchan/init.c | 3 +++ 1 file changed, 3 insertions(+) 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);