RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1273686 - libvirt do not check the if the serial type is changed during migrate/save
Summary: libvirt do not check the if the serial type is changed during migrate/save
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-21 02:39 UTC by Luyao Huang
Modified: 2016-11-03 18:28 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:28:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Luyao Huang 2015-10-21 02:39:30 UTC
Description of problem:
libvirt do not check the if the serial type is changed during migrate/save, if we change them will cause migrate or save/restore failed, and as we know libvirt have function like *CheckABIStability to avoid this

Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare a running guest use isa-serial

# virsh dumpxml rhel7.0-rhel 
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target type='isa-serial' port='1'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='1'/>
      <alias name='serial0'/>
    </console>


2. save this guest to a file:

# virsh save rhel7.0-rhel r7.save

Domain rhel7.0-rhel saved to r7.save

3. edit the save file:

    <serial type='pty'>
      <target type='isa-serial' port='1'/>
    </serial>

change to:

    <serial type='pty'>
      <target type='pci-serial' port='1'/>
    </serial>


# virsh save-image-edit r7.save
State file r7.save edited.

# virsh save-image-dumpxml r7.save |grep serial
    <controller type='virtio-serial' index='0'>
    <serial type='pty'>
      <target type='pci-serial' port='1'/>
    </serial>
      <target type='serial' port='1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>

4. restore the guest:

# virsh restore r7.save
error: Failed to restore domain from r7.save
error: internal error: early end of file from monitor: possible problem:
2015-10-21T02:33:18.134054Z qemu-kvm: Unknown savevm section or instance 'serial' 0
2015-10-21T02:33:18.134166Z qemu-kvm: load of migration failed: Invalid argument


Actual results:

libvirt not check if he serial type is changed during migrate/save

Expected results:

this will cause qemu cannot restore with new save file

Additional info:


test with other chr device:

change 
    <console type='pty'>
      <target type='serial' port='1'/>
    </console>
to
    <console type='pty'>
      <target type='virtio' port='1'/>
    </console>

# virsh save-image-edit r7.save
error: unsupported configuration: Target console type virtio does not match source serial
Failed. Try again? [y,n,f,?]:

Comment 1 Luyao Huang 2015-10-21 09:26:15 UTC
Send a patch to upstream:

https://www.redhat.com/archives/libvir-list/2015-October/msg00667.html

Comment 2 Peter Krempa 2015-10-27 12:22:38 UTC
commit a98145e7c9f023b0253e91dd41d3484b95e51bc4
Author: Luyao Huang <lhuang>
Date:   Wed Oct 21 15:14:03 2015 +0800

    conf: Add serial target type to ABI stability check
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1273686
    
    There is no ABI check for serial target type attribute, just
    add it.

v1.2.20-140-ga98145e

Comment 4 zhenfeng wang 2016-03-01 06:24:12 UTC
Verify this bug with libvirt-1.3.1-1.el7, steps as following 
1.prepare a running guest use isa-serial

# virsh dumpxml rhel74
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target type='isa-serial' port='1'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='1'/>
      <alias name='serial0'/>
    </console>

2.Dumpxml the guest's xml to local file
#virsh dumpxml rhel74 >rhel74.xml

3.Save the guest to a save file
#virsh save rhel74 7r.save

4.edit the save file:

    <serial type='pty'>
      <target type='isa-serial' port='1'/>
    </serial>

change to:

    <serial type='pty'>
      <target type='pci-serial' port='1'/>
    </serial>

will get the expect error
# virsh save-image-edit 7r.save
error: unsupported configuration:Target serial type pci-serial does not match source isa-serial
Failed. Try again? [y,n,f,?]:

5.edit the guest's xml
    <serial type='pty'>
      <target type='isa-serial' port='1'/>
    </serial>

change to:

    <serial type='pty'>
      <target type='pci-serial' port='1'/>
    </serial>

6.Restore guest with the modified xml, will get the expect error
# virsh restore 7r.save --xml rhel74.xml 
error: Failed to restore domain from 7r.save
error: unsupported configuration:Target serial type pci-serial does not match source isa-serial

7.Prepare a migration env, then migrate the guest with specify the upper modified xml, will get the following error
# virsh migrate --live rhel74  qemu+ssh://$dest_ip/system --verbose --xml rhel74.xml  --unsafe
root@$dest_ip's password: 
error: unsupported configuration: Target serial type pci-serial does not match source isa-serial

Comment 5 zhe peng 2016-04-13 05:54:43 UTC
Per comment 4 , move to verified.

Comment 7 errata-xmlrpc 2016-11-03 18:28:25 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/RHSA-2016-2577.html


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