Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1512934 - Incorrect device used for <serial> with type usb-serial or pci-serial on pSeries
Summary: Incorrect device used for <serial> with type usb-serial or pci-serial on pSeries
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: ppc64le
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Andrea Bolognani
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-14 13:23 UTC by Andrea Bolognani
Modified: 2018-04-10 11:01 UTC (History)
7 users (show)

Fixed In Version: libvirt-3.9.0-4.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 11:00:58 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0704 None None None 2018-04-10 11:01:32 UTC

Description Andrea Bolognani 2017-11-14 13:23:14 UTC
If a USB serial console is added to a pSeries guest with

  <serial type='pty'>
    <target type='usb-serial'/>
  </serial>

the missing attributes will be filled in by libvirt, resulting in

  <serial type='pty'>
    <target type='usb-serial' port='0'/>
    <address type='spapr-vio' reg='0x30000000'/>
  </serial>

which, in addition to not making any sense due to the mismatch in
device type and address type, will result in a spapr-vty device
being added to the QEMU command line instead of usb-serial. The
same happens for pci-serial.

libvirt should use the expected device instead, or error out if
the device is not compiled in the QEMU binary.

Comment 2 Andrea Bolognani 2017-11-15 11:54:00 UTC
Patches posted upstream.

  https://www.redhat.com/archives/libvir-list/2017-November/thread.html

Comment 3 Andrea Bolognani 2017-11-15 11:55:03 UTC
Wrong link :/

  https://www.redhat.com/archives/libvir-list/2017-November/msg00545.html

Comment 4 Andrea Bolognani 2017-11-28 15:27:16 UTC
Fixed upstream.

commit b342e94399eee7fd519234a12ca3ea04f6564154
Author: Andrea Bolognani <abologna@redhat.com>
Date:   Fri Nov 10 17:57:53 2017 +0100

    qemu: Support usb-serial and pci-serial on pSeries
    
    The existing implementation set the address type for all serial
    devices to spapr-vio, which made it impossible to use other devices
    such as usb-serial and pci-serial; moreover, some decisions were
    made based on the address type rather than the device type.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1512934
    
    Signed-off-by: Andrea Bolognani <abologna@redhat.com>
    Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

v3.9.0-260-gb342e9439

Comment 7 Junxiang Li 2017-12-05 02:54:51 UTC
Env:
# rpm -q libvirt kernel qemu-kvm-rhev
libvirt-3.9.0-4.virtcov.el7.ppc64le
kernel-3.10.0-799.el7.ppc64le
qemu-kvm-rhev-2.10.0-10.el7.ppc64le

Add the following xml in guest:
<serial type='pty'>
    <target type='usb-serial'/>
</serial>

After define:
<serial type='pty'>
    <target type='usb-serial' port='0'>
        <model name='usb-serial'/>
    </target>
    <address type='usb' bus='0' port='3'/>
</serial>

When start:
error: Failed to start domain vm1
error: unsupported configuration: 'usb-serial' is not supported in this QEMU binary

BTW, the attribute 'model' is not generated before, so it is expected or a mistake?

Comment 8 Andrea Bolognani 2017-12-05 09:24:59 UTC
(In reply to junli from comment #7)
> Env:
> # rpm -q libvirt kernel qemu-kvm-rhev
> libvirt-3.9.0-4.virtcov.el7.ppc64le
> kernel-3.10.0-799.el7.ppc64le
> qemu-kvm-rhev-2.10.0-10.el7.ppc64le
> 
> Add the following xml in guest:
> <serial type='pty'>
>     <target type='usb-serial'/>
> </serial>
> 
> After define:
> <serial type='pty'>
>     <target type='usb-serial' port='0'>
>         <model name='usb-serial'/>
>     </target>
>     <address type='usb' bus='0' port='3'/>
> </serial>
> 
> When start:
> error: Failed to start domain vm1
> error: unsupported configuration: 'usb-serial' is not supported in this QEMU
> binary

Failure to start the guest when using either usb-serial or pci-serial
is expected, as we don't enable either device in RHEL. The bug has
been fixed, though, otherwise QEMU would complain about isa-serial
being unavailable.

> BTW, the attribute 'model' is not generated before, so it is expected or a
> mistake?

It's expected.

Comment 9 Junxiang Li 2017-12-06 08:40:30 UTC
1. prepare a guest vm:

<domain type='kvm' id='4'>
  <name>vm1</name>
  <uuid>3dcc6321-216a-4353-bb9b-75d1317d2bac</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='ppc64le' machine='pseries-rhel7.5.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/avocado/data/avocado-vt/images/jeos-25-64-clone.qcow2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:1f:6b:8a'/>
      <source bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </interface>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-4-vm1/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='keyboard' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='usb'>
      <alias name='input1'/>
      <address type='usb' bus='0' port='2'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='vga' vram='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
    <panic model='pseries'/>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c158,c597</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c158,c597</imagelabel>
  </seclabel>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>
2. Add the serial into the guest:

<serial type='pty'>
    <target type='usb-serial'/>
</serial>
***********************************
Reproduced on 
libvirt-3.9.0-3.virtcov.el7.ppc64le
kernel-3.10.0-799.el7.ppc64le
qemu-kvm-rhev-2.10.0-10.el7.ppc64le

3.1 Run "virsh create"
Domain vm1 created from vm1.xml
3.2 Run "virsh dumpxml"
<serial type='pty'>
  <source path='/dev/pts/2'/>
  <target type='usb-serial' port='0'/>
  <alias name='serial0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</serial>

4.1 Run "virsh define"
Domain vm1 defined from vm1.xml
4.2 Run "virsh dumpxml"
<serial type='pty'>
  <target type='usb-serial' port='0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</serial>
4.3 Run "virsh start"
error: Failed to start domain vm1
error: unsupported configuration: usb-serial requires address of usb type
***********************************

Verified on 
libvirt-3.9.0-4.virtcov.el7.ppc64le
kernel-3.10.0-799.el7.ppc64le
qemu-kvm-rhev-2.10.0-10.el7.ppc64le

3.1 Run "virsh create"
error: Failed to create domain from vm1.xml
error: unsupported configuration: 'usb-serial' is not supported in this QEMU binary

4.1 Define the guest and run "virsh dumpxml"
<serial type='pty'>
    <target type='usb-serial' port='0'>
        <model name='usb-serial'/>
    </target>
    <address type='usb' bus='0' port='3'/>
</serial>
4.2 Run "virsh start"
error: Failed to start domain vm1
error: unsupported configuration: 'usb-serial' is not supported in this QEMU binary

It works as expected.

Comment 13 errata-xmlrpc 2018-04-10 11:00:58 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://access.redhat.com/errata/RHEA-2018:0704


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