That's very clear! Thanks, Vincenzo
2013/7/26 Andreas Färber <afaer...@suse.de>: > Am 26.07.2013 15:09, schrieb Vincenzo Maffione: >> 2013/7/26 Andreas Färber <afaer...@suse.de>: >>> Am 26.07.2013 12:14, schrieb Vincenzo Maffione: >>>> I tried to support cross-version migration using version_id and >>>> VMState subsections. >>> >>> The point of using a subsection is to avoid incrementing version_id AFAIU. >> >> Consider a migration from an older QEMU version to a newer one. >> AFAIU, the e1000_post_load() callback is passed "1" or "2" into the >> "version_id" parameter (i.e. the e1000 version of the older QEMU). >> If that is correct, in this scenario I have to zero-init the new >> fields I implemented, otherwise they would stay uninitialized. > > The whole state struct is always zero-initialized as part of > object_new()/qdev_create(). So only non-zero fields need to be > initialized, and I assume that a zero flag will indicate no mitigation > feature. > >> If I don't increment version_id to 3, how can I understand when we are >> in this scenario? >> >> Or maybe I should assume that (in the same scenario) the new version >> QEMU instance MUST have been launched with the mitigation disabled? If >> I assume this it seems to me that incrementing version_id to 3 is not >> necessary. > > You can assume that you have equivalent command lines on both source and > destination. -M pc-i440fx-1.5 and -M pc-q35-1.5 would simply never > receive your subsection. I'm sure Stefan can explain in more detail. > > Regards, > Andreas > > -- > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg -- Vincenzo Maffione