@@ -215,36 +215,34 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
215
215
typedef struct {
216
216
const char * name ;
217
217
ptrdiff_t offset ; /* field's byte offset in IOThread struct */
218
- } PollParamInfo ;
218
+ } IOThreadParamInfo ;
219
219
220
- static PollParamInfo poll_max_ns_info = {
220
+ static IOThreadParamInfo poll_max_ns_info = {
221
221
"poll-max-ns" , offsetof(IOThread , poll_max_ns ),
222
222
};
223
- static PollParamInfo poll_grow_info = {
223
+ static IOThreadParamInfo poll_grow_info = {
224
224
"poll-grow" , offsetof(IOThread , poll_grow ),
225
225
};
226
- static PollParamInfo poll_shrink_info = {
226
+ static IOThreadParamInfo poll_shrink_info = {
227
227
"poll-shrink" , offsetof(IOThread , poll_shrink ),
228
228
};
229
- static PollParamInfo aio_max_batch_info = {
229
+ static IOThreadParamInfo aio_max_batch_info = {
230
230
"aio-max-batch" , offsetof(IOThread , aio_max_batch ),
231
231
};
232
232
233
233
static void iothread_get_param (Object * obj , Visitor * v ,
234
- const char * name , void * opaque , Error * * errp )
234
+ const char * name , IOThreadParamInfo * info , Error * * errp )
235
235
{
236
236
IOThread * iothread = IOTHREAD (obj );
237
- PollParamInfo * info = opaque ;
238
237
int64_t * field = (void * )iothread + info -> offset ;
239
238
240
239
visit_type_int64 (v , name , field , errp );
241
240
}
242
241
243
242
static bool iothread_set_param (Object * obj , Visitor * v ,
244
- const char * name , void * opaque , Error * * errp )
243
+ const char * name , IOThreadParamInfo * info , Error * * errp )
245
244
{
246
245
IOThread * iothread = IOTHREAD (obj );
247
- PollParamInfo * info = opaque ;
248
246
int64_t * field = (void * )iothread + info -> offset ;
249
247
int64_t value ;
250
248
@@ -266,16 +264,18 @@ static bool iothread_set_param(Object *obj, Visitor *v,
266
264
static void iothread_get_poll_param (Object * obj , Visitor * v ,
267
265
const char * name , void * opaque , Error * * errp )
268
266
{
267
+ IOThreadParamInfo * info = opaque ;
269
268
270
- iothread_get_param (obj , v , name , opaque , errp );
269
+ iothread_get_param (obj , v , name , info , errp );
271
270
}
272
271
273
272
static void iothread_set_poll_param (Object * obj , Visitor * v ,
274
273
const char * name , void * opaque , Error * * errp )
275
274
{
276
275
IOThread * iothread = IOTHREAD (obj );
276
+ IOThreadParamInfo * info = opaque ;
277
277
278
- if (!iothread_set_param (obj , v , name , opaque , errp )) {
278
+ if (!iothread_set_param (obj , v , name , info , errp )) {
279
279
return ;
280
280
}
281
281
@@ -291,16 +291,18 @@ static void iothread_set_poll_param(Object *obj, Visitor *v,
291
291
static void iothread_get_aio_param (Object * obj , Visitor * v ,
292
292
const char * name , void * opaque , Error * * errp )
293
293
{
294
+ IOThreadParamInfo * info = opaque ;
294
295
295
- iothread_get_param (obj , v , name , opaque , errp );
296
+ iothread_get_param (obj , v , name , info , errp );
296
297
}
297
298
298
299
static void iothread_set_aio_param (Object * obj , Visitor * v ,
299
300
const char * name , void * opaque , Error * * errp )
300
301
{
301
302
IOThread * iothread = IOTHREAD (obj );
303
+ IOThreadParamInfo * info = opaque ;
302
304
303
- if (!iothread_set_param (obj , v , name , opaque , errp )) {
305
+ if (!iothread_set_param (obj , v , name , info , errp )) {
304
306
return ;
305
307
}
306
308
0 commit comments