From patchwork Wed Sep 9 07:46:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 33160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 0D308B7080 for ; Wed, 9 Sep 2009 17:47:41 +1000 (EST) Received: from localhost ([127.0.0.1]:47081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlHty-0006XW-1i for incoming@patchwork.ozlabs.org; Wed, 09 Sep 2009 03:47:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlHtV-0006XI-R3 for qemu-devel@nongnu.org; Wed, 09 Sep 2009 03:47:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlHtR-0006W6-Gz for qemu-devel@nongnu.org; Wed, 09 Sep 2009 03:47:09 -0400 Received: from [199.232.76.173] (port=40976 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlHtR-0006W3-Bm for qemu-devel@nongnu.org; Wed, 09 Sep 2009 03:47:05 -0400 Received: from mx20.gnu.org ([199.232.41.8]:9493) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MlHtQ-0003lT-KA for qemu-devel@nongnu.org; Wed, 09 Sep 2009 03:47:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MlHtP-0001oI-0Y for qemu-devel@nongnu.org; Wed, 09 Sep 2009 03:47:03 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n897l0Xv009737; Wed, 9 Sep 2009 03:47:00 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n897kwg3000812; Wed, 9 Sep 2009 03:46:59 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 9 Sep 2009 09:46:57 +0200 Message-Id: <1252482417-28272-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Detected-Operating-System: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH] Fix VMSTATE_PCI_DEVICE version X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org PCI device entries have to have a default version, not 2, because they are used in the midle of other structures that can have _any_ version number. We can't use proper versioning here until we have SubSections support. Why we didn't noticed before? Because in a PC, the only device ported with a version less that 2 is piix_pm, and for that one, default pci values are right. If you use a virtio-console, you will see that its state it is not loaded back. Thanks to Amit Shah for reporting the problem and help debug the fix. Signed-off-by: Juan Quintela --- hw/hw.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 0ae4000..a0cb94e 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -408,7 +408,6 @@ extern const VMStateDescription vmstate_pci_device; #define VMSTATE_PCI_DEVICE(_field, _state) { \ .name = (stringify(_field)), \ - .version_id = 2, \ .size = sizeof(PCIDevice), \ .vmsd = &vmstate_pci_device, \ .flags = VMS_STRUCT, \