thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
Blob Blame History Raw
From be90d9992517cf1247bcce2f0ddae2ddf8e75291 Mon Sep 17 00:00:00 2001
Message-Id: <be90d9992517cf1247bcce2f0ddae2ddf8e75291.1387298827.git.minovotn@redhat.com>
In-Reply-To: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
References: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Tue, 17 Dec 2013 15:18:57 +0100
Subject: [PATCH 44/56] hpet: add API to find it

RH-Author: Michael S. Tsirkin <mst@redhat.com>
Message-id: <1387293161-4085-45-git-send-email-mst@redhat.com>
Patchwork-id: 56350
O-Subject: [PATCH qemu-kvm RHEL7.0 v2 44/57] hpet: add API to find it
Bugzilla: 1034876
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>

Add API to find HPET using QOM.

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 64e9df8d34e493e59c1920358257a7576a560a1a)
---
 include/hw/timer/hpet.h | 2 ++
 hw/timer/hpet.c         | 5 +++++
 2 files changed, 7 insertions(+)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/timer/hpet.c         | 5 +++++
 include/hw/timer/hpet.h | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index dd486a1..8c26851 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -744,6 +744,11 @@ static void hpet_device_class_init(ObjectClass *klass, void *data)
     dc->props = hpet_device_properties;
 }
 
+bool hpet_find(void)
+{
+    return object_resolve_path_type("", "hpet", NULL);
+}
+
 static const TypeInfo hpet_device_info = {
     .name          = "hpet",
     .parent        = TYPE_SYS_BUS_DEVICE,
diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h
index 757f79f..ab44bd3 100644
--- a/include/hw/timer/hpet.h
+++ b/include/hw/timer/hpet.h
@@ -71,4 +71,6 @@ struct hpet_fw_config
 } QEMU_PACKED;
 
 extern struct hpet_fw_config hpet_cfg;
+
+bool hpet_find(void);
 #endif
-- 
1.7.11.7