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 1511421 - Incorrect <target type='isa-serial'/> for <serial> element of pSeries guests
Summary: Incorrect <target type='isa-serial'/> for <serial> element of pSeries guests
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: ppc64
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-09 10:18 UTC by Andrea Bolognani
Modified: 2018-04-10 11:01 UTC (History)
6 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-09 10:18:44 UTC
If a serial console is added to a pSeries guest with

  <console type='pty'>
    <target type='serial'/>
  </console>

the <serial> element auto-generated by libvirt will look like

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

While the serial console will work thanks to workarounds present
in the code, isa-serial is clearly the incorrect type (pSeries
guests don't have an ISA bus) and a more appropriate type should
be used instead.

Comment 2 Andrea Bolognani 2017-11-15 11:53:21 UTC
Patches posted upstream.

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

Comment 3 Andrea Bolognani 2017-11-15 11:54:53 UTC
Wrong link :/

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

Comment 4 Andrea Bolognani 2017-11-28 15:26:25 UTC
Fixed upstream.

commit c498a8921e447715189c8c6d22b7ca24cc810830
Author: Andrea Bolognani <abologna@redhat.com>
Date:   Wed Nov 8 15:31:21 2017 +0100

    conf: Add target type and model for spapr-vty
    
    We can finally introduce a specific target model for the spapr-vty
    device used by pSeries guests, which means isa-serial will no longer
    show up to confuse users.
    
    We make sure migration works in both directions by interpreting the
    isa-serial target type, or the lack of target type, appropriately
    when parsing the guest XML, and skipping the newly-introduced type
    when formatting if for migration. We also verify that spapr-vty is
    not used for non-pSeries guests and add a bunch of test cases.
    
    This commit is best viewed with 'git show -w'.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511421
    
    Signed-off-by: Andrea Bolognani <abologna@redhat.com>
    Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

v3.9.0-259-gc498a8921

Comment 7 Junxiang Li 2017-12-05 03:06:24 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

1. Add the following xml in guest:
  <console type='pty'>
    <target type='serial'/>
  </console>

2. After define:
    <serial type='pty'>
      <target type='spapr-vio-serial' port='0'>
        <model name='spapr-vty'/>
      </target>
      <address type='spapr-vio' reg='0x30000000'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
      <address type='spapr-vio' reg='0x30000000'/>
    </console>

3. Start successfully

Result: The target type change from 'isa-serial' to 'spapr-vio-serial'

Comment 8 Andrea Bolognani 2017-12-05 09:21:53 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
> 
> 1. Add the following xml in guest:
>   <console type='pty'>
>     <target type='serial'/>
>   </console>
> 
> 2. After define:
>     <serial type='pty'>
>       <target type='spapr-vio-serial' port='0'>
>         <model name='spapr-vty'/>
>       </target>
>       <address type='spapr-vio' reg='0x30000000'/>
>     </serial>
>     <console type='pty'>
>       <target type='serial' port='0'/>
>       <address type='spapr-vio' reg='0x30000000'/>
>     </console>
> 
> 3. Start successfully
> 
> Result: The target type change from 'isa-serial' to 'spapr-vio-serial'

You should also check that a guest which got the wrong target
type formatted in the past, eg.

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

gets parsed correctly and results in the same XML as above.

Comment 9 Junxiang Li 2017-12-06 08:58:14 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 console into the guest:

<console type='pty'>
  <target type='serial'/>
</console>
***********************************
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'>
  <target type='isa-serial' port='0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</serial>
<console type='pty'>
  <target type='serial' port='0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</console>

4.1 Run "virsh define"
Domain vm1 defined from vm1.xml
4.2 Run "virsh dumpxml"
<serial type='pty'>
  <target type='isa-serial' port='0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</serial>
<console type='pty'>
  <target type='serial' port='0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</console>
4.3 Run "virsh start"
Domain vm1 started
***********************************

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"
Domain vm1 created from vm1.xml
3.2 Run "virsh dumpxml"
<serial type='pty'>
  <target type='spapr-vio-serial' port='0'>
    <model name='spapr-vty'/>
  </target>
  <address type='spapr-vio' reg='0x30000000'/>
</serial>
<console type='pty'>
  <target type='serial' port='0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</console>

4.1 Run "virsh define"
Domain vm1 defined from vm1.xml
4.2 Run "virsh dumpxml"
<serial type='pty'>
  <target type='spapr-vio-serial' port='0'>
    <model name='spapr-vty'/>
  </target>
  <address type='spapr-vio' reg='0x30000000'/>
</serial>
<console type='pty'>
  <target type='serial' port='0'/>
  <address type='spapr-vio' reg='0x30000000'/>
</console>
4.3 Run "virsh start"
Domain vm1 started

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.