diff -Nru qemu-2.0.0+dfsg/debian/changelog qemu-2.0.0+dfsg/debian/changelog --- qemu-2.0.0+dfsg/debian/changelog 2014-09-15 00:41:25.000000000 +0000 +++ qemu-2.0.0+dfsg/debian/changelog 2014-10-06 23:02:50.000000000 +0000 @@ -1,3 +1,12 @@ +qemu (2.0.0+dfsg-2ubuntu1.6) trusty-proposed; urgency=medium + + * Support incoming migration from 12.04 (LP: #1374612) + - d/p/ubutu/add-machine-type-pc-1.0-qemu-kvm-for-live-migrate-co.patch + - add note in README.Debian + - d/control: have qemu-system-x86 suggest kvm-ipxe-precise + + -- Serge Hallyn Mon, 06 Oct 2014 17:47:08 -0500 + qemu (2.0.0+dfsg-2ubuntu1.5) trusty-proposed; urgency=medium * move reload of kvm_intel qemu-system-x86.postinst. (LP: #1324174) diff -Nru qemu-2.0.0+dfsg/debian/control qemu-2.0.0+dfsg/debian/control --- qemu-2.0.0+dfsg/debian/control 2014-05-07 22:33:33.000000000 +0000 +++ qemu-2.0.0+dfsg/debian/control 2014-10-06 22:39:59.000000000 +0000 @@ -336,7 +336,7 @@ Recommends: qemu-utils, # ovmf recommends is debian-only because ubuntu/ovmf is in multiverse cpu-checker -Suggests: samba, vde2, kmod [linux-any], sgabios +Suggests: samba, vde2, kmod [linux-any], sgabios, kvm-ipxe-precise Provides: ${sysprovides:x86} Conflicts: kvm (<< 1.3.0+dfsg-5) Breaks: diff -Nru qemu-2.0.0+dfsg/debian/patches/series qemu-2.0.0+dfsg/debian/patches/series --- qemu-2.0.0+dfsg/debian/patches/series 2014-08-12 13:12:23.000000000 +0000 +++ qemu-2.0.0+dfsg/debian/patches/series 2014-10-06 22:44:51.000000000 +0000 @@ -31,3 +31,4 @@ CVE-2014-0223.patch CVE-2014-3461.patch CVE-2014-3471.patch +ubuntu/add-machine-type-pc-1.0-qemu-kvm-for-live-migrate-co.patch diff -Nru qemu-2.0.0+dfsg/debian/patches/ubuntu/add-machine-type-pc-1.0-qemu-kvm-for-live-migrate-co.patch qemu-2.0.0+dfsg/debian/patches/ubuntu/add-machine-type-pc-1.0-qemu-kvm-for-live-migrate-co.patch --- qemu-2.0.0+dfsg/debian/patches/ubuntu/add-machine-type-pc-1.0-qemu-kvm-for-live-migrate-co.patch 1970-01-01 00:00:00.000000000 +0000 +++ qemu-2.0.0+dfsg/debian/patches/ubuntu/add-machine-type-pc-1.0-qemu-kvm-for-live-migrate-co.patch 2014-10-06 22:47:06.000000000 +0000 @@ -0,0 +1,251 @@ +From 6dedc2c0566c651c695bb356c43382e1fcdc042e Mon Sep 17 00:00:00 2001 +From: Alex Bligh +Date: Tue, 22 Jul 2014 19:14:48 +0100 +Subject: [PATCH 1/2] Add machine type pc-1.0-qemu-kvm for live migrate + compatibility with qemu-kvm + +Add a machine type pc-1.0-qemu-kvm for live migrate compatibility +with qemu-kvm version 1.0. +Changelog: (Serge Hallyn) + * add pc-1.0-precise as an alias to pc-1.0-qemu-kvm + * PC_COMPAT_1_0_QEMU_KVM - specify the legacy pxe romfiles +--- + hw/acpi/piix4.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++-- + hw/i386/pc_piix.c | 31 ++++++++++++++++++++++++++++++ + hw/timer/i8254_common.c | 41 ++++++++++++++++++++++++++++++++++++++++ + include/hw/acpi/piix4.h | 1 + + include/hw/timer/i8254.h | 2 ++ + 5 files changed, 122 insertions(+), 2 deletions(-) + +Index: qemu-2.0.0+dfsg/hw/acpi/piix4.c +=================================================================== +--- qemu-2.0.0+dfsg.orig/hw/acpi/piix4.c ++++ qemu-2.0.0+dfsg/hw/acpi/piix4.c +@@ -247,8 +247,9 @@ static bool vmstate_test_no_use_acpi_pci + } + + /* qemu-kvm 1.2 uses version 3 but advertised as 2 +- * To support incoming qemu-kvm 1.2 migration, change version_id +- * and minimum_version_id to 2 below (which breaks migration from ++ * To support incoming qemu-kvm 1.2 migration, we support ++ * via a command line option a change to minimum_version_id ++ * of 2 in a _compat structure (which breaks migration from + * qemu 1.2). + * + */ +@@ -280,6 +281,34 @@ static const VMStateDescription vmstate_ + } + }; + ++static const VMStateDescription vmstate_acpi_compat = { ++ .name = "piix4_pm", ++ .version_id = 3, ++ .minimum_version_id = 2, ++ .minimum_version_id_old = 1, ++ .load_state_old = acpi_load_old, ++ .post_load = vmstate_acpi_post_load, ++ .fields = (VMStateField[]) { ++ VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState), ++ VMSTATE_UINT16(ar.pm1.evt.sts, PIIX4PMState), ++ VMSTATE_UINT16(ar.pm1.evt.en, PIIX4PMState), ++ VMSTATE_UINT16(ar.pm1.cnt.cnt, PIIX4PMState), ++ VMSTATE_STRUCT(apm, PIIX4PMState, 0, vmstate_apm, APMState), ++ VMSTATE_TIMER(ar.tmr.timer, PIIX4PMState), ++ VMSTATE_INT64(ar.tmr.overflow_time, PIIX4PMState), ++ VMSTATE_STRUCT(ar.gpe, PIIX4PMState, 2, vmstate_gpe, ACPIGPE), ++ VMSTATE_STRUCT_TEST( ++ acpi_pci_hotplug.acpi_pcihp_pci_status[ACPI_PCIHP_BSEL_DEFAULT], ++ PIIX4PMState, ++ vmstate_test_no_use_acpi_pci_hotplug, ++ 2, vmstate_pci_status, ++ struct AcpiPciHpPciStatus), ++ VMSTATE_PCI_HOTPLUG(acpi_pci_hotplug, PIIX4PMState, ++ vmstate_test_use_acpi_pci_hotplug), ++ VMSTATE_END_OF_LIST() ++ } ++}; ++ + static void piix4_reset(void *opaque) + { + PIIX4PMState *s = opaque; +@@ -557,6 +586,22 @@ static void piix4_pm_class_init(ObjectCl + hc->unplug = piix4_pci_device_unplug_cb; + } + ++void piix4_pm_class_fix_compat(void) ++{ ++ GSList *el, *devices = object_class_get_list(TYPE_DEVICE, false); ++ /* ++ * Change the vmstate field in this class and any derived classes ++ * if not overriden. As no other classes should be using this ++ * vmstate, we can simply iterate the class list ++ */ ++ for (el = devices; el; el = el->next) { ++ DeviceClass *dc = el->data; ++ if (dc->vmsd == &vmstate_acpi) { ++ dc->vmsd = &vmstate_acpi_compat; ++ } ++ } ++} ++ + static const TypeInfo piix4_pm_info = { + .name = TYPE_PIIX4_PM, + .parent = TYPE_PCI_DEVICE, +Index: qemu-2.0.0+dfsg/hw/i386/pc_piix.c +=================================================================== +--- qemu-2.0.0+dfsg.orig/hw/i386/pc_piix.c ++++ qemu-2.0.0+dfsg/hw/i386/pc_piix.c +@@ -48,6 +48,8 @@ + #include "exec/address-spaces.h" + #include "hw/acpi/acpi.h" + #include "cpu.h" ++#include "hw/acpi/piix4.h" ++#include "hw/timer/i8254.h" + #ifdef CONFIG_XEN + # include + #endif +@@ -340,6 +342,15 @@ static void pc_init_pci_1_2(QEMUMachineI + pc_init_pci(args); + } + ++/* PC machine init function for qemu-kvm 1.0 */ ++static void pc_init_pci_1_2_qemu_kvm(QEMUMachineInitArgs *args) ++{ ++ piix4_pm_class_fix_compat(); ++ pit_common_class_fix_compat(); ++ pc_compat_1_2(args); ++ pc_init_pci(args); ++} ++ + /* PC init function for pc-0.10 to pc-0.13, and reused by xenfv */ + static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args) + { +@@ -581,6 +592,39 @@ static QEMUMachine pc_machine_v1_0 = { + { /* end of list */ } + }, + .hw_version = "1.0", ++ .alias = "pc-1.0-qemu-kvm", ++}; ++ ++#define PC_COMPAT_1_0_QEMU_KVM \ ++ PC_COMPAT_1_0,\ ++ {\ ++ .driver = "cirrus-vga",\ ++ .property = "vgamem_mb",\ ++ .value = stringify(16),\ ++ }, {\ ++ .driver = "virtio-net-pci", \ ++ .property = "romfile", \ ++ .value = "pxe-virtio.rom.12.04", \ ++ },{\ ++ .driver = "rtl8139",\ ++ .property = "romfile",\ ++ .value = "pxe-rtl8139.rom.12.04",\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "romfile",\ ++ .value = "pxe-e1000.rom.12.04",\ ++ } ++ ++static QEMUMachine pc_machine_v1_0_qemu_kvm = { ++ PC_I440FX_1_2_MACHINE_OPTIONS, ++ .name = "pc-1.0-qemu-kvm", ++ .alias = "pc-1.0-precise", ++ .init = pc_init_pci_1_2_qemu_kvm, ++ .compat_props = (GlobalProperty[]) { ++ PC_COMPAT_1_0_QEMU_KVM, ++ { /* end of list */ } ++ }, ++ .hw_version = "1.0", + }; + + #define PC_COMPAT_0_15 \ +@@ -824,6 +868,7 @@ static void pc_machine_init(void) + qemu_register_machine(&pc_machine_v1_2); + qemu_register_machine(&pc_machine_v1_1); + qemu_register_machine(&pc_machine_v1_0); ++ qemu_register_machine(&pc_machine_v1_0_qemu_kvm); + qemu_register_machine(&pc_machine_v0_15); + qemu_register_machine(&pc_machine_v0_14); + qemu_register_machine(&pc_machine_v0_13); +Index: qemu-2.0.0+dfsg/hw/timer/i8254_common.c +=================================================================== +--- qemu-2.0.0+dfsg.orig/hw/timer/i8254_common.c ++++ qemu-2.0.0+dfsg/hw/timer/i8254_common.c +@@ -276,6 +276,29 @@ static const VMStateDescription vmstate_ + } + }; + ++static const VMStateDescription vmstate_pit_common_compat = { ++ .name = "i8254", ++ .version_id = 3, ++ .minimum_version_id = 2, ++ .minimum_version_id_old = 1, ++ .load_state_old = pit_load_old, ++ .pre_save = pit_dispatch_pre_save, ++ .post_load = pit_dispatch_post_load, ++ .fields = (VMStateField[]) { ++ /* qemu-kvm version_id=2 had 'flags' here which is equivalent ++ * This fixes incoming migration from qemu-kvm 1.0, but breaks ++ * incoming migration from qemu < 1.1 ++ */ ++ /* VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), */ ++ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), ++ VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, ++ vmstate_pit_channel, PITChannelState), ++ VMSTATE_INT64(channels[0].next_transition_time, ++ PITCommonState), /* formerly irq_timer */ ++ VMSTATE_END_OF_LIST() ++ } ++}; ++ + static void pit_common_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); +@@ -290,6 +313,24 @@ static void pit_common_class_init(Object + dc->cannot_instantiate_with_device_add_yet = true; + } + ++void pit_common_class_fix_compat(void) ++{ ++ GSList *el, *devices = object_class_get_list(TYPE_DEVICE, false); ++ /* ++ * Change the vmstate field in this class and any derived classes ++ * if not overriden. As no other classes should be using this ++ * vmstate, we can simply iterate the class list ++ */ ++ for (el = devices; el; el = el->next) { ++ DeviceClass *dc = el->data; ++ if (dc->vmsd == &vmstate_pit_common) { ++ dc->vmsd = &vmstate_pit_common_compat; ++ } ++ } ++ ++ g_slist_free(devices); ++} ++ + static const TypeInfo pit_common_type = { + .name = TYPE_PIT_COMMON, + .parent = TYPE_ISA_DEVICE, +Index: qemu-2.0.0+dfsg/include/hw/acpi/piix4.h +=================================================================== +--- qemu-2.0.0+dfsg.orig/include/hw/acpi/piix4.h ++++ qemu-2.0.0+dfsg/include/hw/acpi/piix4.h +@@ -4,5 +4,6 @@ + #include "qemu/typedefs.h" + + Object *piix4_pm_find(void); ++void piix4_pm_class_fix_compat(void); + + #endif +Index: qemu-2.0.0+dfsg/include/hw/timer/i8254.h +=================================================================== +--- qemu-2.0.0+dfsg.orig/include/hw/timer/i8254.h ++++ qemu-2.0.0+dfsg/include/hw/timer/i8254.h +@@ -72,4 +72,6 @@ static inline ISADevice *kvm_pit_init(IS + void pit_set_gate(ISADevice *dev, int channel, int val); + void pit_get_channel_info(ISADevice *dev, int channel, PITChannelInfo *info); + ++void pit_common_class_fix_compat(void); ++ + #endif /* !HW_I8254_H */ diff -Nru qemu-2.0.0+dfsg/debian/README.Debian qemu-2.0.0+dfsg/debian/README.Debian --- qemu-2.0.0+dfsg/debian/README.Debian 1970-01-01 00:00:00.000000000 +0000 +++ qemu-2.0.0+dfsg/debian/README.Debian 2014-10-06 22:36:28.000000000 +0000 @@ -0,0 +1,16 @@ +QEMU/kvm pc-1.0 Machine Type migration +=============================== +In 14.04 Ubuntu switched from the qemu-kvm source tree to the qemu source tree. +The pc-1.0 machine type in the two source trees differed. This made +live migration of a pc-1.0 machine type guest from a 12.04 host to a 14.04 +host fail. Fixing this transparently is impossible at this point as it +would break migration from pc-1.0 machine type VMs started in 14.04. + +To work around this, a new machine type, called pc-1.0-qemu-kvm and aliased +to "pc-1.0-precise", has been introduced. To accept incoming migration from +a pc-1.0 machine from another 14.04 host, simply use "-M pc-1.0" as before. +To accept incoming migration from a pc-1.0 machine from a 12.04 host, +use "-M pc-1.0-precise". This will require the kvm-ipxe-precise package to +be installed, which provides the ipxe-roms used by that machine type. + + -- Serge Hallyn Mon, 06 Oct 2014 17:11:54 -0500