Bug 589859

Summary: The NIC card hot plugged to guest is in the incorrect VLAN
Product: Red Hat Enterprise Linux 6 Reporter: Qunfang Zhang <qzhang>
Component: qemu-kvmAssignee: Michael S. Tsirkin <mst>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: amit.shah, armbru, gyue, khong, lihuang, llim, michen, ndai, tburke, virt-maint
Target Milestone: rcFlags: mst: needinfo+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-09 05:00:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 599460    
Bug Blocks:    

Description Qunfang Zhang 2010-05-07 06:21:21 UTC
Description of problem:
Hot plug a NIC card to a guest,using vlan=1, but issue "info network" in qemu monitor, it tells me the NIC card is in VLAN 0 devices instead of VLAN1.And also
the macaddr and nic model are wrong.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.48.el6.x86_64
kernel-2.6.32-23.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Boot a guest with one NIC card.
/usr/libexec/qemu-kvm -m 2G -smp 2 -rtc-td-hack -usbdevice tablet -no-kvm-pit-reinjection -drive file=RHEL-Server-5.5-64.qcow2,media=disk,if=ide,cache=off,werror=stop,rerror=stop -net nic,vlan=0,macaddr=00:1a:4e:9f:0b:6a,model=rtl8139 -net tap,vlan=0,ifname=rtl8139_1,script=/etc/qemu-ifup -monitor stdio -boot c -cpu qemu64,+sse2 -uuid df01eb05-59fc-4e4a-8998-e935a78d4556 -startdate now -balloon none -name rhel5.5 -vnc :10

2.(qemu)info network
VLAN 0 devices:
  tap.0: ifname=rtl8139_1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  rtl8139.0: model=rtl8139,macaddr=00:1a:4e:9f:0b:6a
Devices not on any VLAN:

3.#modprobe acpiphp (inside guest)

4.(qemu)pci_add pci_addr=auto nic vlan=1,macaddr=00:1a:4e:9f:0b:6b,model=rtl8139

5.(qemu)pci_add pci_addr=auto nic vlan=2,macaddr=00:1a:4e:9f:0b:6c,model=e1000

6.(qemu)info network
VLAN 0 devices:
  tap.0: ifname=rtl8139_1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  rtl8139.0: model=rtl8139,macaddr=00:1a:4e:9f:0b:6a
  rtl8139.1: model=rtl8139,macaddr=00:1a:4e:9f:0b:6a
  rtl8139.2: model=rtl8139,macaddr=00:1a:4e:9f:0b:6a
Devices not on any VLAN:
  
Actual results:
As step 6

Expected results:
The two NIC cards I hot plug should be in the VLAN 1 and VLAN 2 with the correct macaddr and nic model(rtl8139 and e1000)


Additional info:

Comment 2 RHEL Program Management 2010-05-07 07:56:07 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Qunfang Zhang 2010-05-10 06:49:10 UTC
And also after hot plug another or more NIC, they have same macaddr,nic model, so the guest has more same IP addresses.

Comment 4 Markus Armbruster 2010-06-07 15:48:57 UTC
Does the problem exist with device_add instead of pci_add as well?  To test,
try something like "-device rtl8139,vlan=1,macaddr=00:1a:4e:9f:0b:6b".

Comment 5 Markus Armbruster 2010-06-07 15:56:20 UTC
Something like "device_add..." of course.

Comment 6 Amit Shah 2010-06-09 05:00:25 UTC

*** This bug has been marked as a duplicate of bug 599460 ***