xen-backend.c (f2a1cf9180f63e88bb38ff21c169da97c3f2bad5) xen-backend.c (c4583c8c394ee49ce7d5271f572abd3b000fa9e4)
1/*
2 * Copyright (c) 2018 Citrix Systems Inc.
3 *
4 * This work is licensed under the terms of the GNU GPL, version 2 or later.
5 * See the COPYING file in the top-level directory.
6 */
7
8#include "qemu/osdep.h"

--- 27 unchanged lines hidden (view full) ---

36 return table;
37}
38
39static void xen_backend_table_add(XenBackendImpl *impl)
40{
41 g_hash_table_insert(xen_backend_table_get(), (void *)impl->type, impl);
42}
43
1/*
2 * Copyright (c) 2018 Citrix Systems Inc.
3 *
4 * This work is licensed under the terms of the GNU GPL, version 2 or later.
5 * See the COPYING file in the top-level directory.
6 */
7
8#include "qemu/osdep.h"

--- 27 unchanged lines hidden (view full) ---

36 return table;
37}
38
39static void xen_backend_table_add(XenBackendImpl *impl)
40{
41 g_hash_table_insert(xen_backend_table_get(), (void *)impl->type, impl);
42}
43
44static const char **xen_backend_table_keys(unsigned int *count)
45{
46 return (const char **)g_hash_table_get_keys_as_array(
47 xen_backend_table_get(), count);
48}
49
44static const XenBackendImpl *xen_backend_table_lookup(const char *type)
45{
46 return g_hash_table_lookup(xen_backend_table_get(), type);
47}
48
49void xen_backend_register(const XenBackendInfo *info)
50{
51 XenBackendImpl *impl = g_new0(XenBackendImpl, 1);

--- 13 unchanged lines hidden (view full) ---

65
66 impl->type = info->type;
67 impl->create = info->create;
68 impl->destroy = info->destroy;
69
70 xen_backend_table_add(impl);
71}
72
50static const XenBackendImpl *xen_backend_table_lookup(const char *type)
51{
52 return g_hash_table_lookup(xen_backend_table_get(), type);
53}
54
55void xen_backend_register(const XenBackendInfo *info)
56{
57 XenBackendImpl *impl = g_new0(XenBackendImpl, 1);

--- 13 unchanged lines hidden (view full) ---

71
72 impl->type = info->type;
73 impl->create = info->create;
74 impl->destroy = info->destroy;
75
76 xen_backend_table_add(impl);
77}
78
79const char **xen_backend_get_types(unsigned int *count)
80{
81 return xen_backend_table_keys(count);
82}
83
73static QLIST_HEAD(, XenBackendInstance) backend_list;
74
75static void xen_backend_list_add(XenBackendInstance *backend)
76{
77 QLIST_INSERT_HEAD(&backend_list, backend, entry);
78}
79
80static XenBackendInstance *xen_backend_list_find(XenDevice *xendev)

--- 84 unchanged lines hidden ---
84static QLIST_HEAD(, XenBackendInstance) backend_list;
85
86static void xen_backend_list_add(XenBackendInstance *backend)
87{
88 QLIST_INSERT_HEAD(&backend_list, backend, entry);
89}
90
91static XenBackendInstance *xen_backend_list_find(XenDevice *xendev)

--- 84 unchanged lines hidden ---