From patchwork Tue May 19 01:54:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 11556751 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 BE30E618 for ; Tue, 19 May 2020 01:58:13 +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 9A55A206D4 for ; Tue, 19 May 2020 01:58:13 +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="AKhBNPAc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A55A206D4 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 1jarUf-0000Qo-JO; Tue, 19 May 2020 01:56:33 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jarUe-0000Q1-M7 for xen-devel@lists.xenproject.org; Tue, 19 May 2020 01:56:32 +0000 X-Inumbo-ID: e79c0834-9973-11ea-9887-bc764e2007e4 Received: from mail-qv1-xf42.google.com (unknown [2607:f8b0:4864:20::f42]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e79c0834-9973-11ea-9887-bc764e2007e4; Tue, 19 May 2020 01:56:07 +0000 (UTC) Received: by mail-qv1-xf42.google.com with SMTP id d1so5777994qvl.6 for ; Mon, 18 May 2020 18:56:07 -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=AKhBNPAcoTZToHpSRZE5KrTgrDLx7XfXdXFxBJNg7lYrrzSOzsoWnKqqFozWnmA9Cl n2peygGD3HfXEuDgP9E/gTEK23cgcDdGCtmZD8H7nypC8v571/5mZ1vlVpsiJsocOx9U w+Gx58vsJOSJS3foDSvkIg8MV1zlNjYoXbsmJvVBS5Hx39kEbaI9A/pD8bjuMFxrbjXv FIimCXiDuUZAsTPMFNLXQiW1z+HkqHKYZWzQxF1cza4zQ6qem47RYV37cGLYTFeHcejJ RjwhHpwmqUVlwIbD6hBx0cEEfO55YJAjrbIS8OgISFfGcPIhySXFb8ttHD/1MWOKwJCl Gc6g== 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=QuByHL+9D6da2fLBtQy6KVBJbcaoPmIYuntABZftdpevoI4xzkLU0qaAmJY4bOYBpR hWlewhLZs4UtUcyF7haxjZHTLAHnbrTEzSxzCQIiaZjAC/RAVCOwzWh51OIjJ73/SXYU MhD0Du5Hpy0IRwwr50UCWwaBzVKsJ3TiAHWzrYGsm97jZoqyJIbTwpU0qjleSg/oBmYt RJjOFJGIeq6x3Tdd7CFe8XPDxBs4ktp2BK6vJeuQpALnKtQgnYLWste/fE0wtnZYBkWb IGh4F8FR4lgHYbDm6xiGb9qXB2cjohkPUc2i2FJgPYssw6GhSUBbtsHsTLBMRuUIIrbu hdrA== X-Gm-Message-State: AOAM531HYCwyDq57XPemDZqnBuVYU1k+tBAlbGdabeuUA5NnTreUHsdN aAQZ71JvgK6bAu1co7oEiokMMcVg X-Google-Smtp-Source: ABdhPJwTXzjvx4qmTPZqyVC7gX6iM1nyvCSo9BTAgYUCX/xOWafExMXAS2HimiKJ/82sLt8AVE7eIw== X-Received: by 2002:a0c:b5c4:: with SMTP id o4mr18315483qvf.229.1589853366849; Mon, 18 May 2020 18:56:06 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:e463:db9c:c6eb:4544]) by smtp.gmail.com with ESMTPSA id q2sm9731898qkn.116.2020.05.18.18.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 18:56:06 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Subject: [PATCH v7 09/19] tools/libvchan: notify server when client is connected Date: Mon, 18 May 2020 21:54:53 -0400 Message-Id: <20200519015503.115236-10-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200519015503.115236-1-jandryuk@gmail.com> References: <20200519015503.115236-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);