Wind River Support Network

HomeDefectsLIN7-1873
Fixed

LIN7-1873 : [KVM] Failed to start 'VM' by virsh command

Created: Nov 19, 2014    Updated: Sep 8, 2018
Resolved Date: Dec 26, 2014
Found In Version: 7.0
Fix Version: 7.0.0.1
Severity: Standard
Applicable for: Wind River Linux 7
Component/s: Userspace

Description

# virsh define /opt/wr-test/testcases/virtualization/kvm_macvtap_libvirt/kvm_macvtap_libvirt.xml
#
# virsh start vm1
error: Failed to start domain vm1
error: internal error: process exited while connecting to monitor: 2014-11-19T09:10:35.165587Z kvm: -netdev tap,ifname=tap0,script=/etc/qemu-ifup.tap,id=hostnet1,vhost=on,vhostfd=24: could not open /dev/net/tun: Operation not permitted
2014-11-19T09:10:35.165665Z kvm: -netdev tap,ifname=tap0,script=/etc/qemu-ifup.tap,id=hostnet1,vhost=on,vhostfd=24: Device 'tap' could not be initialized

root@128:/opt/wr-test/testcases/virtualization/kvm_macvtap_libvirt# cat /opt/wr-test/testcases/virtualization/kvm_macvtap_libvirt/kvm_macvtap_libvirt.xml
<domain type='kvm'>
  <name>vm1</name>
  <memory>1024000</memory>
  <currentMemory>512000</currentMemory>
  <vcpu>2</vcpu>
  <cpu>
      <arch>x86_64</arch>
      <model>Nehalem</model>
      <vendor>Intel</vendor>
  </cpu>
  <os>
    <type>hvm</type>
    <boot dev='hd' />
    <kernel>/boot/guest.kernel</kernel>
    <cmdline>console=ttyS0 root=/dev/vda rw ip=dhcp</cmdline>
  </os>
  <devices>
    <disk type='file' device='disk'>
      <source file='/boot/guest_raw.test' />
      <target dev='vda' bus='virtio'/>
    </disk>
    <serial type='file'>
      <source path='/opt/wr-test/testcases/virtualization/kvm_macvtap_libvirt/kvm_macvtap_libvirt-serial.log'/>
      <target port='0'/>
    </serial>
    <console type='file'>
      <source path='/opt/wr-test/testcases/virtualization/kvm_macvtap_libvirt/kvm_macvtap_libvirt-serial.log'/>
      <target type='serial' port='0'/>
    </console>
    <interface type='direct'>
        <mac address='de:ef:be:72:df:7d' />
        <source dev='eth0' mode='bridge' />
        <model type='virtio' />
      </interface>
    <interface type='ethernet'>
      <mac address='de:ef:be:df:34:7b'/>
      <target dev='tap0'/>
      <model type='virtio' />
      <script path='/etc/qemu-ifup.tap'/>
    </interface> 
  </devices>
</domain>

Workaround

https://www.redhat.com/archives/libvir-list/2014-November/msg01033.html

Steps to Reproduce

1. Build KVM host and guest images

[Host]

configure \
  --enable-board=intel-x86-64 \
  --enable-kernel=standard \
  --enable-rootfs=glibc_std \
  --with-template=feature/kvm \
  --enable-test=yes \
  --with-layer=wr-testing/virtualization \
  --enable-jobs=12 \
  --enable-parallel-pkgbuilds=12

make fs

[Guest]

configure \
  --enable-board=x86-64-kvm-guest \
  --enable-kernel=standard \
  --enable-rootfs=glibc_std \
  --enable-test=yes \
  --with-layer=wr-testing/virtualization \
  --enable-jobs=12 \
  --enable-parallel-pkgbuilds=12

make fs

2. Load images to the target (barcode:19790) and boot it up

3. Copy KVM guest OS images to the target

scp x86-64-kvm-guest-bzImage-WR7.0.0.0_standard root@128.224.167.28:/boot/guest.kernel 
scp x86-64-kvm-guest-glibc-std-standard-dist.ext3 root@128.224.167.28:/boot/guest_raw.img 

4. Start the test of "kvm_macvtap_libvirt".

root@128:/opt/wr-test/testcases/virtualization/kvm_macvtap_libvirt#./runtest.sh

Or run the commands in the "Description" section.


Other Downloads


Live chat
Online