Bug 1460952 - Migration with 'migratable xml' fails due to CPU check
Migration with 'migratable xml' fails due to CPU check
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Jiri Denemark
yalzhang@redhat.com
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-13 04:50 EDT by Jingjing Shao
Modified: 2017-08-01 21:34 EDT (History)
8 users (show)

See Also:
Fixed In Version: libvirt-3.2.0-10.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 21:34:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jingjing Shao 2017-06-13 04:50:34 EDT
Description of problem:
Migration with 'migratable xml' fails due to  CPU check 

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

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest 
# virsh dumpxml V | grep cpu -A4
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='forbid'>Westmere</model>
  </cpu>

2. # virsh start V
Domain V started

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 8     V                              running


3. Get the migratable xml
# virsh dumpxml --migratable  V > V.xml

Check migratable xml
...
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='forbid'>Westmere</model>
  </cpu>
...

4. Check the dumpxml of guest V
# virsh dumpxml V | grep cpu -A8
 <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>Westmere</model>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='pclmuldq'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='arat'/>
  </cpu>


5.#  virsh migrate V  qemu+ssh://xx.xx.xx.xx/system --verbose --xml V.xml
error: unsupported configuration: Target CPU feature count 0 does not match source 5


Actual results:
There are difference from the migratable xml and dumpxml of gust, so the migration with migratable xml fa llcd hey oj和有iled

Expected results:
The migration should succeed.

Additional info:
On the libvirt-2.0.0-10.el7_3.9.x86_64, the migration with migratable xml succeed
Comment 3 Jingjing Shao 2017-06-13 04:57:36 EDT
Sorry for the mistake on the actual results, it should be as below: 
There are difference from the migratable xml and dumpxml of gust, so the migration with migratable xml failed
Comment 4 Jiri Denemark 2017-06-13 06:49:02 EDT
The difference between the two XML is correct and expected. But somehow libvirt doesn't use the right migratable XML internally to compare it with the XML provided by the user.
Comment 5 Jiri Denemark 2017-06-14 10:19:12 EDT
Patches sent upstream for review: https://www.redhat.com/archives/libvir-list/2017-June/msg00610.html
Comment 6 Jiri Denemark 2017-06-14 11:22:14 EDT
This is now fixed upstream by

commit 0810d4f5e0d77354cdf7ad56e1e8b7748bdb1501
Refs: v3.4.0-108-g0810d4f5e
Author:     Jiri Denemark <jdenemar@redhat.com>
AuthorDate: Wed Jun 14 13:42:16 2017 +0200
Commit:     Jiri Denemark <jdenemar@redhat.com>
CommitDate: Wed Jun 14 17:04:12 2017 +0200

    qemu: Introduce qemuDomainDefFromXML helper

    The main goal of this function is to enable reusing the parsing code
    from qemuDomainDefCopy.

    Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
    Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

commit a0912df3faac8b58725f45b8cf928990999585a3
Refs: v3.4.0-109-ga0912df3f
Author:     Jiri Denemark <jdenemar@redhat.com>
AuthorDate: Wed Jun 14 13:43:12 2017 +0200
Commit:     Jiri Denemark <jdenemar@redhat.com>
CommitDate: Wed Jun 14 17:04:32 2017 +0200

    qemu: Add qemuDomainMigratableDefCheckABIStability

    This patch separates the actual ABI checks from getting migratable defs
    in qemuDomainDefCheckABIStability so that we can create another wrapper
    which will use different methods to get the migratable defs.

    Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
    Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

commit 063b2b8788db204d0ac2e1d367fd0c5eb9b81451
Refs: v3.4.0-110-g063b2b878
Author:     Jiri Denemark <jdenemar@redhat.com>
AuthorDate: Wed Jun 14 13:43:37 2017 +0200
Commit:     Jiri Denemark <jdenemar@redhat.com>
CommitDate: Wed Jun 14 17:08:16 2017 +0200

    qemu: Add qemuDomainCheckABIStability

    When making ABI stability checks for an active domain, we need to make
    sure we use the same migratable definition which virDomainGetXMLDesc
    with the MIGRATABLE flag provides, otherwise the ABI check will fail.
    This is implemented in the new qemuDomainCheckABIStability which takes a
    domain object and generates the right migratable definition from it.

    Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
    Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

commit f0a3fe1b0a2996272dd167501bb5de752d9d1956
Refs: v3.4.0-111-gf0a3fe1b0
Author:     Jiri Denemark <jdenemar@redhat.com>
AuthorDate: Wed Jun 14 14:56:21 2017 +0200
Commit:     Jiri Denemark <jdenemar@redhat.com>
CommitDate: Wed Jun 14 17:13:24 2017 +0200

    qemu: Use qemuDomainCheckABIStability where needed

    Most places which want to check ABI stability for an active domain need
    to call this API rather than the original
    qemuDomainDefCheckABIStability. The only exception is in snapshots where
    we need to decide what to do depending on the saved image data.

    https://bugzilla.redhat.com/show_bug.cgi?id=1460952

    Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
    Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Comment 9 yalzhang@redhat.com 2017-06-18 02:31:00 EDT
Reproduce this bug on libvirt-3.2.0-9.el7.x86_64, and test on libvirt-3.2.0-10.el7.x86_64, the result is as expected, set this bug to be verified.

1. prepare the guest:

 # virsh dumpxml rhel7.4 | grep /cpu -B2
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='forbid'>Westmere</model>
  </cpu>

2. migrate succeed with the migratable xml.

# virsh start rhel7.4
Domain rhel7.4 started

# virsh dumpxml rhel7.4 --migratable > rhel7.4.xml

# virsh migrate rhel7.4 --live qemu+ssh://server74/system --verbose --xml rhel7.4.xml
root@server74's password: 
Migration: [100 %]
Comment 10 errata-xmlrpc 2017-08-01 21:34:35 EDT
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

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