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

[PATCH v2 2/6] tools/oxenstored: Bind the DOM_EXC VIRQ in in Event.init()


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 30 Nov 2022 16:54:51 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Edwin Torok <edvin.torok@xxxxxxxxxx>, Rob Hoes <Rob.Hoes@xxxxxxxxxx>
  • Delivery-date: Wed, 30 Nov 2022 16:55:13 +0000
  • Ironport-data: A9a23:q9OwQK/7JjS3R8cTsVQoDrUDjX6TJUtcMsCJ2f8bNWPcYEJGY0x3z 2dMXziFPPiIZzegeY12YYvioUsA6MPWzoViSgdkr3o8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKucYHsZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIx1BjOkGlA5AZnPKsT5AS2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklw1 dwgKxpQbyytnqWP0qyDesI1g9YaeZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGM0Yn1lQ/UfrSmM+BgHXlfiIeg1WSvactuEDYzRBr0airO93QEjCPbZUIwhrH/ DmWl4j/Kk8/b+SG0TGXyGK1h6zdjD/2dK42BaLto5aGh3XMnzdOWXX6T2CTrfCnh2akVtlYK khS/TAhxYAi+UruQtTjUhmQpH+fogVaS9dWC/c96gyG1uzT+QnxO4QfZmcfMpp87pZwHGF0k A/S9z/0OdBxmIO1aUqe3OqVkR2rfhEHM1cyTnYBXzJQtrEPv7oPph7IS99iFou8gdv0BSz8z li2kcQuu1kApZVVjvvmpDgrlxrp/8GUFVBtum07S0r/tmtEiJiZi5tEALQxxdJJN86nQ1aIp xDocODOvblVXflheMFgKdjh/Y1FBd7faFUwYnY1RfHNEghBHFb9Fb28GBkkeC9U3j8sIFcFm nP7twJL/4N0N3C3d6JxaI/ZI510k/m/SYq7C66IMoQmjn1NmOmvpnkGiam4hjCFraTRuftnZ cfznTiEUh729piLPBLpHrxAgNfHNwg1xH/JRICT8vhU+eP2WZJhcp9caAHmRrlgvMu5TPD9r 4432z2il08OD4UTo0D/reYuELz9BSFgVMqv9JwKLrfrz8gPMDhJNsI9CIgJI+RN95m5XM+Ul p1hcie0EGbCuEA=
  • Ironport-hdrordr: A9a23:y9w/SqAHcX70Ak3lHemd55DYdb4zR+YMi2TDj3oBLSC9Afbo8P xG/c5rrSMc5wxwZJhNo7290ey7MBbhHP1OkPIs1NWZLWrbUQKTRekIh7cKgQeQeREWndQz6U 4USclD4arLY2SS4/yX3ODyKadH/DDOytHQudvj
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Xenstored always needs to bind the DOM_EXC VIRQ.

Instead of doing it shortly after the call to Event.init(), do it in the
init() call itself.  This removes the need for the field to be a mutable
option.

It will also simplify a future change to restore both parts from the live
update record, rather than re-initialising them from scratch.

Rename the field from virq_port (which could be any VIRQ) to it's proper name.

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>

v2:
 * New.
---
 tools/ocaml/xenstored/event.ml     | 9 ++++++---
 tools/ocaml/xenstored/xenstored.ml | 4 +---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/xenstored/event.ml b/tools/ocaml/xenstored/event.ml
index ccca90b6fc4f..a3be296374ff 100644
--- a/tools/ocaml/xenstored/event.ml
+++ b/tools/ocaml/xenstored/event.ml
@@ -17,12 +17,15 @@
 (**************** high level binding ****************)
 type t = {
        handle: Xeneventchn.handle;
-       mutable virq_port: Xeneventchn.t option;
+       domexc: Xeneventchn.t;
 }
 
-let init () = { handle = Xeneventchn.init (); virq_port = None; }
+let init () =
+       let handle = Xeneventchn.init () in
+       let domexc = Xeneventchn.bind_dom_exc_virq handle in
+       { handle; domexc }
+
 let fd eventchn = Xeneventchn.fd eventchn.handle
-let bind_dom_exc_virq eventchn = eventchn.virq_port <- Some 
(Xeneventchn.bind_dom_exc_virq eventchn.handle)
 let bind_interdomain eventchn domid port = Xeneventchn.bind_interdomain 
eventchn.handle domid port
 let unbind eventchn port = Xeneventchn.unbind eventchn.handle port
 let notify eventchn port = Xeneventchn.notify eventchn.handle port
diff --git a/tools/ocaml/xenstored/xenstored.ml 
b/tools/ocaml/xenstored/xenstored.ml
index c5dc7a28d082..55071b49eccb 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -397,7 +397,6 @@ let _ =
        if cf.restart && Sys.file_exists Disk.xs_daemon_database then (
                let rwro = DB.from_file store domains cons 
Disk.xs_daemon_database in
                info "Live reload: database loaded";
-               Event.bind_dom_exc_virq eventchn;
                Process.LiveUpdate.completed ();
                rwro
        ) else (
@@ -413,7 +412,6 @@ let _ =
 
                if cf.domain_init then (
                        Connections.add_domain cons (Domains.create0 domains);
-                       Event.bind_dom_exc_virq eventchn
                );
                rw_sock
        ) in
@@ -451,7 +449,7 @@ let _ =
                        let port = Event.pending eventchn in
                        debug "pending port %d" (Xeneventchn.to_int port);
                        finally (fun () ->
-                               if Some port = eventchn.Event.virq_port then (
+                               if port = eventchn.Event.domexc then (
                                        let (notify, deaddom) = Domains.cleanup 
domains in
                                        List.iter (Store.reset_permissions 
store) deaddom;
                                        List.iter (Connections.del_domain cons) 
deaddom;
-- 
2.11.0




 


Rackspace

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