Bug 1278404 - error "unsupported migration cookie feature memory-hotplug" is reported despite migration working
error "unsupported migration cookie feature memory-hotplug" is reported despi...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
Unspecified Unspecified
high Severity low
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
: ZStream
Depends On:
Blocks: 1172230 1280419
  Show dependency treegraph
 
Reported: 2015-11-05 07:04 EST by Peter Krempa
Modified: 2016-11-03 14:29 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: Improperly logged error message when migrating with memory hotplug enabled. Consequence: When migrating with memory hotplug enabled the destination host logged a spurious message saying "unsupported migration cookie feature memory-hotplug". This didn't break migration but in cases where the migration would fail for some other reason this would sidetrack from the real cause of the failure. Fix: The error message is suppressed by correctly parsing the migration cookie flags. Result:
Story Points: ---
Clone Of:
: 1280419 (view as bug list)
Environment:
Last Closed: 2016-11-03 14:29:54 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 Peter Krempa 2015-11-05 07:04:24 EST
Description of problem:
Libvirt errorneously reports "unsupported migration cookie feature memory-hotplug" even when destination host actually supports it.

Version-Release number of selected component (if applicable):
Upstream 1.2.18, downstream 1.2.17-3.el7

How reproducible:
100%

Steps to Reproduce:
1. Migrate a guest with <maxMemory> set.
2. Look at destination log files.
3.

Actual results:
Migration succeeds, but bogus error is reported in the log file.
Comment 1 Peter Krempa 2015-11-05 07:09:54 EST
In the migration cookie parser code, there are two checks :

    for (i = 0; i < n; i++) {
        int val;
        char *str = virXMLPropString(nodes[i], "name");
        if (!str) {
            virReportError(VIR_ERR_INTERNAL_ERROR,
                           "%s", _("missing feature name"));
            goto error;
        }

        if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) {
            virReportError(VIR_ERR_INTERNAL_ERROR,
                           _("Unknown migration cookie feature %s"),
                           str);
            VIR_FREE(str);

This one produces the error message and rejects the migration in legitimate purposes in case where destination does not support it. (Prior to upstream commit 136f3de4112c75af0b38fc1946f44e3658ed1890).

            goto error;

This branch also correctly aborts the migration.
        }


What I missed while writing and testing the commit mentioned above is the following check:
        if ((flags & (1 << val)) == 0) {
            virReportError(VIR_ERR_INTERNAL_ERROR,
                           _("Unsupported migration cookie feature %s"),

Since the commit mentioned above didn't add the correct flag to 'flags' at the point where it's called, this error message get's always printed once the memory hotplug flag is parsed ...

                           str);
            VIR_FREE(str);

... but due to a missing 'goto error;' it's not actually rejected, but the error is logged.

        }
        VIR_FREE(str);
    }
Comment 3 Peter Krempa 2015-11-06 08:47:27 EST
Upstream fix:

commit f59808b724f99d43d042600455f55428a88a1ad9
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Nov 5 15:20:21 2015 +0100

    qemu: migration: Properly parse memory hotplug migration flag
    
    Since the flag was not enabled when 'eating' the migration cookie,
    libvirt reported a bogus error when memory hotplug was enabled:
    
     unsupported migration cookie feature memory-hotplug
    
    The error was ignored though due to a bug in the code so it slipped
    through testing.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1278404
Comment 4 zhe peng 2015-11-09 01:30:23 EST
I can reproduce this with build libvirt-1.2.17-3.el7.x86_64
Comment 8 Fangge Jin 2016-08-17 06:00:56 EDT
I can reproduce on build libvirt-1.2.17-13.el7.x86_64

Verify pass on build libvirt-2.0.0-5.el7.x86_64

Steps:
1. Prepare a guest with maxmemory setting:
# virsh dumpxml rhel7
...
  <maxMemory slots='16' unit='KiB'>1524288</maxMemory>
...
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>IvyBridge</model>
    <numa>
      <cell id='0' cpus='0-1' memory='512000' unit='KiB'/>
      <cell id='1' cpus='2-3' memory='512000' unit='KiB'/>
...

2. Start guest
3. Do migrate
4. Check libvirtd log on target, there is no such log:
internal error: Unsupported migration cookie feature memory-hotplug
Comment 10 errata-xmlrpc 2016-11-03 14:29:54 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://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.