[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/6] tools/oxenstored: Implement Domain.rebind_evtchn


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Edwin Torok <edvin.torok@xxxxxxxxxx>
  • Date: Wed, 30 Nov 2022 17:15:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OXe9CxqgeX86lv66pzeEKIeBDPTOOvbZh4zRdLyGH+4=; b=kDONjoVCNm1vchVKqEBKne7XTr6fvNBAr8zOlSN/BwWTFcdiVhvA1Qrl2DTWkAGcLvXqjIiHUbmvLWvjIoXr2p0wv2JBU875u6mmueJrMQiPJWv7CQhGxBXZWwmHYNNolqqsBU00o58eCoWFcjpZG4Dm5cEjxZWDxRKHCBhbgo4irQKKU2M73xoL2CVr0A5IsxGdoymtlX4SfxLFgtd/mAmkJLpgIXMcH3BDwl/SfCmMAQVTLWJsb3XCMkRyGbLh0dB1kNw+6GREgd52Wi6T94h+YEar5ZVBEnezVXuyfITMv9ZmrcPtjgLozyi2OI2sug6tQE9a9CTasbC3S49z6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SgZuTdmwe3UP+X3W6UXpQSK7+Guj2hyBgumWG957OvnaIUlvtnVcDzyhiHz/guhg0Vz1LBrdruqM+y8QfQGlwe2RZgFEgkbnllQDjjuJctqmsJJlNZVricj0tuwYLxAyoJvdK1RGFwboaQFFq7+T5L4WacOlWNKm4xl0aoiTpPHIWGulspud2mfAj4BMpQRok7Q3MTY023xgRRIfhjKtZ0xz0e36+kz2/0UGsuiLdc7Ug8QRirjk5vApOKG3lHymFWTXyWKl+pdLnF8kpiR0lFtpN5nWTPy7J7yuqI3rPyR8rgCq6R/Bd0VwdjNoNDp2g0Je9N0NwdkHBwTwsGFNuQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Rob Hoes <Rob.Hoes@xxxxxxxxxx>
  • Delivery-date: Wed, 30 Nov 2022 17:15:21 +0000
  • Ironport-data: A9a23:C6b9Dql3PmHbj8Hp966MBYbo5gySJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xJJWDuBb/eCYzfyL95xOoi/px5Q75WGz4UyT1Q5/Hw1FCMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icf3grHmeIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE4p7aqaVA8w5ARkP6kS5weGzBH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 fMfKh8IfzDZvMSV8rvnR+RomvU4fca+aevzulk4pd3YJdAPZMmaBonvu5pf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVM3ieewWDbWUoXiqcF9k0qGp 2SA42PjBRIyP92D0zuVtHmrg4cjmAurBtlKRezkq5aGhnWOzXcQNh4pe2G7rOG1iBCVUoIHK RQbr39GQa8asRbDosPGdw21pjuIswARX/JUEvYm80edx6zM+QGbC2M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er discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZBNyC07UMyecyUU6qY7XFpbA+Qq5XtNiA
  • Thread-topic: [PATCH v2 4/6] tools/oxenstored: Implement Domain.rebind_evtchn


> On 30 Nov 2022, at 16:54, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> Generally speaking, the event channel local/remote port is fixed for the
> lifetime of the associated domain object.  The exception to this is a
> secondary XS_INTRODUCE (defined to re-bind to a new event channel) which pokes
> around at the domain object's internal state.
> 
> We need to refactor the evtchn handling to support live update, so start by
> moving the relevant manipulation into Domain.
> 
> No practical change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Christian Lindig <christian.lindig@xxxxxxxxxx>
> CC: David Scott <dave@xxxxxxxxxx>
> CC: Edwin Torok <edvin.torok@xxxxxxxxxx>
> CC: Rob Hoes <Rob.Hoes@xxxxxxxxxx>
> 
> Note: This change deliberately doesn't reuse Domain.bind_interdomain, which is
> removed by the end of the refactoring.


Reviewed-by: Edwin Török <edvin.torok@xxxxxxxxxx>

> 
> v2:
> * New.
> ---
> tools/ocaml/xenstored/domain.ml  | 12 ++++++++++++
> tools/ocaml/xenstored/process.ml |  6 ++----
> 2 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain.ml
> index ab08dcf37f62..d59a9401e211 100644
> --- a/tools/ocaml/xenstored/domain.ml
> +++ b/tools/ocaml/xenstored/domain.ml
> @@ -63,6 +63,18 @@ let string_of_port = function
> let dump d chan =
> fprintf chan "dom,%d,%nd,%d\n" d.id d.mfn d.remote_port
> 
> +let rebind_evtchn d remote_port =
> + begin match d.port with
> + | None -> ()
> + | Some p -> Event.unbind d.eventchn p
> + end;
> + let local = Event.bind_interdomain d.eventchn d.id remote_port in
> + debug "domain %d rebind (l %s, r %d) => (l %d, r %d)"
> +      d.id (string_of_port d.port) d.remote_port
> +      (Xeneventchn.to_int local) remote_port;
> + d.remote_port <- remote_port;
> + d.port <- Some (local)
> +
> let notify dom =
> match dom.port with
> | None -> warn "domain %d: attempt to notify on unknown port" dom.id
> diff --git a/tools/ocaml/xenstored/process.ml 
> b/tools/ocaml/xenstored/process.ml
> index b2973aca2a82..2ea940d7e2d5 100644
> --- a/tools/ocaml/xenstored/process.ml
> +++ b/tools/ocaml/xenstored/process.ml
> @@ -567,11 +567,9 @@ let do_introduce con t domains cons data =
> let dom =
> if Domains.exist domains domid then
> let edom = Domains.find domains domid in
> - if (Domain.get_mfn edom) = mfn && (Connections.find_domain cons domid) != 
> con then begin
> + if (Domain.get_mfn edom) = mfn && (Connections.find_domain cons domid) != 
> con then
> (* Use XS_INTRODUCE for recreating the xenbus event-channel. *)
> - edom.remote_port <- remote_port;
> - Domain.bind_interdomain edom;
> - end;
> + Domain.rebind_evtchn edom remote_port;
> edom
> else try
> let ndom = Domains.create domains domid mfn remote_port in
> -- 
> 2.11.0
> 


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.