1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#include "qemu/osdep.h"
19#include "hw/fw-path-provider.h"
20#include "qemu/module.h"
21
22char *fw_path_provider_get_dev_path(FWPathProvider *p, BusState *bus,
23 DeviceState *dev)
24{
25 FWPathProviderClass *k = FW_PATH_PROVIDER_GET_CLASS(p);
26
27 return k->get_dev_path(p, bus, dev);
28}
29
30char *fw_path_provider_try_get_dev_path(Object *o, BusState *bus,
31 DeviceState *dev)
32{
33 FWPathProvider *p = (FWPathProvider *)
34 object_dynamic_cast(o, TYPE_FW_PATH_PROVIDER);
35
36 if (p) {
37 return fw_path_provider_get_dev_path(p, bus, dev);
38 }
39
40 return NULL;
41}
42
43static const TypeInfo fw_path_provider_info = {
44 .name = TYPE_FW_PATH_PROVIDER,
45 .parent = TYPE_INTERFACE,
46 .class_size = sizeof(FWPathProviderClass),
47};
48
49static void fw_path_provider_register_types(void)
50{
51 type_register_static(&fw_path_provider_info);
52}
53
54type_init(fw_path_provider_register_types)
55