From nobody Mon Apr 29 07:03:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1566240427; cv=none; d=zoho.com; s=zohoarc; b=UWn8d38bhdjn2dls4twzaadJaiXGejUH+irV5q5G9TU9v2rTU0MdzGL5YjwvxgykSoXT7EmmkoN7EEH+TKpWzy1z1JzmFOSExWWTYCClHKgargKqMmYNtWCVyis7W9xTHZxvKN9UlgcBxQwBlrq02XqjoxsqGQAl/127pJJA43w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566240427; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=GjL08IYYENgT6z4F7UP2ZMwIR+qPhYBC+RQ5djnFtMo=; b=cGDlzVUvz3pq5SacnBmc2xLTg2pNz2dTad+FPIzuZN0A7vKOltyOJqD8LMiCxLugwUBzxtxWOzFyYYrkX3DXfp8RaQQtVqX/H48c2lA4O2rRGaZICQIzzHpCwySjQ4BmyvdkVpYtLIFPMeP8sE4puLS7q4LThTDRG+ZjJH0Fe24= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1566240427602596.4422091872531; Mon, 19 Aug 2019 11:47:07 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hzmf3-0006MX-K1; Mon, 19 Aug 2019 18:45:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hzmf2-0006MS-Rl for xen-devel@lists.xenproject.org; Mon, 19 Aug 2019 18:45:44 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8c845936-c2b1-11e9-8bf0-12813bfff9fa; Mon, 19 Aug 2019 18:45:43 +0000 (UTC) X-Inumbo-ID: 8c845936-c2b1-11e9-8bf0-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1566240344; h=from:to:cc:subject:date:message-id:mime-version; bh=X82PK+6p+WT1kSQdG3xzVeRwHWQSEY2ohWqF+fhkyuc=; b=ZVrg4QpbbyyehbnuWyhQA6bA18TCtKeJ2LlxEPL2Xjak4a2BL2btR19c OGjXHNmMwYEpBmTP1VID2Z/EHw+ud17+CqgcXs16YnHHRRsL/5kQYppua 2CI2Hisjt10sv+Rkr5LmhKCSb+p8wSJKt9Zir2mebDX36KLiETRf3DXQl o=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=igor.druzhinin@citrix.com; spf=Pass smtp.mailfrom=igor.druzhinin@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of igor.druzhinin@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="igor.druzhinin@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of igor.druzhinin@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="igor.druzhinin@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: +S8ssrNtJ/IYwt6LSG9DGexCqoowxdkpcfRxrRsFP9zDk6V/Uqz2XU08zaVbPVMzEvVGf1E03C KaKyAp3/07Lq/08fexTXBDvFGmYTeSeet5vkQc4xREEeN4rlBEuKqfiCV35SSrE0Yw3anFgr/Y 9Yp0qc2ooSsoTfZMxqWxZJaQHpat0S505ggtQ/TPB9rIuDeUBPUaFsI/Iv6xbrcspB6PZ4+5Yw RlzgAMLny9LL06xDxU45IUzRAEpFKalknLac8abh63FnT+cgybp9+l+h5uT258c+niT7o1H2m8 SQQ= X-SBRS: 2.7 X-MesageID: 4484969 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,405,1559534400"; d="scan'208";a="4484969" From: Igor Druzhinin To: Date: Mon, 19 Aug 2019 19:45:35 +0100 Message-ID: <1566240335-6614-1-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Igor Druzhinin , ian.jackson@eu.citrix.com, christian.lindig@citrix.com, wl@xen.org, dave@recoil.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) C version of xenstored had this ability since 61aaed0d5 ("Allow XS_INTRODUCE to be used for rebinding the xenstore evtchn.") from 2007. Copy it as is to Ocaml version. Signed-off-by: Igor Druzhinin Acked-by: Christian Lindig --- tools/ocaml/xenstored/domain.ml | 6 +++++- tools/ocaml/xenstored/process.ml | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain= .ml index b0a01b0..aeb185f 100644 --- a/tools/ocaml/xenstored/domain.ml +++ b/tools/ocaml/xenstored/domain.ml @@ -23,9 +23,9 @@ type t =3D { id: Xenctrl.domid; mfn: nativeint; - remote_port: int; interface: Xenmmap.mmap_interface; eventchn: Event.t; + mutable remote_port: int; mutable port: Xeneventchn.t option; mutable bad_client: bool; mutable io_credit: int; (* the rounds of ring process left to do, default= is 0, @@ -71,6 +71,10 @@ let notify dom =3D match dom.port with Event.notify dom.eventchn port =20 let bind_interdomain dom =3D + begin match dom.port with + | None -> () + | Some port -> Event.unbind dom.eventchn port + end; dom.port <- Some (Event.bind_interdomain dom.eventchn dom.id dom.remote_p= ort); debug "bound domain %d remote port %d to local port %s" dom.id dom.remote= _port (string_of_port dom.port) =20 diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/proce= ss.ml index 8a7e538..ff5c948 100644 --- a/tools/ocaml/xenstored/process.ml +++ b/tools/ocaml/xenstored/process.ml @@ -408,7 +408,13 @@ let do_introduce con _t domains cons data =3D in let dom =3D if Domains.exist domains domid then - Domains.find domains domid + let edom =3D Domains.find domains domid in + if (Domain.get_mfn edom) =3D mfn && (Connections.find_domain cons domid= ) !=3D con then begin + (* Use XS_INTRODUCE for recreating the xenbus event-channel. *) + edom.remote_port <- port; + Domain.bind_interdomain edom; + end; + edom else try let ndom =3D Domains.create domains domid mfn port in Connections.add_domain cons ndom; --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel