You should probably just setup VMState such that it directly saves kvm_lapic_state and then have the pre/post functions call the kernel ioctls to sync it. There's not a whole lot of point switching the state Same applies here as ioapic. Should be a separate device. -- Regards, Anthony Liguori --
It ensures the two models are compatible. Since they're the same device from the point of view of the guest, there's no reason for them to have different representations or to be incompatible. -- error compiling committee.c: too many arguments to function --
live migration between something that has in-kernel irqchip and something that has not is likely to be a completely untested thing. And this is the only reason we might think of it as the same device. I don't see any value in supporting this combination --
Not just live migration. ACPI sleep + savevm + loadvm + ACPI resume, for example. -- Jamie --
Yes, but in this case too, I'd expect the irqchipness of qemu not to change. --
If I've just been sent an image produced by someone running KVM, and my machine is not KVM-capable, or I cannot upgrade the KVM kernel module because it's in use by other VMs (had this problem a few times), there's no choice but to change the irqchipness. -- Jamie --
As gleb mentioned, requiring such a change to happen offline (across a reboot) is not that much of a pain. There are thousands of scenarios in which it will have to happen anyway, including major bumps in qemu version. --
You cannot migrate from KVM to TCG so this use-case is irrelevant. -- Regards, Anthony Liguori --
I agree it's mostly irrelevant, however nothing in principle prevents such a migration, as long as the cpuid feature bits are implemented on both sides. -- error compiling committee.c: too many arguments to function --
Sure, in principle it's certainly possible but in practice, it isn't today and I don't see anything that's likely to happen in the near term future that would make it. -- Regards, Anthony Liguori --
The problem is, the in-kernel apic is not part of the qemu source tree. If we add a field to the qemu apic, then we would break the in-kernel apic and vice-versa. It's far easier to just have the in-kernel apic as a separate model. Most importantly though, the code should reflect how things behave. It's extremely difficult to look at the apic code and figure out what bits are used and what bits aren't used when the in-kernel apic is enabled. Regards, Anthony Liguori --
You need to handle it anyway due to save/restore; that is the new field That doesn't mean they need to be separate devices. -- error compiling committee.c: too many arguments to function --
Not necessarily. If it's a bug fix, we may disable the older versions But they are. The in-kernel device models are not mere accelerations. There are features that are only enabled with in-kernel device models (like PCI passthrough). In fact, in-kernel PIT is not at all an acceleration, it's there because it's functionally different. The sync stuff is really ugly too. It would be much cleaner to have a separate state for the in-kernel device models that saved the structures from the kernel directly instead of having to translate between formats. More straight forward code means it's all easier to understand, easier to debug, etc. Regards, Anthony Liguori --
One may arguee that I am stupid, but I have caught myself reading code that was totally unused in the quest for irqchip related bugs... --
Not necessarily. You can grab the structures directly from the kernel definition , copy that over, issue the ioctl, and just make sure the source and destination have compatible kernels. --
