Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 617085 - core dumped when add netdev to VM with vhost on
core dumped when add netdev to VM with vhost on
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
All Linux
medium Severity high
: rc
: ---
Assigned To: Jes Sorensen
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-22 03:18 EDT by Shirley Zhou
Modified: 2015-03-04 19:51 EST (History)
9 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.104.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 16:26:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
coredump-analyze (12.17 KB, text/plain)
2010-07-22 03:19 EDT, Shirley Zhou
no flags Details

  None (edit)
Description Shirley Zhou 2010-07-22 03:18:12 EDT
Description of problem:
core dumped when add netdev with vhost on for window guest

Version-Release number of selected component (if applicable):
virtio-win-1.1.8-0
kernel-2.6.32-44.1.el6.x86_64
qemu-kvm-0.12.1.2-2.96.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.Run windows guest with cli:
/usr/libexec/qemu-kvm -m 2G -smp 2 -cpu qemu64,+x2apic -usbdevice tablet -drive file=/home/win08R2.raw,if=none,id=drive-virtio0,boot=on,werror=stop,rerror=stop,cache=none,format=raw -device virtio-blk-pci,drive=drive-virtio0,id=virtio-blk-pci0 -netdev tap,id=hostnet0,script=/etc/qemu-ifup,vhost=on,ifname=virtio_nic_1 -device virtio-net-pci,netdev=hostnet0,mac=02:00:78:3F:20:1f,bus=pci.0 -netdev tap,id=hostnet1,script=/etc/qemu-ifup,ifname=e1000_1_1 -device e1000,netdev=hostnet1,mac=01:00:78:3F:20:1f,bus=pci.0,id=e1000-1 -uuid 1234127c-8765-4e67-95da-8dd0a8891cc4 -name winxp -qmp tcp:0:4445,server,nowait -boot c -monitor stdio -spice port=5930,disable-ticketing -vga qxl
2.Install virtio network driver from http://download.lab.bos.redhat.com/devel/RHEV/virtio-win/1.1.8-0/
3.do netdev hot add 
from qmp :
{ "execute": "netdev_add", "arguments":{"type":"tap","id":"hostnet2","script":"/etc/qemu-ifup","vhost":"on","ifname":"virtio_nic_plug"}}
or from monitor:
 netdev_add tap,id=hostnet3,script=/etc/qemu-ifup,vhost=on,ifname=virtio_nic_3

Actual results:
Core dumped and qemu aborted after step3,please see attached core dump analyze file.

Expected results:
netdev should be added.

Additional info:

This issue does not exist when not using vhost.
{ "execute": "netdev_add", "arguments":{"type":"tap","id":"hostnet2","script":"/etc/qemu-ifup","ifname":"virtio_nic_plug"}}
Comment 1 Shirley Zhou 2010-07-22 03:19:43 EDT
Created attachment 433613 [details]
coredump-analyze
Comment 3 RHEL Product and Program Management 2010-07-22 03:37:54 EDT
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **
Comment 4 Amos Kong 2010-07-22 06:31:39 EDT
I can reproduce this bug when adding netdev to linux guests.

qemu) netdev_add tap,id=hostnet1,script=/etc/qemu-ifup-switch,vhost=on,ifname=virtio_nic_1
qemu-kvm: /builddir/build/BUILD/qemu-kvm-0.12.1.2/hw/vhost.c:122: vhost_dev_unassign_memory: Assertion `to >= 0' failed


Change subject to 'core dumped when add netdev to VM with vhost on'
Comment 5 Dor Laor 2010-07-22 16:57:38 EDT
What happens when vhost-off?
Comment 6 Jes Sorensen 2010-07-22 17:22:01 EDT
Not sure if this is related, but in the backtrace it has
vhost_client_set_memory() calling vhost_dev_unassign_memory(). However
the code does this:

    vhost_dev_unassign_memory(dev, start_addr, size);
    if (flags == IO_MEM_RAM) {
        /* Add given mapping, merging adjacent regions if any */
        vhost_dev_assign_memory(dev, start_addr, size,
                                (uintptr_t)qemu_get_ram_ptr(phys_offset));
    } else {
        /* Remove old mapping for this memory, if any. */
        vhost_dev_unassign_memory(dev, start_addr, size);
    }

Ie. if flags != IO_MEM_RAM, we end up calling vhost_dev_unassign_memory()
twice with the exact same arguments..... Could it be the first call
to vhost_dev_unassign_memory() shouldn't be there?

Jes
Comment 7 Shirley Zhou 2010-07-22 21:50:21 EDT
(In reply to comment #5)
> What happens when vhost-off?    
When use vhost=off or without vhost parameter, netdev can be added successfully.
Comment 8 Jes Sorensen 2010-07-23 09:15:52 EDT
I can reproduce this, but I don't see it with upstream qemu or qemu-kvm.
Comment 9 Jes Sorensen 2010-07-23 09:56:05 EDT
Ok, spoke too fast, it happens with upstream qemu-kvm too, there is just a
delay from entering the command until it crashes.
Comment 13 Shirley Zhou 2010-07-28 06:15:11 EDT
Verify this bug on RHEL6 and win7 guest with qemu-kvm-0.12.1.2-2.104.el6, this bug does not exist when add netdev with vhost on.

Change status to verified.
Comment 14 releng-rhel@redhat.com 2010-11-10 16:26:47 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.