Bug 1379200

Summary: ABI check error message is wrong when serial controller model does not match
Product: Red Hat Enterprise Linux 7 Reporter: zhe peng <zpeng>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Jing Qi <jinqi>
Severity: low Docs Contact:
Priority: medium    
Version: 7.3CC: dyuan, rbalakri, xuzhang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-3.1.0-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 17:16:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description zhe peng 2016-09-26 02:58:11 UTC
Description of problem:
ABI check get wrong error message when restore guest with modified xml

How producible
100%

Build:
libvirt-2.0.0-9.el7.x86_64

Steps:
1. start a guest
#virsh dumpxml rhel7
....
  <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target type='isa-serial' port='1'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='1'/>
      <alias name='serial0'/>
    </console>
....

#virsh dumpxml rhel7 > rhel7.xml

#virsh save rhel7 r7.save

modified xml
#vi rhel7.xml
...
<serial type='pty'>
      <target type='isa-serial' port='1'/>
    </serial>
...
change to:
...
    <serial type='pty'>
      <target type='pci-serial' port='1'/>
    </serial>
...

restore guest with xml
# virsh restore r7.save --xml rhel7.xml
error: Failed to restore domain from r7.save
error: unsupported configuration: Target controller type pci does not match source virtio-serial

Actual result
error: unsupported configuration: Target controller type pci does not match source virtio-serial

Expected result
error: unsupported configuration:Target serial type pci-serial does not match source isa-serial

Comment 2 Michal Privoznik 2017-03-03 09:56:12 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2017-March/msg00109.html

Comment 3 Michal Privoznik 2017-03-08 09:32:35 UTC
Pushed upstream:

commit b3388de7f26e6e62a3cf67a12481fdfbf16fc5e4
Author:     Michal Privoznik <mprivozn>
AuthorDate: Fri Mar 3 10:45:31 2017 +0100
Commit:     Michal Privoznik <mprivozn>
CommitDate: Wed Mar 8 10:09:15 2017 +0100

    qemuDomainSaveImageUpdateDef: Don't overwrite errors from virDomainDefCheckABIStability
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1379200
    
    When we are restoring a domain from a saved image, or just
    updating its XML in the saved image - we have to make sure that
    the ABI guests sees will not change. We have a function for that
    which reports errors. But for some reason if this function fails,
    we call it again with slightly different argument. Therefore it
    might happen that we overwrite the original error and leave user
    with less helpful one.
    
    Signed-off-by: Michal Privoznik <mprivozn>

v3.1.0-81-gb3388de7f

Comment 6 Jing Qi 2017-03-13 05:27:17 UTC
Verified the issue with label libvirt-3.1.0-2.el7.x86_64 and the result is as below.

# virsh restore /tmp/rhel7.save  --xml rhel7.xml
error: Failed to restore domain from /tmp/rhel7.save
error: unsupported configuration: Target serial type pci-serial does not match source isa-serial

Comment 7 errata-xmlrpc 2017-08-01 17:16:43 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-2017:1846

Comment 8 errata-xmlrpc 2017-08-01 23:57:38 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-2017:1846