From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XViIQ-0004dZ-Rq for qemu-devel@nongnu.org; Sun, 21 Sep 2014 10:39:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XViIP-00050C-Mi for qemu-devel@nongnu.org; Sun, 21 Sep 2014 10:39:26 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:39185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XViIP-0004y3-GS for qemu-devel@nongnu.org; Sun, 21 Sep 2014 10:39:25 -0400 From: Alex Bligh Date: Sun, 21 Sep 2014 15:38:57 +0100 Message-Id: <1411310339-27733-1-git-send-email-alex@alex.org.uk> Subject: [Qemu-devel] [PATCH v3 0/2] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ryan Harper , Serge Hallyn , "Michael S. Tsirkin" , Libvirt , Serge Hallyn , Alexander Graf , Bruce Rogers , "quintela@redhat.com" , Alex Bligh , Cole Robinson , Amit Shah , =?iso-8859-1?Q?Andreas_F=E4rber?= , "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 type (pc-1.0-qemu-kvm) without affecting any other machine types. The existing pc-1.0 machine type is renamed to pc-1.0-qemu-git, with pc-1.0 becoming an alias for one or another, as selected by a configure option (defaulting to pc-1.0-qemu-git, IE no change). Two aproaches are taken: * 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. 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. Alex Bligh (2): Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm Add configure option --enable-pc-1-0-qemu-kvm configure | 12 ++++++++++++ hw/acpi/piix4.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- hw/i386/pc_piix.c | 38 +++++++++++++++++++++++++++++++++++++- hw/timer/i8254_common.c | 10 +++++++++- 4 files changed, 103 insertions(+), 4 deletions(-) -- 1.7.9.5