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 611447 - qemu: vhost-net requested but could not be initialized
qemu: vhost-net requested but could not be initialized
Status: CLOSED DUPLICATE of bug 615118
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
All Linux
high Severity high
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-05 06:21 EDT by Alex Jia
Modified: 2013-01-09 17:49 EST (History)
15 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-09 22:02:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Can't fix selinux context in this case. (6.71 KB, text/plain)
2010-07-05 06:24 EDT, Alex Jia
no flags Details

  None (edit)
Description Alex Jia 2010-07-05 06:21:54 EDT
Description of problem:
Can't successfully install guest using virt-install when selinux enable, it can successfully install if disable selinux. 

Version-Release number of selected component (if applicable):
# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.32-37.el6.x86_64 #1 SMP Sun Jun 20 19:29:35 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
# rpm -q libvirt
libvirt-0.8.1-13.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.90.el6.x86_64
# rpm -q python-virtinst
python-virtinst-0.500.3-5.el6.noarch

How reproducible:
Always

Steps to Reproduce:
#virt-install --name=demo --ram=1024 --vcpus=1 --location=http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/Beta-2/Server/x86_64/os/ --disk path=/var/lib/libvirt/images/demo,size=4 --vnc

  
Actual results:
ERROR    internal error Process exited while reading console log output: char device redirected to /dev/pts/7
qemu-kvm: -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=26: vhost-net requested but could not be initialized
qemu-kvm: -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=26: Device 'tap' could not be initialized

Expected results:
Fix it.

Additional info:
Please see attachment.
Comment 1 Alex Jia 2010-07-05 06:24:37 EDT
Created attachment 429500 [details]
Can't fix selinux context in this case.
Comment 3 Dor Laor 2010-07-12 07:27:41 EDT
Michael & Daniel, can you sort out what component to blame?
Comment 4 Michael S. Tsirkin 2010-07-12 07:56:37 EDT
looks like a libvirt issue: it's passing us an invalid vhostfd.
it could be selinux related: there's a warning on that
above:

[Mon, 05 Jul 2010 18:18:28 virt-install 24880] DEBUG (VirtualDisk:1179) Can't fix selinux context in this case.
Comment 5 Daniel Berrange 2010-07-12 08:14:14 EDT
Is selinux enabled & enforcing ?
Comment 6 Alex Jia 2010-07-12 23:24:55 EDT
(In reply to comment #5)
> Is selinux enabled & enforcing ?    

Selinux is enforcing:

# getenforce
Enforcing
Comment 7 Amit Shah 2010-07-15 07:01:07 EDT
Re-assigning component acc. to comment 4
Comment 8 Laine Stump 2010-07-20 12:40:56 EDT
What problems does selinux report?

Can you run "setenforce Permissive", run the virt-install again, and send the output of:

    grep denied /var/log/audit/audit.log

(or even better, the "full error output" from all the alerts show in the SELinux Security Alerts tool).
Comment 9 Laine Stump 2010-07-20 13:08:48 EDT
Just for reference, I can't reproduce this problem using an identical commandline with the 20100719.n.0 snapshot (and selinux enforcing).
Comment 10 Alex Jia 2010-07-22 23:07:46 EDT
(In reply to comment #9)
> Just for reference, I can't reproduce this problem using an identical
> commandline with the 20100719.n.0 snapshot (and selinux enforcing).    

Laine,
Thanks, it may be my environment issue, only I met the bug, and I can't reproduce it with libvirt-0.8.1-18.el6.x86_64, so I will close the bug, if I meet it again I will reopen it.
Comment 11 Jeff Burke 2010-08-04 11:44:26 EDT
This issue is back. It was seen while testing the latest kernel 2.6.32-58.el6. 

dirname is: tmp.4003 
virt-install --name guest-80-138.rhts.eng.bos.redhat.com --mac 00:16:3E:50:8A:B3 --cdrom /var/lib/libvirt/images/guest-80-138.rhts.eng.bos.redhat.com.iso --ram=1024 --vcpus=2 --file-size=20 --hvm --debug --extra-args ks=http://lab2.rhts.eng.bos.redhat.com/cblr/svc/op/ks/system/guest-80-138.rhts.eng.bos.redhat.com --prompt --accelerate --os-variant=virtio26 --network bridge:br0   --noreboot --vnc                                                         spawn virt-install --name guest-80-138.rhts.eng.bos.redhat.com --mac 00:16:3E:50:8A:B3 --cdrom /var/lib/libvirt/images/guest-80-138.rhts.eng.bos.redhat.com.iso --ram=1024 --vcpus=2 --file-size=20 --hvm --debug --extra-args ks=http://lab2.rhts.eng.bos.redhat.com/cblr/svc/op/ks/system/guest-80-138.rhts.eng.bos.redhat.com --prompt --accelerate --os-variant=virtio26 --network bridge:br0   --noreboot --vnc                                                         
Wed, 04 Aug 2010 09:14:33 DEBUG    Launched with command line:
/usr/sbin/virt-install --name guest-80-138.rhts.eng.bos.redhat.com --mac 00:16:3E:50:8A:B3 --cdrom /var/lib/libvirt/images/guest-80-138.rhts.eng.bos.redhat.com.iso --ram=1024 --vcpus=2 --file-size=20 --hvm --debug --extra-args ks=http://lab2.rhts.eng.bos.redhat.com/cblr/svc/op/ks/system/guest-80-138.rhts.eng.bos.redhat.com --prompt --accelerate --os-variant=virtio26 --network bridge:br0   --noreboot --vnc                                                         
Wed, 04 Aug 2010 09:14:33 DEBUG    Requesting libvirt URI default
Wed, 04 Aug 2010 09:14:33 DEBUG    Received libvirt URI qemu:///system
Wed, 04 Aug 2010 09:14:33 DEBUG    Requesting virt method 'hvm', hv type 'default'.
Wed, 04 Aug 2010 09:14:33 DEBUG    Received virt method 'hvm'
Wed, 04 Aug 2010 09:14:33 DEBUG    Hypervisor name is 'kvm'
Please enter the path to the file you would like to use for storage. It will have size 20.0GB. /var/lib/libvirt/images/guest-80-138.rhts.eng.bos.redhat.com 
Wed, 04 Aug 2010 09:14:33 DEBUG    Setting os type to 'linux' for variant 'virtio26'
Wed, 04 Aug 2010 09:14:33 DEBUG    DistroInstaller location is a local file/path: /var/lib/libvirt/images/guest-80-138.rhts.eng.bos.redhat.com.iso
 

Starting install...

Creating storage file guest-80-138.rhts.eng.bos.redhat.c |  20 GB     00:00     
Wed, 04 Aug 2010 09:14:33 DEBUG    Generated install XML: 
<domain type='kvm'>
  <name>guest-80-138.rhts.eng.bos.redhat.com</name>
  <currentMemory>1048576</currentMemory>
  <memory>1048576</memory>
  <uuid>2c50f1bd-b19e-3157-d1d4-ab7683fe2e45</uuid>
  <os>
    <type arch='x86_64'>hvm</type>
    <boot dev='cdrom'/>
  </os>
  <features>
    <acpi/><apic/><pae/>
  </features>
  <clock offset="utc"/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>destroy</on_reboot>
  <on_crash>destroy</on_crash>
  <vcpu>2</vcpu>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/guest-80-138.rhts.eng.bos.redhat.com'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <source file='/var/lib/libvirt/images/guest-80-138.rhts.eng.bos.redhat.com.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='bridge'>
      <source bridge='br0'/>
      <mac address='00:16:3E:50:8A:B3'/>
      <model type='virtio'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' keymap='en-us'/>
    <console type='pty'/>
    <video>
      <model type='cirrus'/>
    </video>
  </devices>
</domain>

Wed, 04 Aug 2010 09:14:34 ERROR    internal error Process exited while reading console log output: char device redirected to /dev/pts/2
qemu-kvm: -netdev tap,fd=20,id=hostnet0,vhost=on,vhostfd=21: vhost-net requested but could not be initialized
qemu-kvm: -netdev tap,fd=20,id=hostnet0,vhost=on,vhostfd=21: Device 'tap' could not be initialized

Domain installation does not appear to have been
 successful.  If it was, you can restart your domain
 by running 'virsh start guest-80-138.rhts.eng.bos.redhat.com'; otherwise, please
 restart your installation.
Wed, 04 Aug 2010 09:14:34 ERROR    internal error Process exited while reading console log output: char device redirected to /dev/pts/2
qemu-kvm: -netdev tap,fd=20,id=hostnet0,vhost=on,vhostfd=21: vhost-net requested but could not be initialized
qemu-kvm: -netdev tap,fd=20,id=hostnet0,vhost=on,vhostfd=21: Device 'tap' could not be initialized
Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 1054, in <module>
    main()
  File "/usr/sbin/virt-install", line 936, in main
    start_time, guest.start_install)
  File "/usr/sbin/virt-install", line 978, in do_install
    dom = install_func(conscb, progresscb, wait=(not wait))
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 973, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1038, in _do_install
    "install")
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1009, in _create_guest
    dom = self.conn.createLinux(start_xml, 0)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1270, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/2
qemu-kvm: -netdev tap,fd=20,id=hostnet0,vhost=on,vhostfd=21: vhost-net requested but could not be initialized
qemu-kvm: -netdev tap,fd=20,id=hostnet0,vhost=on,vhostfd=21: Device 'tap' could not be initialized

A Libvirt error occurred during installation.
Comment 12 Martin Jenner 2010-08-04 12:04:53 EDT
Reproduced; this is a hard error with the 2.6.32-58.el6.x86_64 kernel prior kernels -54,56,57.el6 where tested and we do not hit the issue.

command line used for testing.
# virt-install --hvm --name vm1 --ram 1024 --vnc --cdrom http://download.lab.bos.redhat.com/redhat/rel-eng/RHEL6.0-20100730.5/6/Server/i386/os --disk path=/var/lib/libvirt/images/vm1,size=6,device=disk,bus=virtio --accelerate --os-variant=rhel6 --debug

seen on both Intel and AMD systems.
Comment 13 Chris Lalancette 2010-08-04 12:28:46 EDT
Looks like a possible culprit:

eae4695f6bfab836ccc207eaf3047656599d385f: [virt] vhost: create a vhost thread per device

A bisect would confirm.

Chris Lalancette
Comment 15 Laine Stump 2010-08-04 14:26:41 EDT
Michael - any ideas?
Comment 16 Laine Stump 2010-08-09 22:02:51 EDT
Bug 615118 was also re-opened because of this, and the fix is being tracked there, so I'm marking this as a duplicate.

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

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