From patchwork Wed May 12 20:57:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 52442 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 ozlabs.org (Postfix) with ESMTPS id 2E0D2B7E0A for ; Thu, 13 May 2010 14:55:15 +1000 (EST) Received: from localhost ([127.0.0.1]:57991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCQRY-00030l-5q for incoming@patchwork.ozlabs.org; Thu, 13 May 2010 00:54:44 -0400 Received: from [140.186.70.92] (port=40997 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCPEN-0008L5-5D for qemu-devel@nongnu.org; Wed, 12 May 2010 23:37:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCK1q-0006gf-59 for qemu-devel@nongnu.org; Wed, 12 May 2010 18:03:47 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:54666) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCK1p-0006gW-Ug for qemu-devel@nongnu.org; Wed, 12 May 2010 18:03:46 -0400 Received: by pxi19 with SMTP id 19so297108pxi.4 for ; Wed, 12 May 2010 15:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=ccC5hOGRscQtzyU10/UYmD/89BlVpLWeM6aOajh+eJU=; b=Fgg6T4aZggS/ylxDX98HgD7ATIgHWO62F6uGxbd51tHISwO68HXQhqmTM1+V9mpXgI tYsxXKI2BQmcshGrS5+Xk0/TBnyWSRj0GLLBNp/6CDLOX6er3sCqQVDBKWhEVKTwyDtl i0nqtT9V2bGynETyqz2udlIN38tbDiARq0rfw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=vIJo7xb5dn1GcjEbxP0yuOc3vx43wNzrtGspw0Xxn05Htalv77EtOGxu2eKgft0NEv YTANT3hT8qa2ctFhceh+e8rhxJ/rNkn+Ks/HKcH5CHU79DKKbmaHCe+e2M960pIPrXXu iNsm3dBZl6dRBz4TH6GLhA6t57hIV3HBytb2Y= MIME-Version: 1.0 Received: by 10.141.214.38 with SMTP id r38mr5338990rvq.258.1273697824638; Wed, 12 May 2010 13:57:04 -0700 (PDT) Received: by 10.141.44.12 with HTTP; Wed, 12 May 2010 13:57:04 -0700 (PDT) Date: Wed, 12 May 2010 23:57:04 +0300 Message-ID: From: Blue Swirl To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 2/4] qdev: automatically register device info 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 Signed-off-by: Blue Swirl --- hw/qdev.c | 3 +++ hw/qdev.h | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index d3bf0fa..258bbef 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -280,6 +280,9 @@ int qdev_init(DeviceState *dev) qemu_register_reset(qdev_reset, dev); if (dev->info->vmsd) vmstate_register(-1, dev->info->vmsd, dev); + if (dev->info->mdi) { + monitor_register_device_info(dev->info->mdi, dev); + } dev->state = DEV_STATE_INITIALIZED; return 0; } diff --git a/hw/qdev.h b/hw/qdev.h index d8fbc73..f85903a 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -142,6 +142,9 @@ struct DeviceInfo { /* device state */ const VMStateDescription *vmsd; + /* monitor info handler */ + const struct MonDevInfo *mdi; + /* Private to qdev / bus. */ qdev_initfn init; qdev_event unplug;