Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 852965

Summary: set_link can not change rtl8139 network card's status
Product: Red Hat Enterprise Linux 6 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Amos Kong <akong>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: acathrow, ailan, areis, bsarathy, chayang, dyasny, flang, juzhang, mazhang, michen, mkenneth, qzhang, rhod, shu, sluo, virt-maint, wdai
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.326.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:39:17 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:
Attachments:
Description Flags
Patch to add link status for rtl8139 none

Description FuXiangChun 2012-08-30 06:15:50 UTC
Description of problem:
set rtl8139 netowrk off status in qemu monitor, but it is still "up"status and network is not available in guest.BTW,whatever vhost is disable or enable, I will get the same result. 

notes:
set_link command works well with virtio and e1000 adapter.  


Version-Release number of selected component (if applicable):
# uname -r
2.6.32

# qemu-kvm -version
QEMU PC emulator version 0.12.1

How reproducible:
100%

Steps to Reproduce:
1.boot guest with rtl8139
# qemu-kvm -M rhel6.3.0 -cpu Opteron_G3 -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1,maxcpus=6 -usb -device usb-tablet,id=input0 -name virt-nic -uuid 9ed5a909-5c33-4bc0-960c-29ecfc61a502 -drive file=rhel6.4-virt-nic-1.qcow2,format=qcow2,if=none,id=drive-disk,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-disk,id=virtio_image,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup,vhost=off -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:24:21:7F:91:AB,bus=pci.0,addr=0x4,indirect_desc=off,event_idx=off,status=off -vnc :1 -bios /usr/share/seabios/bios-pm.bin -device sga -chardev socket,id=serial0,path=/var/test1,server,nowait -device isa-serial,chardev=serial0 -boot menu=on -monitor stdio -qmp tcp:0:4444,server,nowait -netdev tap,id=hostnet1,script=/etc/qemu-ifup,vhost=on -netdev tap,id=hostnet2,script=/etc/qemu-ifup,vhost=on -device rtl8139,netdev=hostnet2,id=virtio-net-pci2,mac=00:24:21:7F:93:AB

2.info network
(qemu) info network 
Devices not on any VLAN:
  hostnet0: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci0
  hostnet1: ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  hostnet2: ifname=tap2,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci2
  virtio-net-pci0: model=virtio-net-pci,macaddr=00:24:21:7f:91:ab peer=hostnet0
  virtio-net-pci2: model=rtl8139,macaddr=00:24:21:7f:93:ab peer=hostnet2

3.check rtl8139 status in guest
#cat /sys/class/net/eth6/operstate 
up

4.change rtl8139 status in monitor
(qemu) set_link virtio-net-pci2 off

5.re-check rtl8139 status in guest
#cat /sys/class/net/eth6/operstate 

Actual results:
#cat /sys/class/net/eth6/operstate 
up

Expected results:
#cat /sys/class/net/eth6/operstate 
down

Additional info:

Comment 2 FuXiangChun 2012-08-30 07:30:05 UTC
additional info:
qemu-kvm-0.12.1.2-2.295.el6.x86_64 and qemu-kvm-0.12.1.2-2.307.el6.x86_64 have the issue.

Comment 4 jason wang 2012-09-07 10:03:07 UTC
Created attachment 610677 [details]
Patch to add link status for rtl8139

Comment 6 Amos Kong 2012-09-07 11:19:14 UTC
(In reply to comment #4)
> Created attachment 610677 [details]
> Patch to add link status for rtl8139

This patch doesn't work with windows guest, I would drive into rtl8139cp specific.
http://realtek.info/pdf/rtl8139cp.pdf

Comment 7 Amos Kong 2012-09-10 08:00:29 UTC
(In reply to comment #6)
> (In reply to comment #4)
> > Created attachment 610677 [details]
> > Patch to add link status for rtl8139
> 
> This patch doesn't work with windows guest, I would drive into rtl8139cp
> specific. http://realtek.info/pdf/rtl8139cp.pdf

After updated the Media Status Register, it works with Windows guest.
Posted patch to upstream: http://patchwork.ozlabs.org/patch/182816/

Comment 8 Amos Kong 2012-09-28 05:09:26 UTC
Link status could not be migrated, I will also fix this problem in this patchset.

Comment 12 mazhang 2012-11-08 08:14:10 UTC
Reproduced bug on qemu-kvm-0.12.1.2-2.325.el6.x86_64.rpm&2.6.32-335.el6.x86_64.

host :
(qemu) info network 
Devices not on any VLAN:
  hostnet0: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci0
  hostnet1: ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  hostnet2: ifname=tap2,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci2
  virtio-net-pci0: model=virtio-net-pci,macaddr=00:24:21:7f:91:ab peer=hostnet0
  virtio-net-pci2: model=rtl8139,macaddr=00:24:21:7f:93:ab peer=hostnet2
(qemu) [Thread 0x7ffff005f700 (LWP 6717) exited]
set
set_link      set_password  
(qemu) set_link virtio-net-pci2 off
guest :
#cat /sys/class/net/eth6/operstate 
up

Additional info:
/usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Nehalem -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1,maxcpus=6 -usb -device usb-tablet,id=input0 -name virt-nic -uuid 9ed5a909-5c33-4bc0-960c-29ecfc61a502 -drive file=/root/image/rhel6u4.qcow2,format=qcow2,if=none,id=drive-disk,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-disk,id=virtio_image,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup,vhost=off -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:24:21:7F:91:AB,bus=pci.0,addr=0x4,indirect_desc=off,event_idx=off,status=off -vnc :0 -chardev socket,id=serial0,path=/var/test1,server,nowait -device isa-serial,chardev=serial0 -boot menu=on -monitor stdio -qmp tcp:0:4444,server,nowait -netdev tap,id=hostnet1,script=/etc/qemu-ifup,vhost=on -netdev tap,id=hostnet2,script=/etc/qemu-ifup,vhost=on -device rtl8139,netdev=hostnet2,id=virtio-net-pci2,mac=00:24:21:7F:93:AB

Comment 13 mazhang 2012-11-08 08:22:52 UTC
Verified this bug on qemu-kvm-0.12.1.2-2.334.el6.x86_64.rpm&2.6.32-335.el6.x86_64.

Steps:
1 boot guest with rtl8139
/usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Nehalem -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1,maxcpus=6 -usb -device usb-tablet,id=input0 -name virt-nic -uuid 9ed5a909-5c33-4bc0-960c-29ecfc61a502 -drive file=/root/image/rhel6u4.qcow2,format=qcow2,if=none,id=drive-disk,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-disk,id=virtio_image,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup,vhost=off -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:24:21:7F:91:AB,bus=pci.0,addr=0x4,indirect_desc=off,event_idx=off,status=off -vnc :0 -chardev socket,id=serial0,path=/var/test1,server,nowait -device isa-serial,chardev=serial0 -boot menu=on -monitor stdio -qmp tcp:0:4444,server,nowait -netdev tap,id=hostnet1,script=/etc/qemu-ifup,vhost=on -netdev tap,id=hostnet2,script=/etc/qemu-ifup,vhost=on -device rtl8139,netdev=hostnet2,id=virtio-net-pci2,mac=00:24:21:7F:93:AB

2 info network
Devices not on any VLAN:
  hostnet0: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci0
  hostnet1: ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  hostnet2: ifname=tap2,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci2
  virtio-net-pci0: model=virtio-net-pci,macaddr=00:24:21:7f:91:ab peer=hostnet0
  virtio-net-pci2: model=rtl8139,macaddr=00:24:21:7f:93:ab peer=hostnet2

3 check rtl8139 status in guest
#cat /sys/class/net/eth6/operstate 
up

4 change rtl8139 status in monitor
(qemu) set_link virtio-net-pci2 off 

5 re-check rtl8139 status in guest
#cat /sys/class/net/eth6/operstate 
down

So this bug was fixed.

Comment 15 errata-xmlrpc 2013-02-21 07:39:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0527.html