check: Only test pvpanic when it is compiled in

It was not possible to compile out pvpanic.  Use the same trick
than applesmc.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Juan Quintela 2018-07-10 22:51:53 +02:00
parent 7b0706503e
commit c0b5be5247
3 changed files with 12 additions and 14 deletions

View file

@ -16,6 +16,15 @@
#define TYPE_PVPANIC "pvpanic"
uint16_t pvpanic_port(void);
#define PVPANIC_IOPORT_PROP "ioport"
static inline uint16_t pvpanic_port(void)
{
Object *o = object_resolve_path_type("", TYPE_PVPANIC, NULL);
if (!o) {
return 0;
}
return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL);
}
#endif