On Fri, Sep 14, 2012 at 2:34 AM, Amos Kong <ak...@redhat.com> wrote: > On 13/09/12 20:29, Stefan Hajnoczi wrote: >> >> On Thu, Sep 13, 2012 at 9:51 AM, Amos Kong <ak...@redhat.com> wrote: >> Regarding migration: do we migrate the NetClient->link_down field? If >> we only migrate the status register value then the link may actually >> be up at the net.c level. > > > I tried to add 'MediaStatus' to 'struct RTL8139State', and update > 'VMStateDescription vmstate_rtl8139', then the value of MediaStatus > will be migrated. > > But the idea in v2 is better.
Migrating the NIC's media status is not enough. Above I asked about migrating nc->link_down, which determines whether net.c delivers packets or drops them. Your patch migrates the NIC's media status but I believe nc->link_down isn't being migrated and the guest will therefore receive packets from the host! This could lead to unexpected results since the guest thinks the link is down. It's not a bug in your patch, but a larger issue that needs to be addressed for all NICs that support migration. (Unless I missed the code that will migrate link_down.) Stefan