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

[PATCH for-4.17] tools/ocaml/xenstored: fix live update exception


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Edwin Török <edvin.torok@xxxxxxxxxx>
  • Date: Thu, 20 Oct 2022 17:54:55 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Edwin Török <edvin.torok@xxxxxxxxxx>, "Christian Lindig" <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Thu, 20 Oct 2022 16:55:44 +0000
  • Ironport-data: A9a23:AN0fb6Nx6cdymQrvrR28l8FynXyQoLVcMsEvi/4bfWQNrUpzgzFVn WQXUWyHa67eYTHyc4t3Odi/9hgA7ZaBm4NjQQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6j+fQLlbFILasEjhrQgN5QzsWhxtmmuoo6qZlmtH8CA6W0 T/Ii5S31GSNhnglbwr414rZ8Ek15ayo4GtC1rADTasjUGH2xiF94K03fcldH1OgKqFIE+izQ fr0zb3R1gs1KD90V7tJOp6iGqE7aua60Tqm0xK6aID76vR2nQQg075TCRYpQRw/ZwNlPTxG4 I4lWZSYEW/FN0BX8QgXe0Ew/ypWZcWq9FJbSJQWXAP6I0DuKhPRL/tS4E4eNJQeysN4XWZ32 uVCDTUmUAqtqdCM3+fuIgVsrpxLwMjDOYoevjdrzC3DDOZgSpfGK0nIzYYGhnFq3JkIRKuAI ZpCAdZsRE2ojxlnN1sJCZR4gOCygXrXeDxEslOF46Ew5gA/ySQhi+GyaYONKrRmQ+1+nka3u lnqr13aH0slEfK66iO9wmqV07qncSTTB9tJSezQGuRRqEKX7nweDlsRT1TTidm0jFSvHe1WL UM88zAr66M18SSDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZNYcIrnNU7Tjsr0 hmOhdyBONB0mOTLEzTHrO7S9G7sf3hORYMfWcMaZQIc5enGr900tz3WFPNmO5CvoPPHIy6ll lhmsxMCr7kUiMcK0YCy8lbGny+gq/D1c+Il2unEdjn7t10kPeZJc6TtsAGGtqgYcO51W3Hb5 BA5d96iAPfi5H1nvAiEW60zEb6g/J5p2xWM0Ac0T/HNG9lAkkNPnLy8AhkkeS+F0e5eI1cFh XM/XisIvfdu0IOCN/MfXm5II51CIVLcPdrkTOvISdFFf4J8cgSKlAk3OxDOhjm9zBRyyvxlU Xt+TSpLJS9AYZmLMRLsH7tNuVPV7npWKZzvqWDTkE38jOv2iI+9QrYZKlqeBt0EAFe/iFyNq b53bpLSoz0GCbGWX8Ui2dNKRbz8BSNgXs6eRg0+XrPrHzeK70l9UaOOkOx8JNE+90mX/8+Rl kyAtoZj4AKXrRX6xc+iMxiPtJuHsU5DkE8G
  • Ironport-hdrordr: A9a23:3DtL9qhGJZAzkRqffkm7Ewbql3BQXtQji2hC6mlwRA09TySZ// rOoB19726TtN9xYgBGpTnuAtjifZqxz/FICOoqTNOftWvdyQmVxehZhOOIqVCNJ8SXzJ8l6U 4KSchD4bPLY2SS9fyKhTWFLw==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

During live update we will load the /tool/xenstored path from the previous 
binary,
and then try to mkdir /tool again which will fail with EEXIST.
Check for existence of the path before creating it.

The write call to /tool/xenstored should not need any changes
(and we do want to overwrite any previous path, in case it changed).

Prior to 7110192b1df6 live update would work only if the binary path was
specified, and with 7110192b1df6 and this live update also works when
no binary path is specified in `xenstore-control live-update`.

Fixes: 7110192b1df6 ("tools/oxenstored: Fix Oxenstored Live Update")
Signed-off-by: Edwin Török <edvin.torok@xxxxxxxxxx>
---
 tools/ocaml/xenstored/xenstored.ml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/xenstored.ml 
b/tools/ocaml/xenstored/xenstored.ml
index fc90fcdeb5..3299fe73f7 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -353,7 +353,9 @@ let _ =
        ) in
 
        (* required for xenstore-control to detect availability of live-update 
*)
-       Store.mkdir store Perms.Connection.full_rights (Store.Path.of_string 
"/tool");
+       let tool_path = Store.Path.of_string "/tool" in
+       if not (Store.path_exists store tool_path) then
+                                       Store.mkdir store 
Perms.Connection.full_rights tool_path;
        Store.write store Perms.Connection.full_rights
                (Store.Path.of_string "/tool/xenstored") Sys.executable_name;
 

base-commit: 0c06760be3dc3f286015e18c4b1d1694e55da026
-- 
2.34.1




 


Rackspace

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