Repository navigation
CA-432452: Mirror the leaf in its own slice when the VM has no domain - #7334
LunfanZhang wants to merge 1 commit into
Conversation
changlei-li
left a comment
There was a problem hiding this comment.
The fix is correct for cross-host halted SXM, but on a same-host v3→v3 migration it puts the source and the destination in the same qemu-dp slice, which brings back the CA-431809 data-loss bug.
| Local.VDI.activate3 dbg dp sr vdi mirror_vm ; | ||
| mirror_vm | ||
| | _ -> | ||
| ignore (Local.VDI.attach3 dbg dp sr vdi (Vm.of_string "0") true) ; |
There was a problem hiding this comment.
Why it needs to be attached to dom0 when the VM is running (hence the VDI must be attached and activated with the VM)?
There was a problem hiding this comment.
This is the original impl in master; I believe it was copied from SMAPIv1, where the datapath is attached to dom0. We can't do that for SMAPIv3, because qemu-dp doesn't support activating an already-activated datapath. So this line has no effect here — removed.
| let live_vm = | ||
| match s_of_vm live_vm with | ||
| | "-1" -> | ||
| ignore (Local.VDI.attach3 dbg dp sr vdi mirror_vm true) ; |
There was a problem hiding this comment.
In this case, the attach should not be ignored?
There was a problem hiding this comment.
Agree, updated.
A halted or suspended VM has domid -1, and qemu-dp turns a numeric slice name straight into -xen-domid, so the mirror waits for a domain that will never appear. A non-numeric slice resolves to dom0, which is what the snapshot copies already use. Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <Lunfan.Zhang@cloud.com>
d64b8d7 to
593216a
Compare
Good catch, for a running VM, it is adding a |
A halted or suspended VM has
domid -1, so the leaf mirror runs in qemu-dp slice "-1", which never starts but just reportqemu-datapath@-1 took too long to become available.Mirror in the
mirror_vmslice instead - non-numeric when Guest is halted ( whenlive_vm = -1), so data-path resolves it to dom0 like SMAPIv1 does - attaching and activating the VDI onmirror_vmensure offline Storage migration can work as well.