From patchwork Wed Oct 24 06:59:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hahn X-Patchwork-Id: 193692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 411B52C00A6 for ; Wed, 24 Oct 2012 17:59:53 +1100 (EST) Received: from localhost ([::1]:46021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQuwR-00006L-Hz for incoming@patchwork.ozlabs.org; Wed, 24 Oct 2012 02:59:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQuwI-00005f-Jk for qemu-devel@nongnu.org; Wed, 24 Oct 2012 02:59:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQuwG-0004wv-UG for qemu-devel@nongnu.org; Wed, 24 Oct 2012 02:59:42 -0400 Received: from mail.univention.de ([82.198.197.8]:2779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQuwG-0004w2-Kb for qemu-devel@nongnu.org; Wed, 24 Oct 2012 02:59:40 -0400 Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id CC99C1413890; Wed, 24 Oct 2012 08:59:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id BC59B1413891; Wed, 24 Oct 2012 08:59:37 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.1 (20080629) (Debian) at knut.univention.de Received: from mail.univention.de ([127.0.0.1]) by localhost (slugis.knut.univention.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TVD3hwytCkE7; Wed, 24 Oct 2012 08:59:37 +0200 (CEST) Received: from stave.knut.univention.de (mail.univention.de [82.198.197.8]) by slugis.knut.univention.de (Postfix) with ESMTPSA id 265351413890; Wed, 24 Oct 2012 08:59:37 +0200 (CEST) From: Philipp Hahn Organization: Univention.de To: Doug Goldstein Date: Wed, 24 Oct 2012 08:59:28 +0200 User-Agent: KMail/1.9.10 (enterprise35 20100903.1171286) References: <50852CCF.3070000@redhat.com> In-Reply-To: X-KMail-QuotePrefix: > MIME-Version: 1.0 Message-Id: <201210240859.32887.hahn@univention.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 82.198.197.8 Cc: qemu-devel , Avi Kivity , KVM mailing list , Juan Quintela Subject: Re: [Qemu-devel] 1.1.1 -> 1.1.2 migrate /managedsave issue X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hello Doug, On Tuesday 23 October 2012 22:38:47 Doug Goldstein wrote: > >>> qemu: warning: error while loading state for instance 0x0 of device > >>> 'ram' load of migration failed ... > >> I diagnosed that using gdb to single step kvm until I found > >> hw/pci.c#get_pci_config_device() returning -EINVAL. ... > But yes I can confirm that > vmstate_load_state() which is calling field->info->get() which is > calling get_pci_config_device() is returning -EINVAL. ... > Any recommendations to fix this? Or do I need to kill the saved state > and start over? For start try to re-get the old PXE ROM files, that is for Debian re-install the old etherboot-qemu or an older Version of the ipxe-qemu package. If that then works again, you can go further. Otherwise you need to get the exact index "i" where get_pci_config_device() returns -EINVAL and match that with the PCI spec. For short see hw/pci_regs.h. For our Debian based UCS distribution I patched qemu(-kvm) to use the old image files (which are still available and installed in parallel to the new files) if the pc-level is 0.14 or lower (which is the version we currently ship; only our next release will switch to 1.1.2). I've attached my patch FYI. That is only a work around until QEMU provides a real solution. If you've used an e1000, that is not enougth because some more PCI configuration bits (PCI_STATUS_CAP_LIST) were changed in an incompatible way. If I remember correctly there was a different bug report, where changed PCI bits were also responsible for breaking saved states: Some PCI devices were changed to multi-function devices (or the other way around), which also breaks loading of previous saved stated. I think it was a bug in libvirt which started adding an explicit "multifunction=on", while the save was done using an implicit "multifinction=off". ( in our German BZ) Sincerely Philipp Hahn diff -urN qemu-kvm-1.1.2+dfsg.orig/debian/patches/romfile-compatibility.diff qemu-kvm-1.1.2+dfsg/debian/patches/romfile-compatibility.diff --- qemu-kvm-1.1.2+dfsg.orig/debian/patches/romfile-compatibility.diff 1970-01-01 01:00:00.000000000 +0100 +++ qemu-kvm-1.1.2+dfsg/debian/patches/romfile-compatibility.diff 2012-10-08 14:25:09.225656404 +0200 @@ -0,0 +1,39 @@ +Bug #24702: Fix PXE ROM size mismatch + +For pc-0.14 and older use the PXE ROMs from the deprecated etherboot-qemu +package, which have different sizes. Without the patch the virtual PC gets +build with the current ROM sizes. Loading then fails because the stored PCI ROM +BAR size mismatches the configured size. +--- a/hw/pc_piix.c ++++ b/hw/pc_piix.c +@@ -433,6 +433,30 @@ static QEMUMachine pc_machine_v0_15 = { + .driver = "virtio-balloon-pci",\ + .property = "event_idx",\ + .value = "off",\ ++ },{\ ++ .driver = "ne2000",\ ++ .property = "romfile",\ ++ .value = "/usr/lib/etherboot/rtl8029.rom",\ ++ },{\ ++ .driver = "rtl8139",\ ++ .property = "romfile",\ ++ .value = "/usr/lib/etherboot/rtl8139.rom",\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "romfile",\ ++ .value = "/usr/lib/etherboot/e1000-82540em.rom",\ ++ },{\ ++ .driver = "pcnet",\ ++ .property = "romfile",\ ++ .value = "/usr/lib/etherboot/pcnet32.rom",\ ++ },{\ ++ .driver = "ne2k-isa",\ ++ .property = "romfile",\ ++ .value = "/usr/lib/etherboot/ne.rom",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "romfile",\ ++ .value = "/usr/lib/etherboot/virtio-net.rom",\ + } + + static QEMUMachine pc_machine_v0_14 = { diff -urN qemu-kvm-1.1.2+dfsg.orig/debian/patches/series qemu-kvm-1.1.2+dfsg/debian/patches/series --- qemu-kvm-1.1.2+dfsg.orig/debian/patches/series 2012-09-10 12:14:05.000000000 +0200 +++ qemu-kvm-1.1.2+dfsg/debian/patches/series 2012-10-08 14:24:51.497155189 +0200 @@ -8,3 +8,4 @@ net-add--netdev-options-to-man-page.patch revert-serial-fix-retry-logic.patch +romfile-compatibility.diff diff -urN qemu-kvm-1.1.2+dfsg.orig/debian/control qemu-kvm-1.1.2+dfsg/debian/control --- qemu-kvm-1.1.2+dfsg.orig/debian/control 2012-09-11 08:29:43.000000000 +0200 +++ qemu-kvm-1.1.2+dfsg/debian/control 2012-10-08 15:06:39.201155102 +0200 @@ -37,7 +37,8 @@ seabios (>> 1.7.0~), vgabios (>= 0.6c-3~), qemu-keymaps, qemu-utils (>> 0.14.0), ipxe-qemu | ipxe (<< 1.0.0+git-20120202.f6840ba-2) -Recommends: bridge-utils, iproute +Recommends: bridge-utils, iproute, + etherboot-qemu Suggests: debootstrap, vde2, samba Provides: kvm Conflicts: kvm-source (<= 18-1), kvm-data (<= 66+dfsg-1.1), kvm (<< 1:0)