Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1118707 - VMstate static checker: backport -dump-vmstate feature to export json-encoded vmstate info
VMstate static checker: backport -dump-vmstate feature to export json-encoded...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Amit Shah
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-11 05:46 EDT by Amit Shah
Modified: 2015-03-05 03:10 EST (History)
9 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-67.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 03:10:45 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0349 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2015-03-05 07:27:34 EST

  None (edit)
Description Amit Shah 2014-07-11 05:46:54 EDT
Description of problem:

The static checker is merged usptream; backport it for 7.1.

This will be useful to get vmstate json output and check for migration compatibility between various versions of qemu.

Syntax is:

qemu-kvm -dump-vmstate -M <machine type> -dump-vmstate <filename>


Later, from the qemu sources,

./scripts/vmstate-static-checker.py -s src.json -d dest.json

will output any migration-breaking changes introduced in dest.json as compared with src.json.
Comment 2 Amit Shah 2014-07-11 05:51:06 EDT
More info on invocation from upstream commit messages:

For qemu:

    migration: dump vmstate info as a json file for static analysis
    
    This commit adds a new command, '-dump-vmstate', that takes a filename
    as an argument.  When executed, QEMU will dump the vmstate information
    for the machine type it's invoked with to the file, and quit.
    
    The JSON-format output can then be used to compare the vmstate info for
    different QEMU versions, specifically to test whether live migration
    would break due to changes in the vmstate data.
    
    A Python script that compares the output of such JSON dumps is included
    in the following commit.

and the script:

    vmstate-static-checker: script to validate vmstate changes
    
    This script compares the vmstate dumps in JSON format as output by QEMU
    with the -dump-vmstate option.
    
    It flags various errors, like version mismatch, sections going away,
    size mismatches, etc.
    
    This script is tolerant of a few changes that do not change the on-wire
    format, like embedding a few fields within substructs.
    
    The script takes -s/--src and -d/--dest parameters, to which filenames
    are given as arguments.
    
    Example:
    
    (in a qemu 2.0 tree):
    ./x86_64-softmmu/qemu-system-x86_64 -dump-vmstate qemu-2.0.json
    
    (in a qemu 2.2 tree:)
    ./x86_64-softmmu/qemu-system-x86_64 -dump-vmstate -M pc-i440fx-2.0 \
       qemu-2.2-m2.0.json
    
    ./scripts/vmstate-static-checker.py -s qemu-2.0.json -d qemu-2.2-m2.0.json
    
    The script also takes a --reverse parameter to switch the src and dest
    jsons.  This is just a shorthand for reversing the src and dest.
    
    The --help parameter shows usage information.
Comment 4 Jeff Nelson 2014-08-08 12:54:52 EDT
Fix included in qemu-kvm-1.5.3-67.el7
Comment 6 Shaolong Hu 2014-10-13 05:17:35 EDT
Verified on qemu-kvm-rhev-2.1.2-3.el7.x86_64:


# /usr/libexec/qemu-kvm -M pc-q35-rhel7.1.0 -dump-vmstate pc-q35-rhel7.1.0

# cat pc-q35-rhel7.1.0 | head -n 20
{
  "vmschkmachine": {
    "Name": "pc-q35-rhel7.1.0"
  },
  "usb-host": {
    "Name": "usb-host",
    "version_id": 1,
    "minimum_version_id": 1,
    "Description": {
      "name": "usb-host",
      "version_id": 1,
      "minimum_version_id": 1,
      "Fields": [
        {
          "field": "parent_obj",
          "version_id": 0,
          "field_exists": false,
          "size": 5808,
          "Description": {
            "name": "USBDevice",
...


Verified on qemu-kvm-1.5.3-75.el7.x86_64:

# /usr/libexec/qemu-kvm -M pc-q35-rhel7.0.0 -dump-vmstate pc-q35-rhel7.0.0

# cat pc-q35-rhel7.0.0 | head -n 20
{
  "vmschkmachine": {
    "Name": "pc-q35-rhel7.0.0"
  },
  "port92": {
    "Name": "port92",
    "version_id": 1,
    "minimum_version_id": 1,
    "Description": {
      "name": "port92",
      "version_id": 1,
      "minimum_version_id": 1,
      "Fields": [
        {
          "field": "outport",
          "version_id": 0,
          "field_exists": false,
          "size": 1
        }
      ]
Comment 8 errata-xmlrpc 2015-03-05 03:10:45 EST
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-2015-0349.html

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