]> git.ipfire.org Git - thirdparty/qemu.git/commit
igb: fix link state on resume
authorLaurent Vivier <lvivier@redhat.com>
Wed, 24 Jan 2024 10:29:03 +0000 (11:29 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 12 Mar 2024 17:50:43 +0000 (20:50 +0300)
commitc440c89ecb1e34952acea8c106f9eadfba9125f1
tree7278f1c4f63dd85d115257618ba14d5b4a56f1e5
parent6ad78a085ed3bea838b741f8137d4193b44fb3dc
igb: fix link state on resume

On resume igb_vm_state_change() always calls igb_autoneg_resume()
that sets link_down to false, and thus activates the link even
if we have disabled it.

The problem can be reproduced starting qemu in paused state (-S) and
then set the link to down. When we resume the machine the link appears
to be up.

Reproducer:

   # qemu-system-x86_64 ... -device igb,netdev=netdev0,id=net0 -S

   {"execute": "qmp_capabilities" }
   {"execute": "set_link", "arguments": {"name": "net0", "up": false}}
   {"execute": "cont" }

To fix the problem, merge the content of igb_vm_state_change()
into igb_core_post_load() as e1000 does.

Buglink: https://issues.redhat.com/browse/RHEL-21867
Fixes: 3a977deebe6b ("Intrdocue igb device emulation")
Cc: akihiko.odaki@daynix.com
Suggested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 65c2ab808571dcd9322020690a63df63281a67f0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/igb_core.c
hw/net/igb_core.h