Paolo Bonzini writes: > On 04/01/2011 08:22 AM, Jason Wang wrote: > > + > > + if (drive->bs == NULL) { > > + return 1; > > Is it okay to return 1 here? Have you tested the case when both the > source and the target drives have no floppy? >
Thanks for the reminding, and it could be fixed by put all pre/post callbacks into the subsections. > (The "media_changed == 2" in my sample code was basically a way to save > the "media present" state of the drive on the source). > Right, but it would make subsection saving be the common case (consider most of the vm may just have one floppy but we have two drives). A better solution maybe: 1 Set default_migration_media_changed be 0 for 0.15 and 1 for elder 2 Unconditiaonlly send subsection when it was 0, and do not send subsection when it was 1 3 Set media_changed to default_migration_media_changed in pre_load() 4 Let all pre/post to be in subsection After those, we can make sure the migration between 0.15 could get correct media_changed, also make sure the seamless migration between 0.15 and older machine types. Any suggestions? > > + } else { > > + drive->bs->media_changed = drive->media_changed; > > + return 0; > > + } > > The code is also missing the case of a pc-0.14 machine. The problem > here is that the pc-0.15 machine hasn't been created yet, you get the > honor. :( > Would create such one :) > Paolo