]>
Commit | Line | Data |
---|---|---|
37146829 AF |
1 | /* |
2 | * QTest testcase for IndustryPack Octal-RS232 | |
3 | * | |
4 | * Copyright (c) 2014 SUSE LINUX Products GmbH | |
5 | * | |
6 | * This work is licensed under the terms of the GNU GPL, version 2 or later. | |
7 | * See the COPYING file in the top-level directory. | |
8 | */ | |
9 | ||
681c28a3 | 10 | #include "qemu/osdep.h" |
37146829 | 11 | #include "libqtest.h" |
0b8fa32f | 12 | #include "qemu/module.h" |
31692b2e EGE |
13 | #include "libqos/qgraph.h" |
14 | ||
15 | typedef struct QIpoctal232 QIpoctal232; | |
16 | ||
17 | struct QIpoctal232 { | |
18 | QOSGraphObject obj; | |
19 | }; | |
37146829 AF |
20 | |
21 | /* Tests only initialization so far. TODO: Replace with functional tests */ | |
31692b2e | 22 | static void nop(void *obj, void *data, QGuestAllocator *alloc) |
37146829 AF |
23 | { |
24 | } | |
25 | ||
31692b2e EGE |
26 | static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc, |
27 | void *addr) | |
37146829 | 28 | { |
31692b2e | 29 | QIpoctal232 *ipoctal232 = g_new0(QIpoctal232, 1); |
37146829 | 30 | |
31692b2e EGE |
31 | return &ipoctal232->obj; |
32 | } | |
37146829 | 33 | |
31692b2e EGE |
34 | static void ipoctal232_register_nodes(void) |
35 | { | |
36 | qos_node_create_driver("ipoctal232", ipoctal232_create); | |
37 | qos_node_consumes("ipoctal232", "ipack", &(QOSGraphEdgeOptions) { | |
38 | .extra_device_opts = "bus=ipack0.0", | |
39 | }); | |
40 | } | |
37146829 | 41 | |
31692b2e | 42 | libqos_init(ipoctal232_register_nodes); |
37146829 | 43 | |
31692b2e EGE |
44 | static void register_ipoctal232_test(void) |
45 | { | |
46 | qos_add_test("nop", "ipoctal232", nop, NULL); | |
37146829 | 47 | } |
31692b2e EGE |
48 | |
49 | libqos_init(register_ipoctal232_test); |