[libvirt] [PATCH v2 00/20] Fix regression caused by recent CPU driver changes

Jiri Denemark posted 20 patches 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1496824604.git.jdenemar@redhat.com
docs/formatsnapshot.html.in       |   6 +
docs/schemas/domainsnapshot.rng   |   7 +
po/POTFILES.in                    |   1 +
src/Makefile.am                   |   1 +
src/bhyve/bhyve_domain.c          |   2 +-
src/conf/cpu_conf.c               | 192 ++++++++--------
src/conf/cpu_conf.h               |  12 +-
src/conf/domain_conf.c            |  30 ++-
src/conf/domain_conf.h            |   7 +-
src/conf/snapshot_conf.c          |  40 +++-
src/conf/snapshot_conf.h          |   3 +
src/conf/virsavecookie.c          | 144 ++++++++++++
src/conf/virsavecookie.h          |  62 +++++
src/cpu/cpu.c                     |   5 +-
src/esx/esx_driver.c              |   2 +-
src/libvirt_private.syms          |  10 +
src/libxl/libxl_conf.c            |   2 +-
src/lxc/lxc_conf.c                |   2 +-
src/openvz/openvz_driver.c        |   2 +-
src/phyp/phyp_driver.c            |   2 +-
src/qemu/qemu_capabilities.c      |   2 +-
src/qemu/qemu_conf.c              |   3 +-
src/qemu/qemu_domain.c            | 207 +++++++++++++++--
src/qemu/qemu_domain.h            |  22 ++
src/qemu/qemu_driver.c            | 468 ++++++++++++++++++++++++++------------
src/qemu/qemu_migration.c         |  18 +-
src/qemu/qemu_migration_cookie.c  |  31 ++-
src/qemu/qemu_migration_cookie.h  |   5 +
src/qemu/qemu_process.c           |  37 ++-
src/qemu/qemu_process.h           |   2 +
src/security/virt-aa-helper.c     |   2 +-
src/test/test_driver.c            |   3 +-
src/uml/uml_driver.c              |   2 +-
src/vbox/vbox_common.c            |   6 +-
src/vmware/vmware_driver.c        |   3 +-
src/vmx/vmx.c                     |   2 +-
src/vz/vz_driver.c                |   3 +-
src/xen/xen_driver.c              |   2 +-
src/xenapi/xenapi_driver.c        |   2 +-
tests/bhyveargv2xmltest.c         |   2 +-
tests/cputest.c                   |   5 +-
tests/domainsnapshotxml2xmltest.c |   1 +
tests/testutils.c                 |   2 +-
43 files changed, 1047 insertions(+), 315 deletions(-)
create mode 100644 src/conf/virsavecookie.c
create mode 100644 src/conf/virsavecookie.h
[libvirt] [PATCH v2 00/20] Fix regression caused by recent CPU driver changes
Posted by Jiri Denemark 6 years, 10 months ago
https://bugzilla.redhat.com/show_bug.cgi?id=1441662

when I was enhancing libvirt's guest CPU configuration code to be able
to really ensure stable guest CPU ABI, I added a new attribute
//cpu/@check which is nicely backward compatible... an old libvirt will
just ignore it. However, even if check='full' will be ignored, an old
libvirt will still see the updated CPU definition (features added or
removed by the hypervisor will be shown there). And because we need QEMU
2.9.0 to check what features are going to be added or removed before we
actually start the domain, migrating such domain to an older libvirt or
QEMU may fail if QEMU enables a feature which is not supported by the
host CPU. Known features causing problems are, e.g., x2apic, hypervisor,
and arat. To make things even worse, updating a CPU definition with the
automatically added/removed features can be done since QEMU 1.5.0.

Even save/restore or snapshot revert on a single host running new
libvirt and QEMU < 2.9.0 is now affected by this regression.

This series fixes the regression by storing the original guest CPU
definition in migratable XML and sending the updated CPU in a side
channel (a migration or save cookie).

Version 2:
- see individual patches for changes

Jiri Denemark (20):
  conf: Make error reporting in virCPUDefIsEqual optional
  conf: Refactor virCPUDefParseXML
  conf: Make virDomainSnapshotDefFormat easier to read
  conf: Pass xmlopt to virDomainSnapshotDefFormat
  qemu: Rename xml_len in virQEMUSaveHeader as data_len
  qemu: Fix memory leaks in qemuDomainSaveImageOpen
  qemu: Introduce virQEMUSaveData{New,Free}
  qemu: Introduce virQEMUSaveDataFinish
  qemu: Refactor qemuDomainSaveHeader
  qemu: Introduce virQEMUSaveData structure
  conf: Introduce virSaveCookie
  conf: Add save cookie callbacks to xmlopt
  qemu: Implement virSaveCookie object and callbacks
  qemu: Store save cookie in save images and snapshots
  qemu: Remember CPU def from domain start
  qemu: Report the original CPU in migratable xml
  qemu: Always send persistent XML during migration
  qemu: Send updated CPU in migration cookie
  qemu: Store updated CPU in save cookie
  qemu: Use updated CPU when starting QEMU if possible

 docs/formatsnapshot.html.in       |   6 +
 docs/schemas/domainsnapshot.rng   |   7 +
 po/POTFILES.in                    |   1 +
 src/Makefile.am                   |   1 +
 src/bhyve/bhyve_domain.c          |   2 +-
 src/conf/cpu_conf.c               | 192 ++++++++--------
 src/conf/cpu_conf.h               |  12 +-
 src/conf/domain_conf.c            |  30 ++-
 src/conf/domain_conf.h            |   7 +-
 src/conf/snapshot_conf.c          |  40 +++-
 src/conf/snapshot_conf.h          |   3 +
 src/conf/virsavecookie.c          | 144 ++++++++++++
 src/conf/virsavecookie.h          |  62 +++++
 src/cpu/cpu.c                     |   5 +-
 src/esx/esx_driver.c              |   2 +-
 src/libvirt_private.syms          |  10 +
 src/libxl/libxl_conf.c            |   2 +-
 src/lxc/lxc_conf.c                |   2 +-
 src/openvz/openvz_driver.c        |   2 +-
 src/phyp/phyp_driver.c            |   2 +-
 src/qemu/qemu_capabilities.c      |   2 +-
 src/qemu/qemu_conf.c              |   3 +-
 src/qemu/qemu_domain.c            | 207 +++++++++++++++--
 src/qemu/qemu_domain.h            |  22 ++
 src/qemu/qemu_driver.c            | 468 ++++++++++++++++++++++++++------------
 src/qemu/qemu_migration.c         |  18 +-
 src/qemu/qemu_migration_cookie.c  |  31 ++-
 src/qemu/qemu_migration_cookie.h  |   5 +
 src/qemu/qemu_process.c           |  37 ++-
 src/qemu/qemu_process.h           |   2 +
 src/security/virt-aa-helper.c     |   2 +-
 src/test/test_driver.c            |   3 +-
 src/uml/uml_driver.c              |   2 +-
 src/vbox/vbox_common.c            |   6 +-
 src/vmware/vmware_driver.c        |   3 +-
 src/vmx/vmx.c                     |   2 +-
 src/vz/vz_driver.c                |   3 +-
 src/xen/xen_driver.c              |   2 +-
 src/xenapi/xenapi_driver.c        |   2 +-
 tests/bhyveargv2xmltest.c         |   2 +-
 tests/cputest.c                   |   5 +-
 tests/domainsnapshotxml2xmltest.c |   1 +
 tests/testutils.c                 |   2 +-
 43 files changed, 1047 insertions(+), 315 deletions(-)
 create mode 100644 src/conf/virsavecookie.c
 create mode 100644 src/conf/virsavecookie.h

-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list