Skip to content

Commit 2e21f52

Browse files
author
Jon Ludlam
committed
CA-114673: Default create-time for a domain is 'now' not 0
Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com> Description of the problem from John Else: The events within xenopsd happen in approximately this order (n.b. the sender and receiver are different threads in the same xenopsd, as this is a localhost migration): 1 Sender makes a request to receiver's receive_memory handler 2 Receiver creates a new domain into which it will receive the memory (including writing the new domain's tree under /vm/<uuid>/<domid>) 3 Sender initiates a save pointing at the fd used by the request from step 1 4 Receiver initiates a restore using the other end of the above fd Problem is, step 3 needs to know which of the two domains to save, and there's no guarantee that step 3 starts after step 2 is finished. If the xenstore tree hasn't been written yet, xenopsd defaults to reading the new domain's creation time as zero, so will always choose it as the old domain to be saved.
1 parent 85a5777 commit 2e21f52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xc/xenops_server_xen.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ let di_of_uuid ~xc ~xs domain_selection uuid =
177177
try
178178
xs.Xs.read (Printf.sprintf "/vm/%s/domains/%d/create-time" uuid' x.domid) |> Int64.of_string
179179
with e ->
180-
warn "Caught exception trying to find creation time of domid %d (uuid %s)" x.domid uuid';
181-
0L
180+
warn "Caught exception trying to find creation time of domid %d (uuid %s)" x.domid uuid';
181+
warn "Defaulting to 'now'";
182+
Oclock.gettime Oclock.monotonic
182183
in
183184
compare (create_time a) (create_time b)
184185
) possible in

0 commit comments

Comments
 (0)