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 617085 - core dumped when add netdev to VM with vhost on
Summary: core dumped when add netdev to VM with vhost on
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Jes Sorensen
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-22 07:18 UTC by Shirley Zhou
Modified: 2015-03-05 00:51 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.104.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 21:26:47 UTC
Target Upstream Version:
Embargoed:


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

Description Shirley Zhou 2010-07-22 07:18:12 UTC
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 07:19:43 UTC
Created attachment 433613 [details]
coredump-analyze

Comment 3 RHEL Program Management 2010-07-22 07:37:54 UTC
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 10:31:39 UTC
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 20:57:38 UTC
What happens when vhost-off?

Comment 6 Jes Sorensen 2010-07-22 21:22:01 UTC
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-23 01:50:21 UTC
(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 13:15:52 UTC
I can reproduce this, but I don't see it with upstream qemu or qemu-kvm.

Comment 9 Jes Sorensen 2010-07-23 13:56:05 UTC
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 10:15:11 UTC
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 21:26:47 UTC
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.