Bug 1707646

Summary: Boot guest with e1000e, value of "/sys/class/net/$nic/operstate" is wrongly showed as "up" after "(qemu) set_link net0 off"
Product: Red Hat Enterprise Linux 7 Reporter: Pei Zhang <pezhang>
Component: qemu-kvm-rhevAssignee: jason wang <jasowang>
Status: CLOSED WONTFIX QA Contact: Pei Zhang <pezhang>
Severity: high Docs Contact:
Priority: high    
Version: 7.7CC: aadam, chayang, jinzhao, juzhang, rkhan, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-02 05:50:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pei Zhang 2019-05-08 02:33:25 UTC
Description of problem:
Boot guest with e1000e. After executing "(qemu) set_link net0 off", the value of "/sys/class/net/$nic/operstate" in guest is 'up'. but the expected value is 'down'.


Version-Release number of selected component (if applicable):
3.10.0-1043.el7.x86_64
qemu-kvm-rhev-2.12.0-27.el7.x86_64


How reproducible:
100%


Steps to Reproduce:
1. Boot guest with e1000e

-netdev tap,id=hostnet0 \
-device e1000e,netdev=hostnet0,id=net0,mac=fa:5e:07:b4:08:01,bus=root.2 \

2. In qemu terminal, set this NIC link off
(qemu) set_link net0 off

3. In guest, check status, it's wrongly showed "up".

# ifconfig
ens2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.73.74.39  netmask 255.255.252.0  broadcast 10.73.75.255
        inet6 fe80::f85e:7ff:feb4:801  prefixlen 64  scopeid 0x20<link>
        ether fa:5e:07:b4:08:01  txqueuelen 1000  (Ethernet)
        RX packets 81602  bytes 6158528 (5.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 268  bytes 758903 (741.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 23  memory 0xfe640000-fe660000  

# cat /sys/class/net/ens2/operstate
up


Actual results:
The value of /sys/class/net/$nic/operstate is wrongly showed "up" after set link down.


Expected results:
The value of /sys/class/net/$nic/operstate should be showed "down" after set link down.


Additional info:
1. virtio-net-pci works well. So it's only e1000e issue.


Reference:
1. Full cmd line:

/usr/libexec/qemu-kvm -name rhel7.7 \
-M q35,kernel-irqchip=split \
-cpu host -m 8G \
-smp 4,sockets=1,cores=4,threads=1 \
-device pcie-root-port,id=root.1,slot=1 \
-device pcie-root-port,id=root.2,slot=2 \
-drive file=/home/rhel7.7.qcow2,format=qcow2,if=none,id=drive-virtio-blk0,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-blk0,id=virtio-blk0,bus=root.1 \
-vnc :2 \
-monitor stdio \
-netdev tap,id=hostnet0 \
-device e1000e,netdev=hostnet0,id=net0,mac=fa:5e:07:b4:08:01,bus=root.2 \