From patchwork Thu Aug 20 17:42:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31772 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 16BD0B7B5F for ; Fri, 21 Aug 2009 04:27:24 +1000 (EST) Received: from localhost ([127.0.0.1]:33263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeCM5-0005Sd-Ha for incoming@patchwork.ozlabs.org; Thu, 20 Aug 2009 14:27:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeBhb-0006X4-J8 for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeBhV-0006P5-Es for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:30 -0400 Received: from [199.232.76.173] (port=39161 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeBhT-0006OR-Ea for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55443) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeBhS-00070F-RS for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:45:23 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7KHjMjr000317 for ; Thu, 20 Aug 2009 13:45:22 -0400 Received: from localhost.localdomain (vpn2-8-130.ams2.redhat.com [10.36.8.130]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7KHis4f012471; Thu, 20 Aug 2009 13:45:20 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 20 Aug 2009 19:42:38 +0200 Message-Id: <048443cae7e2ca93312611685292efca191d122a.1250788880.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 20/23] Add version_id to PCIDevice. 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 It is needed for VMState Signed-off-by: Juan Quintela --- hw/pci.c | 3 ++- hw/pci.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 681b9d2..7644dee 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -144,7 +144,7 @@ void pci_device_save(PCIDevice *s, QEMUFile *f) { int i; - qemu_put_be32(f, 2); /* PCI device version */ + qemu_put_be32(f, s->version_id); /* PCI device version */ qemu_put_buffer(f, s->config, 256); for (i = 0; i < 4; i++) qemu_put_be32(f, s->irq_state[i]); @@ -319,6 +319,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, pci_dev->config_write = config_write; bus->devices[devfn] = pci_dev; pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4); + pci_dev->version_id = 2; /* Current pci device vmstate version */ return pci_dev; } diff --git a/hw/pci.h b/hw/pci.h index a2ec16a..32e98d4 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -209,6 +209,8 @@ struct PCIDevice { unsigned *msix_entry_used; /* Region including the MSI-X table */ uint32_t msix_bar_size; + /* Version id needed for VMState */ + int32_t version_id; }; PCIDevice *pci_register_device(PCIBus *bus, const char *name,