Bug 998865

Summary: Add vlan parameter in device_add command would cause device_add qemu_new_net_client: Assertion `!peer'
Product: Red Hat Enterprise Linux 6 Reporter: xhan
Component: qemu-kvmAssignee: Vlad Yasevich <vyasevic>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: bsarathy, jasowang, juzhang, michen, mkenneth, mst, qiguo, qzhang, rbalakri, rhod, virt-maint, vyasevic
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.425.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 06:50:24 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 xhan 2013-08-20 09:17:45 UTC
Description of problem:

Add vlan parameter in device_add would cause device_add qemu_new_net_client: Assertion `!peer'


Version-Release number of selected component (if applicable):

kernel-2.6.32-412.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.394.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start vm 
 /usr/libexec/qemu-kvm \
    -name 'virt-tests-vm1' \
    -nodefaults \
    -monitor stdio \
    -qmp tcp::1234,server,nowait \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=0x4 \
    -drive file='win2012-64-virtio.raw',index=0,if=none,id=drive-ide0-0-0,media=disk,cache=none,snapshot=off,format=raw,aio=native \
    -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0 \
    -device virtio-net-pci,netdev=idV0PucV,mac='9a:33:34:35:36:37',bus=pci.0,addr=0x3,ioeventfd=on,__com_redhat_macvtap_compat=on,vectors=9,indirect_desc=off,event_idx=off,csum=on,guest_csum=on,gso=off,guest_tso4=on,guest_tso6=on,id='idZ53wjE' \
    -netdev tap,id=idV0PucV,vhost=on,script="scripts/qemu-ifup-switch" \
    -m 4096 \
    -smp 2,maxcpus=2,cores=1,threads=1,sockets=2 \
    -cpu 'Opteron_G3' \
    -M rhel6.5.0 \
    -drive file='winutils.iso',index=1,if=none,id=drive-ide0-0-1,media=cdrom,format=raw \
    -device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1 \
    -device AC97,addr=0x5 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
    -vnc :0 \
    -vga std \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -enable-kvm

2. add netdev (via monitor)
   netdev_add tap,id=vlan_net_01,script=
   
3. add device with vlan parameter(via monitor)
  (qemu) device_add rtl8139,netdev=vlan_net_01,id=nic_vlan_test01,vlan=1


Actual results:
qemu-kvm: /builddir/build/BUILD/qemu-kvm-0.12.1.2/net.c:249: qemu_new_net_client: Assertion `!peer' failed.

Expected results:
qemu-kvm would not quit abnormally with assertion

Additional info:

Comment 4 xhan 2013-08-22 03:12:14 UTC
For RHEL6.5, Bug 999745 - remove vlan option for all virtual nics
RHEL7.0 Bug 999746 - remove vlan option for all virtual nics

Comment 6 Miroslav Rezanina 2014-04-29 06:02:17 UTC
Fix included in qemu-kvm-0.12.1.2-2.425.el6

Comment 8 Qian Guo 2014-06-18 06:30:18 UTC
Reproduced this bug by 
qemu-kvm-0.12.1.2-2.398.el6.x86_64

Steps:
1.Boot up guest with property 'vlan' to the virtual nic:
]# /usr/libexec/qemu-kvm -cpu Penryn -m 4G -smp 4,sockets=1,cores=4,threads=1 -machine type=pc,dump-guest-core=off -enable-kvm  -device piix3-usb-uhci,id=usb -name rhel6 -nodefaults -nodefconfig  -device virtio-balloon-pci,id=balloon0  -spice port=5930,disable-ticketing -vga qxl -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0   -monitor stdio     -drive file=/home/rhel6.5/rhel6u5base.qcow2,if=none,media=disk,format=qcow2,rerror=stop,werror=stop,aio=native,id=scsi-disk0 -device virtio-scsi-pci,id=bus2 -device scsi-hd,bus=bus2.0,drive=scsi-disk0,id=disk0 -netdev tap,id=netdev0,script=/etc/qemu-ifup -device e1000,netdev=netdev0,vlan=1,id=vn1,mac=52:54:00:b5:d5:e3

Result:
Qemu coredumpd:
qemu-kvm: /builddir/build/BUILD/qemu-kvm-0.12.1.2/net.c:249: qemu_new_net_client: Assertion `!peer' failed.
Aborted (core dumped)


So according to above, this bug is reproduced.

Comment 9 Qian Guo 2014-06-18 06:33:04 UTC
Try to verify this bug by qemu-kvm-0.12.1.2-2.428.el6.x86_64
Steps:
1.Try to boot guest with vlan option in the virtual nic:
# /usr/libexec/qemu-kvm -cpu Penryn -m 4G -smp 4,sockets=1,cores=4,threads=1 -machine type=pc,dump-guest-core=off -enable-kvm  -device piix3-usb-uhci,id=usb -name rhel6 -nodefaults -nodefconfig  -device virtio-balloon-pci,id=balloon0  -spice port=5930,disable-ticketing -vga qxl -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0   -monitor stdio     -drive file=/home/rhel6.5/rhel6u5base.qcow2,if=none,media=disk,format=qcow2,rerror=stop,werror=stop,aio=native,id=scsi-disk0 -device virtio-scsi-pci,id=bus2 -device scsi-hd,bus=bus2.0,drive=scsi-disk0,id=disk0 -netdev tap,id=netdev0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=netdev0,vlan=1,id=vn1,mac=52:54:00:b5:d5:e3 

Result:

qemu-kvm: -device virtio-net-pci,netdev=netdev0,vlan=1,id=vn1,mac=52:54:00:b5:d5:e3: Property 'virtio-net-pci.vlan' doesn't take value '1'
/etc/qemu-ifdown: could not launch network script

Hi, Vlad

No abort(coredumpd) occurs, but can not take the vlan value, is this expected, and how to make virtual nic take the value?

Thanks,

Comment 11 Vlad Yasevich 2014-06-18 11:18:46 UTC
(In reply to Qian Guo from comment #9)
> Try to verify this bug by qemu-kvm-0.12.1.2-2.428.el6.x86_64
> Steps:
> 1.Try to boot guest with vlan option in the virtual nic:
> # /usr/libexec/qemu-kvm -cpu Penryn -m 4G -smp 4,sockets=1,cores=4,threads=1
> -machine type=pc,dump-guest-core=off -enable-kvm  -device
> piix3-usb-uhci,id=usb -name rhel6 -nodefaults -nodefconfig  -device
> virtio-balloon-pci,id=balloon0  -spice port=5930,disable-ticketing -vga qxl
> -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0   -monitor stdio
> -drive
> file=/home/rhel6.5/rhel6u5base.qcow2,if=none,media=disk,format=qcow2,
> rerror=stop,werror=stop,aio=native,id=scsi-disk0 -device
> virtio-scsi-pci,id=bus2 -device scsi-hd,bus=bus2.0,drive=scsi-disk0,id=disk0
> -netdev tap,id=netdev0,script=/etc/qemu-ifup -device
> virtio-net-pci,netdev=netdev0,vlan=1,id=vn1,mac=52:54:00:b5:d5:e3 
> 
> Result:
> 
> qemu-kvm: -device
> virtio-net-pci,netdev=netdev0,vlan=1,id=vn1,mac=52:54:00:b5:d5:e3: Property
> 'virtio-net-pci.vlan' doesn't take value '1'
> /etc/qemu-ifdown: could not launch network script
> 
> Hi, Vlad
> 
> No abort(coredumpd) occurs, but can not take the vlan value, is this
> expected,

Yes.  It is invalid to use both netdev and vlan parameters.

> and how to make virtual nic take the value?

Use one or the other parameters, not both.  Using both is invalid

-vlad
> 
> Thanks,

Comment 12 Qian Guo 2014-06-19 02:29:55 UTC
Test comment 11 with both fix and unfix build:

Step, boot guest with virto-net-pci device and vlan options:
]# /usr/libexec/qemu-kvm -cpu Penryn -m 4G -smp 4,sockets=1,cores=4,threads=1 -machine type=pc,dump-guest-core=off -enable-kvm  -device piix3-usb-uhci,id=usb -name rhel6 -nodefaults -nodefconfig  -device virtio-balloon-pci,id=balloon0  -spice port=5930,disable-ticketing -vga qxl -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0   -monitor stdio     -drive file=/home/rhel6.5/rhel6u5base.qcow2,if=none,media=disk,format=qcow2,rerror=stop,werror=stop,aio=native,id=scsi-disk0 -device virtio-scsi-pci,id=bus2 -device scsi-hd,bus=bus2.0,drive=scsi-disk0,id=disk0  -device virtio-net-pci,vlan=1,id=vn1,mac=52:54:00:b5:d5:e3 
Warning: vlan 1 is not connected to host network
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) 
(qemu) 


So reporter hit this bug just when boot with wrong options (according to comment 11 , reporter boot with netdev and vlan options together.)

And this bug can be verified according to comment 8 and comment 9

Hi, Vlad

Could we verify this bug according to above?

Thanks,

Comment 13 Vlad Yasevich 2014-06-19 13:08:47 UTC
(In reply to Qian Guo from comment #12)
> Test comment 11 with both fix and unfix build:
> 
> Step, boot guest with virto-net-pci device and vlan options:
> ]# /usr/libexec/qemu-kvm -cpu Penryn -m 4G -smp
> 4,sockets=1,cores=4,threads=1 -machine type=pc,dump-guest-core=off
> -enable-kvm  -device piix3-usb-uhci,id=usb -name rhel6 -nodefaults
> -nodefconfig  -device virtio-balloon-pci,id=balloon0  -spice
> port=5930,disable-ticketing -vga qxl -global PIIX4_PM.disable_s3=0 -global
> PIIX4_PM.disable_s4=0   -monitor stdio     -drive
> file=/home/rhel6.5/rhel6u5base.qcow2,if=none,media=disk,format=qcow2,
> rerror=stop,werror=stop,aio=native,id=scsi-disk0 -device
> virtio-scsi-pci,id=bus2 -device scsi-hd,bus=bus2.0,drive=scsi-disk0,id=disk0
> -device virtio-net-pci,vlan=1,id=vn1,mac=52:54:00:b5:d5:e3 
> Warning: vlan 1 is not connected to host network
> QEMU 0.12.1 monitor - type 'help' for more information
> (qemu) 
> (qemu) 
> 
> 
> So reporter hit this bug just when boot with wrong options (according to
> comment 11 , reporter boot with netdev and vlan options together.)

Right.  The problem really was that there was no indication that using vlan and netdev together was invalid.

> 
> And this bug can be verified according to comment 8 and comment 9
> 
> Hi, Vlad
> 
> Could we verify this bug according to above?
> 

I believe so.  Instead of an assert(), there is now an error reported.

-vlad
> Thanks,

Comment 14 Qian Guo 2014-06-20 02:43:12 UTC
According to comment 8 and comment 9 comment 12 comment 13 , this bug can be verified.

Comment 16 errata-xmlrpc 2014-10-14 06:50:24 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-2014-1490.html