On 31/07/2026 12:58, Peter Krempa wrote:
Hmm it is indeed tricky. Especially to do somewhat "cleanly".
Additional constraint is that we strive to support backward migration (if you start a VM on older libvirt you should be able to migrate it back to it even if it round-trips through new ones).
The only thing that comes into my mind is to:
1) document that 'off' isn't really off 2) introduce a new enum value for 'really-off' (obviously with less terrible name 3) keep the behaviour for 'off' introduce explicit disable for 'really-off'
That way new libvirt can see which one is used, and old libvirt will behave the same for 'off' and reject 'really-off'.
But it is disgusting in the way that 'off' will not mean exactly the same thing as for others and this will be recorded only in the documentation.
Optionally a new 'really-on' value could be added and suggested in the docs.
Yeah, I suppose something like "force-{off,on}" could work. It's a bit unpleasant as you say, though.
Unfortunately anything else akin to adding another attribute or something will not work because old libvirt will ignore it.
Two ideas that came to my mind: 1. For the backward migration case, is there any sort of precheck that could intercept the migration on the newer source side before sending data that would be misinterpreted by the older dest? This would have the same ultimate migration failure result, but frees up the need to create a new state variant. 2. Is there any kind of translation that happens when migrating from old to new? i.e. could the newer libvirt be aware the the source is older, and perform the same domain translation that the reconnect path would? If so, we wouldn't need any new XML at all, just the logic in those reconnect and "translate" paths to drop any "state=off" from the XML and turn it into absent. Although I fear that even in those cases, we wouldn't cover persistent but currently inactive defined domains - we'd have to somehow iterate over those and edit them too which seems also rather unpleasant. Interested in your thoughts. - Chris