* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 27/03/2018 18:47, Dr. David Alan Gilbert wrote: > >> So if the subsection is absent you > >> have to migrate either tx.tso_props or tx.props, depending on s->tx.cptse. > > Do you mean when sending you have to decide which set to send in the > > non-subsection data? And with cptse true that means use tso_props? > > Yes. > > >> Likewise if you migrate from older versions: if s->tx.props.tse && > >> s->tx.cptse, you have to copy s->tx.props to s->tx.tso_props and clear > >> s->tx.props. > > > > I don't see any equivalent code in the existing non-subsection postload to > > do this; so I'm guessing there are some cases of 2.11->2.12 that will > > break at the moment? > > Yes, I think so.
OK, so we'd better fix that for 2.12. > >> My understanding is that s->tx.tso_props.tse will be 1 if > >> and only if the source sent s->tx.tso_props. > > I don't see anything in the current code that migrates tso_props.tse - > > where does it come from? > > Ouch... The tse field is more or less dead in current code AFAICS, but > it was used in the previous version. What's the best way then to find > if the subsection was transmitted? Do we have anything like a post_load > callback in the subsection itself? Yes, if I just add a .post_load field in the subsection it should get called. > To find out which "props" to transmit to older QEMU, you can add a > tp->use_tso_for_migration = tp->cptse just before "if (!(txd_lower & > E1000_TXD_CMD_EOP))" in process_tx_desc... OK. > >> This seems most easily done with a new field (e.g. vmstate_fixed_props) > >> that is written in pre_save and set in post_load. > > It might need a VMSTATE_WITH_TMP to be able to do the saving part; > > when saving we can't change the current state when migrating > > to an old destination in case the migration fails and we just continue. > > Perhaps you can just copy props/tso_props to a new field, and change all the > > VMSTATE_UINT8(tx.props.ipcss, E1000State), > VMSTATE_UINT8(tx.props.ipcso, E1000State), > VMSTATE_UINT16(tx.props.ipcse, E1000State), > > to > > VMSTATE_UINT8(tx_legacy_vmstate_props.ipcss, E1000State), > ... > > and then add tx.props to the subsection together with tso.props. > > New->old migration will place tx_legacy_vmstate_props in tx.props on the > destination; new->new will realize the subsection was transmitted and > ignore the tx_legacy_vmstate_props; old->new will not find data from the > subsection and copy the tx_legacy_vmstate_props into one of tx.props and > tx.tso_props. Yeh, adding a legacy_props field should do it; although we never need to transmit more than 2 copies. I'll look at this more tomorrow; I am a bit worried about testing it though. Dave > Paolo -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK