Bug 1130390 - 'server' type interface with no listen address fails
Summary: 'server' type interface with no listen address fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 7.2
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-15 06:09 UTC by hongming
Modified: 2015-12-25 04:56 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:47:35 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description hongming 2014-08-15 06:09:04 UTC
Description of problem:
Failed to start domain with a tcp type interface , the following error 
occurs
# virsh start rhel6.5
error: Failed to start domain rhel6.5
error: internal error Process exited while reading console log output: char device redirected to /dev/pts/4
2014-08-15T05:59:17.348271Z qemu-kvm: -netdev socket,listen=(null):5558,id=hostnet0: Device 'socket' could not be initialized

http://libvirt.org/formatdomain.html#elementsNICSTCP

Version-Release number of selected component (if applicable):
kernel-2.6.32-486.el6.x86_64
libvirt-0.10.2-43.el6.x86_64
qemu-kvm-0.12.1.2-2.427.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
# virsh dumpxml rhel6.5
<domain type='kvm'>
   <name>rhel6.5</name>
  .......
   <devices>
     <emulator>/usr/libexec/qemu-kvm</emulator>
     <disk type='file' device='disk'>
       <driver name='qemu' type='qcow2' cache='none'/>
       <source file='/var/lib/libvirt/images/kvm-rhel6.5-x86_64-qcow2.img'/>
       <target dev='hda' bus='ide'/>
       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
     </disk>
     <controller type='usb' index='0' model='ich9-ehci1'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x7'/>
     </controller>
     <controller type='usb' index='0' model='ich9-uhci1'>
       <master startport='0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0' multifunction='on'/>
     </controller>
     <controller type='usb' index='0' model='ich9-uhci2'>
       <master startport='2'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x1'/>
     </controller>
     <controller type='usb' index='0' model='ich9-uhci3'>
       <master startport='4'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x2'/>
     </controller>
     <controller type='ide' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x1'/>
     </controller>
    <interface type='server'>  <===== Config a tcp type interface
      <source port='5558'/>
     </interface>
     <serial type='pty'>
       <target port='0'/>
     </serial>
     <console type='pty'>
       <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes'/>
     <sound model='ich6'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
     </sound>
     <video>
       <model type='cirrus' vram='9216' heads='1'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
     </video>
     <memballoon model='virtio'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x0'/>
     </memballoon>
   </devices>
</domain>

# virsh start rhel6.5
error: Failed to start domain rhel6.5
error: internal error Process exited while reading console log output: char device redirected to /dev/pts/4
2014-08-15T05:59:17.348271Z qemu-kvm: -netdev socket,listen=(null):5558,id=hostnet0: Device 'socket' could not be initialized


Actual results:
Failed to start domain with a tcp type interface 

Expected results:
Successfully start the domain 

Additional info:
It works fine in rhel7.From the qemu-kvm manual , it should be supported in rhel6.

man qemu-kvm
......
       -net socket[,vlan=n][,name=name][,fd=h][,listen=[host]:port][,connect=host:port]
           Connect the VLAN n to a remote VLAN in another QEMU virtual machine using a TCP socket connection. If listen is specified, QEMU waits for incoming
           connections on port (host is optional). connect is used to connect to another QEMU instance using the listen option. fd=h specifies an already opened
           TCP socket.

           Example:

                   # launch a first QEMU instance
                   qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
                   -net socket,listen=:1234
                   # connect the VLAN 0 of this instance to the VLAN 0
                   # of the first instance
                   qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
                   -net socket,connect=127.0.0.1:1234

Comment 2 Ján Tomko 2014-08-15 08:22:02 UTC
The interface is missing a source address. It fails the same way on RHEL-7 for me.
For client interface, we error out if the address is not present.

I've sent a patch extending the check to server interfaces upstream:
https://www.redhat.com/archives/libvir-list/2014-August/msg00687.html

Comment 3 hongming 2014-08-15 08:56:12 UTC
Hi Jan

If specify the tcp server address in domain xml , it is still failed to start the guest. I file another bug to track it. 
Bug 1130441 - Failed to start domain with a 'server' type interface

Comment 4 Ján Tomko 2015-01-20 13:00:05 UTC
There is no point in fixing this in RHEL-6 if bug 1130441 is not fixed, moving to RHEL-7.

Comment 5 Ján Tomko 2015-01-20 14:11:19 UTC
Upstream patch:
https://www.redhat.com/archives/libvir-list/2015-January/msg00688.html

Comment 6 Ján Tomko 2015-01-21 12:25:41 UTC
commit 280ece4af95727eac49baaa48eb1a2fc36fad4ff
Author:     Ján Tomko <jtomko@redhat.com>
AuthorDate: 2015-01-20 13:34:10 +0100
Commit:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2015-01-21 13:22:36 +0100

    qemu: format server interface without a listen address
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1130390
    
    The listen address is not mandatory for <interface type='server'>
    but when it's not specified, we've been formatting it as:
    -netdev socket,listen=(null):5558,id=hostnet0
    which failed with:
    Device 'socket' could not be initialized
    
    Omit the address completely and only format the port in the listen
    attribute.
    
    Also fix the schema to allow specifying a model.

git describe: v1.2.12-rc1-2-g280ece4

Comment 7 Hu Jianwei 2015-04-10 09:05:18 UTC
Verified as below:

[root@localhost ~]# rpm -q libvirt
libvirt-1.2.14-1.el7.x86_64

[root@localhost ~]# virsh dumpxml r7a | grep "/interface" -B6
    </controller>
    <interface type='server'>
      <mac address='52:54:00:e0:42:72'/>
      <source port='5558'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# virsh start r7a
Domain r7a started

[root@localhost ~]# ps aux | grep r7a| sed "s/-device/\n-device/g"| grep 5558
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1,bootindex=1 -netdev socket,listen=:5558,id=hostnet0 

Moved to Verified.

Comment 9 errata-xmlrpc 2015-11-19 05:47:35 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.

https://rhn.redhat.com/errata/RHBA-2015-2202.html


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