src: Add DMA localagent
[barometer.git] / src / dma / vendor / github.com / libvirt / libvirt-go / node_device_wrapper.go
1 /*
2  * This file is part of the libvirt-go project
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  *
22  * Copyright (C) 2018 Red Hat, Inc.
23  *
24  */
25
26 package libvirt
27
28 /*
29 #cgo pkg-config: libvirt
30 #include <assert.h>
31 #include "node_device_wrapper.h"
32
33
34 int
35 virNodeDeviceDestroyWrapper(virNodeDevicePtr dev,
36                             virErrorPtr err)
37 {
38     int ret = virNodeDeviceDestroy(dev);
39     if (ret < 0) {
40         virCopyLastError(err);
41     }
42     return ret;
43 }
44
45
46 int
47 virNodeDeviceDetachFlagsWrapper(virNodeDevicePtr dev,
48                                 const char *driverName,
49                                 unsigned int flags,
50                                 virErrorPtr err)
51 {
52     int ret = virNodeDeviceDetachFlags(dev, driverName, flags);
53     if (ret < 0) {
54         virCopyLastError(err);
55     }
56     return ret;
57 }
58
59
60 int
61 virNodeDeviceDettachWrapper(virNodeDevicePtr dev,
62                             virErrorPtr err)
63 {
64     int ret = virNodeDeviceDettach(dev);
65     if (ret < 0) {
66         virCopyLastError(err);
67     }
68     return ret;
69 }
70
71
72 int
73 virNodeDeviceFreeWrapper(virNodeDevicePtr dev,
74                          virErrorPtr err)
75 {
76     int ret = virNodeDeviceFree(dev);
77     if (ret < 0) {
78         virCopyLastError(err);
79     }
80     return ret;
81 }
82
83
84 const char *
85 virNodeDeviceGetNameWrapper(virNodeDevicePtr dev,
86                             virErrorPtr err)
87 {
88     const char * ret = virNodeDeviceGetName(dev);
89     if (!ret) {
90         virCopyLastError(err);
91     }
92     return ret;
93 }
94
95
96 const char *
97 virNodeDeviceGetParentWrapper(virNodeDevicePtr dev,
98                               virErrorPtr err)
99 {
100     const char * ret = virNodeDeviceGetParent(dev);
101     if (!ret) {
102         virCopyLastError(err);
103     }
104     return ret;
105 }
106
107
108 char *
109 virNodeDeviceGetXMLDescWrapper(virNodeDevicePtr dev,
110                                unsigned int flags,
111                                virErrorPtr err)
112 {
113     char * ret = virNodeDeviceGetXMLDesc(dev, flags);
114     if (!ret) {
115         virCopyLastError(err);
116     }
117     return ret;
118 }
119
120
121 int
122 virNodeDeviceListCapsWrapper(virNodeDevicePtr dev,
123                              char ** const names,
124                              int maxnames,
125                              virErrorPtr err)
126 {
127     int ret = virNodeDeviceListCaps(dev, names, maxnames);
128     if (ret < 0) {
129         virCopyLastError(err);
130     }
131     return ret;
132 }
133
134
135 int
136 virNodeDeviceNumOfCapsWrapper(virNodeDevicePtr dev,
137                               virErrorPtr err)
138 {
139     int ret = virNodeDeviceNumOfCaps(dev);
140     if (ret < 0) {
141         virCopyLastError(err);
142     }
143     return ret;
144 }
145
146
147 int
148 virNodeDeviceReAttachWrapper(virNodeDevicePtr dev,
149                              virErrorPtr err)
150 {
151     int ret = virNodeDeviceReAttach(dev);
152     if (ret < 0) {
153         virCopyLastError(err);
154     }
155     return ret;
156 }
157
158
159 int
160 virNodeDeviceRefWrapper(virNodeDevicePtr dev,
161                         virErrorPtr err)
162 {
163     int ret = virNodeDeviceRef(dev);
164     if (ret < 0) {
165         virCopyLastError(err);
166     }
167     return ret;
168 }
169
170
171 int
172 virNodeDeviceResetWrapper(virNodeDevicePtr dev,
173                           virErrorPtr err)
174 {
175     int ret = virNodeDeviceReset(dev);
176     if (ret < 0) {
177         virCopyLastError(err);
178     }
179     return ret;
180 }
181
182
183 */
184 import "C"