[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: Fri, 2 Dec 2022 09:11:53 +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=hCxPQN/XSAifik1PuiUAu/19rYYjB+/g0bspy4fBNT8=; b=JDHddEg+otbqNNmhESoQoqy9kPPavPI5+6Wr6VgHjW01QsF/bIUybihWUHQNI0zQSnB6cOY1P3olQZoFHkdLYUkybw9soGKsGzLrLmN5c6kYj2NT1mTmKdOueFBMJ05q2IB+FtpqzcSadxkUAnioa6MX022xSpKkyof7o8+y/wji+Siq96yNLrPkmUCl2iODMJh8Y4vET2AgbgshVvH8MoW0V2msO7V3wwn9sxBOfQZtZuxqmQNGD4il9MlXeIphAosKBq75TbeZMmIZ7NbCxgPyV7mtc172BRQyF0PYco5r8K/iUzUNjG++Xh7yp9fadg9s91tD2V9QSurhG/T3Xg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q4RAXTsrCTtQDC65/S1FiR5xKGS36GehG6DR37FzKAZUc8cz+HGzulPddtrcqxWFvHDm3AlDeHzT+u05ueTzRwYXOBpe5hNwJE0zz3NqIWquycFWVc1PaMDpK4KnQYCuFKagJR4muj+RhPyDTlP0RBGUgMn1gWtXLwhY722RIX6f5vsV7DxBF4rV82Jl0DRjRENpCrPHB0oZGko2a5/4tCFIcGbXU+kTV7A51Ivk/vQaTSxgRC4+w4Rkf5KqZxJHgv/LWfj8kFrwRwPfjRZOz50tKNrHGZv2YrqIsRTBNhBUeL5RiXJSb1PqimrlPIwWtLWt+6ornU8j2GatcOBvYw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Christian Lindig <christian.lindig@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Rob Hoes <Rob.Hoes@xxxxxxxxxx>
  • Delivery-date: Fri, 02 Dec 2022 09:12:00 +0000
  • Ironport-data: A9a23:z0cvr6KQuWeR2sAVFE+RwpQlxSXFcZb7ZxGr2PjKsXjdYENS3mYHz WBLCjvSaK2OYTPwL4wjbYqx90pUsMXcyNBjSwdlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHv+kUrWs1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPdwP9TlK6q4mlB5ARkPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5tJW5V2 d02GgpXZyufjf+Y25Xqe+9j05FLwMnDZOvzu1lG5BSAVLMNZsmGRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dppTGNnGSd05C0WDbRUtGGW8RT2Fqfv GXF12/4HgsbJJqUzj/tHneE1r+QwHqgANh6+LuQ671F2VeuwUcqViIGdlSAqOa7qnylRIcKQ 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZjJIdtEOrsI9Qj0uk FiTkLvU6SdHtbSUTTeW8e6SpDbrYCwNdzZcNWkDUBcP5MTlrMcrlBXTQ91/EamzyNroBTX3x DPMpy8771kOsfM2O2yA1Qivq1qRSlLhF2bZOi2/srqZ0z5E
  • Ironport-hdrordr: A9a23:qGU2Ta+eKAZ6X7taLRluk+DOI+orL9Y04lQ7vn2ZKCYlEPBw8v rEoB1173/JYVoqOU3I4OrvBEDiewK+yXcW2+Qs1N6ZNWHbUQ2TQL2KhrGJ/9SPIULDHso379 YET5RD
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZBNyC07UMyecyUU6qY7XFpbA+Qq5Y5D8AgAAN2oCAAWBegA==
  • Thread-topic: [PATCH v2 4/6] tools/oxenstored: Implement Domain.rebind_evtchn


> On 1 Dec 2022, at 12:10, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx> wrote:
> 
> On 01/12/2022 11:20, Christian Lindig wrote:
>> 
>>> 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>
>> Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>
> 
> Thanks.
> 
>> The code makes changes around if-expressions and it is easy to get mislead 
>> by indentation which parts are covered by an if and which are not in the 
>> presence of sequential code. I would be more confident about this with 
>> automatic formatting (but also believe this is correct).
> 
> I can keep the being/end if you'd prefer.
> 
> Looking at the end result, it would actually shrink the patch, so is
> probably worth doing anyway for clarity.  The net result is:
> 
> diff --git a/tools/ocaml/xenstored/process.ml
> b/tools/ocaml/xenstored/process.ml
> index b2973aca2a82..1c80e7198dbe 100644
> --- a/tools/ocaml/xenstored/process.ml
> +++ b/tools/ocaml/xenstored/process.ml
> @@ -569,8 +569,7 @@ let do_introduce con t domains cons data =
>                         let edom = Domains.find domains domid in
>                         if (Domain.get_mfn edom) = mfn &&
> (Connections.find_domain cons domid) != con then begin
>                                 (* Use XS_INTRODUCE for recreating the
> xenbus event-channel. *)
> -                               edom.remote_port <- remote_port;
> -                               Domain.bind_interdomain edom;
> +                               Domain.rebind_evtchn edom remote_port;
>                         end;
>                         edom
>                 else try
> 
> I'm happy to adjust on commit.
> 
> When I started this, I tried rearranging things to avoid the "if exists
> then find" pattern, but quickly got into a mess, then realised that this
> is (almost) a dead logic path... I've got no idea why this is supported;
> looking through history, I can't find a case where a redundant
> XS_INTRODUCE was ever used, but its a common behaviour between C and O
> so there was clearly some reason...


Currently the soft reset code in xenopsd uses it, but as you say there must've 
been another reason too (the soft reset code is a lot more recent than this).

Best regards,
--Edwin


 


Rackspace

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