On 03/05/2011 05:50 PM, Peter Maydell wrote:
(1) Is there supposed to be any kind of guard on trying to do a vmsave on a system with devices that don't implement save/load? IME it just produces a snapshot which doesn't work when you reload it...
I think you're right, devices currently have to call register_device_unmigratable manually. I guess you could add support to qdev, so that qdev-ified devices could specify a special "forbid migration" value for the vmsd field.
Alternatively, you could have NULL mean "forbid migration" and a special value for "do not save anything, it will just work".
(2) How do you track incompatible changes at the machine level? For instance, suppose we accidentally forgot to model a NOT gate in an IRQ line, so we add a qemu_irq_invert() to the machine init function. None of the devices have changed, but you can't load the state of an old version of the machine into a new version, because then the devices on either end of the inverter would be inconsistent about the state of the line. But there's no version number for a machine as far as I can see.
You can change the machine model and keep the incompatible machine as a separate model. A machine can specify compatibility properties that are meant exactly for this kind of bug-compatible behavior. Reloading the VM must be done with the correct -M switch for the old model.
Examples of how to do this are in hw/pc_piix.c (which will provide good ideas for further grepping, too :)).
Paolo