qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm
@ 2014-09-22 19:34 Alex Bligh
  2014-09-22 19:34 ` Alex Bligh
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Alex Bligh @ 2014-09-22 19:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Ryan Harper, Serge Hallyn, Michael S. Tsirkin, Libvirt,
	Serge Hallyn, Alexander Graf, Bruce Rogers, quintela@redhat.com,
	Alex Bligh, Cole Robinson, Amit Shah, Andreas Färber,
	Serge E. Hallyn

This patch series adds inbound migrate capability from qemu-kvm version
1.0. The main ideas are those set out in Cole Robinson's patch here:
http://pkgs.fedoraproject.org/cgit/qemu.git/tree/0001-Fix-migration-from-qemu-kvm.patch?h=f20
however, rather than patching statically (and breaking inbound
migration on existing machine types), I have added a new machine
parameter (qemu-kvm-migration) which when turned on affects the pc-1.0
machine type. Usage:
        -machine pc-1.0,qemu-kvm-migration=on

Three aproaches are taken:

* cirrus-vga.vgamem_mb defaults to 16 rather than 8. In	order to
  keep -global cirrus-vga.vgamem_mb working even with
  qemu-kvm-migration=on, this is monkey-patched	 into the default
  value			 of the MachineState structure's  compat_props list.

* In hw/timer/i8254_common.c, the VMSTATE_UINT32_TEST macro
  is used to test the version for the irq_disable flags,
  allowing version 3 or more, or version 2 for an inbound
  migrate from qemu-kvm (only).

* In hw/acpi/piix4.c, qemu-kvm incorrectly uses version 2 for
  a version 3 structure, causing acpi_load_old to be used.
  acpi_load_old detects this situation based on the machine type
  and restarts the attempt to load the vmstate using a
  customised VMStateDescription. The above cleaner approach is
  unavailable here.

The above monkey-patching must be done between the selection of
the MachineClass and the processing of the machine parameters
(on the		 one hand) and the processing of   the compat_props list
and the		 globals   on the command line. To do this	    I have added
an earlyinit function to MachineState and QEMUMachine.

I developed this on qemu 2.0 but have forward ported it (trivially)
to master. My testing has been on a VM live-migrated-to-file from
Ubuntu Precise qemu-kvm 1.0.

I have given this a moderate degree of testing but it could do
with more.

Note that certain hardware devices (including QXL) will not
migrate properly due to a fundamental difference in their internal
state between versions.

Also note that (as expected) migration from qemu-2.x to qemu-1.0
will not work, even if the machine types are the same.

Changes since v1:
* Do not use a machine type, use a machine parameter.

Alex Bligh (1):
  Add machine parameter qemu-kvm-migration for live migrate
    compatibility with qemu-kvm

 hw/acpi/piix4.c         |   47 +++++++++++++++++++++++++++++++++++++++++++++--
 hw/core/machine.c       |   16 ++++++++++++++++
 hw/i386/pc.c            |    1 +
 hw/i386/pc_piix.c       |   25 +++++++++++++++++++++++++
 hw/timer/i8254_common.c |   11 ++++++++++-
 include/hw/boards.h     |    7 +++++++
 vl.c                    |    7 +++++++
 7 files changed, 111 insertions(+), 3 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-10-05 13:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 19:34 [Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm Alex Bligh
2014-09-22 19:34 ` Alex Bligh
2014-09-28 15:30   ` Michael S. Tsirkin
2014-09-28 20:33     ` Alex Bligh
2014-09-29  7:02       ` Markus Armbruster
2014-10-05  7:00         ` Paolo Bonzini
2014-10-05 10:26           ` Alex Bligh
2014-10-05 12:26             ` Paolo Bonzini
2014-10-05 12:48               ` Michael S. Tsirkin
2014-10-05 13:30                 ` Paolo Bonzini
2014-09-29 10:08       ` Michael S. Tsirkin
2014-09-29 10:13         ` Alex Bligh
2014-09-29 14:52           ` Serge E. Hallyn
2014-10-04 16:29     ` Alex Bligh
2014-09-24  8:05 ` Markus Armbruster
2014-09-24  8:29   ` Alex Bligh
2014-09-24  8:38 ` Michael Tokarev
2014-09-25  8:02   ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).