]> git.ipfire.org Git - thirdparty/qemu.git/commit
e1000e: fix link state on resume
authorLaurent Vivier <lvivier@redhat.com>
Wed, 24 Jan 2024 10:40:06 +0000 (11:40 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 13 Mar 2024 20:09:00 +0000 (23:09 +0300)
commitdf052d6c1c13247de89b14d7e5193966afbd414e
treecc3b7c2dc82fa12acc6ffa614fcb8360b2ea19b5
parentf1efd85486a1427ee10ba0a82d246d99f1368632
e1000e: fix link state on resume

On resume e1000e_vm_state_change() always calls e1000e_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 e1000e,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 e1000e_vm_state_change()
into e1000e_core_post_load() as e1000 does.

Buglink: https://issues.redhat.com/browse/RHEL-21867
Fixes: 6f3fbe4ed06a ("net: Introduce e1000e device emulation")
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 4cadf10234989861398e19f3bb441d3861f3bb7c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/e1000e_core.c
hw/net/e1000e_core.h