From patchwork Thu Nov 1 13:04:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 196246 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 627892C0321 for ; Fri, 2 Nov 2012 01:45:36 +1100 (EST) Received: from localhost ([::1]:57256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTw1W-0000cw-IJ for incoming@patchwork.ozlabs.org; Thu, 01 Nov 2012 10:45:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTuSS-0005Bg-9n for qemu-devel@nongnu.org; Thu, 01 Nov 2012 09:05:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTuSP-0006VD-NZ for qemu-devel@nongnu.org; Thu, 01 Nov 2012 09:05:15 -0400 Received: from mail-ia0-f173.google.com ([209.85.210.173]:60542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTuSP-000627-HA for qemu-devel@nongnu.org; Thu, 01 Nov 2012 09:05:13 -0400 Received: by mail-ia0-f173.google.com with SMTP id m10so1965034iam.4 for ; Thu, 01 Nov 2012 06:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ShygEYQsFJSVBifVLIQfsbBCkUogQMWO4O9lFewbYS8=; b=Gz3DGfVTxh3jF4yJqsjhwMZ+5kDVn6Yc84lnDlJrUXd2fexwKhppXjbSE83yxxVZGw xsgUU7aMIKrUQwj65SzIIRLr0LKTHWNXs8N2o8r6WJfmbb8p0GagKPUx8b4BleTu5jGc D/00ZdnEch6JQZ0e+64djPWNQsc0/aoUZSOf+AaXRde9/lAeQM7Q/A2Ku/LNafzd4pSO qD2Q7Ciku0NqjVV+6Z7qs+5erh5kMQvP/C05f7WeY8OhGUNnsymT3ozKINAdXrFTz0GX dIBPhOTJoTevBG8925MXKIsVuMR7jCVVbOQR+Kb7o5g/IyFOcPzikLh0vMrrazw7GvVR D6/Q== Received: by 10.42.132.194 with SMTP id e2mr34175383ict.21.1351775112388; Thu, 01 Nov 2012 06:05:12 -0700 (PDT) Received: from loki.morrigu.org (cpe-72-179-62-111.austin.res.rr.com. [72.179.62.111]) by mx.google.com with ESMTPS id dq9sm5734584igc.5.2012.11.01.06.05.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Nov 2012 06:05:11 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Thu, 1 Nov 2012 08:04:18 -0500 Message-Id: <1351775071-7644-17-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351775071-7644-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1351775071-7644-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.173 Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, quintela@redhat.com, blauwirbel@gmail.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 16/29] i440fx: a qom property for i440FX state 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 Signed-off-by: Michael Roth --- hw/piix_pci.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/piix_pci.c b/hw/piix_pci.c index a4c32aa..563ded6 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -32,6 +32,8 @@ #include "xen.h" #include "qidl.h" +QIDL_ENABLE() + /* * I440FX chipset data sheet. * http://download.intel.com/design/chipsets/datashts/29054901.pdf @@ -241,6 +243,23 @@ static int i440fx_pcihost_initfn(SysBusDevice *dev) return 0; } +static void i440fx_get_state(Object *obj, Visitor *v, void *opaque, + const char *name, Error **errp) +{ + PCIDevice *pci = PCI_DEVICE(obj); + PCII440FXState *s = DO_UPCAST(PCII440FXState, dev, pci); + QIDL_VISIT_TYPE(PCII440FXState, v, &s, name, errp); +} + +static void i440fx_set_state(Object *obj, Visitor *v, void *opaque, + const char *name, Error **errp) +{ + PCIDevice *pci = PCI_DEVICE(obj); + PCII440FXState *s = DO_UPCAST(PCII440FXState, dev, pci); + QIDL_VISIT_TYPE(PCII440FXState, v, &s, name, errp); + i440fx_post_load(s, -1); +} + static int i440fx_initfn(PCIDevice *dev) { PCII440FXState *d = DO_UPCAST(PCII440FXState, dev, dev); @@ -248,6 +267,11 @@ static int i440fx_initfn(PCIDevice *dev) d->dev.config[I440FX_SMRAM] = 0x02; cpu_smm_register(&i440fx_set_smm, d); + + object_property_add(OBJECT(d), "state", "PCII440FXState", + i440fx_get_state, i440fx_set_state, NULL, NULL, NULL); + QIDL_SCHEMA_ADD_LINK(PCII440FXState, OBJECT(d), "state_schema", NULL); + return 0; }