diff options
| author | Michael S. Tsirkin | 2013-07-24 17:56:13 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin | 2013-10-14 16:48:52 +0200 |
| commit | 64e9df8d34e493e59c1920358257a7576a560a1a (patch) | |
| tree | d39c6be4e2a3ccfe29a186c68e50cc18f224314a | |
| parent | pvpanic: add API to access io port (diff) | |
| download | qemu-64e9df8d34e493e59c1920358257a7576a560a1a.tar.gz qemu-64e9df8d34e493e59c1920358257a7576a560a1a.tar.xz qemu-64e9df8d34e493e59c1920358257a7576a560a1a.zip | |
hpet: add API to find it
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>
| -rw-r--r-- | hw/timer/hpet.c | 5 | ||||
| -rw-r--r-- | include/hw/timer/hpet.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index fcd22aea59..2eb75ea945 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -757,6 +757,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("", TYPE_HPET, NULL); +} + static const TypeInfo hpet_device_info = { .name = TYPE_HPET, .parent = TYPE_SYS_BUS_DEVICE, diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h index 757f79fdd2..ab44bd31fd 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 |
