Skip to content

Commit c09124d

Browse files
committed
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request # gpg: Signature made Mon 11 Oct 2021 05:40:35 AM PDT # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <[email protected]>" [full] # gpg: aka "Stefan Hajnoczi <[email protected]>" [full] * remotes/stefanha/tags/block-pull-request: iothread: use IOThreadParamInfo in iothread_[set|get]_param() iothread: rename PollParamInfo to IOThreadParamInfo Signed-off-by: Richard Henderson <[email protected]>
2 parents 15a0578 + 1cc7ead commit c09124d

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

iothread.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,36 +215,34 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
215215
typedef struct {
216216
const char *name;
217217
ptrdiff_t offset; /* field's byte offset in IOThread struct */
218-
} PollParamInfo;
218+
} IOThreadParamInfo;
219219

220-
static PollParamInfo poll_max_ns_info = {
220+
static IOThreadParamInfo poll_max_ns_info = {
221221
"poll-max-ns", offsetof(IOThread, poll_max_ns),
222222
};
223-
static PollParamInfo poll_grow_info = {
223+
static IOThreadParamInfo poll_grow_info = {
224224
"poll-grow", offsetof(IOThread, poll_grow),
225225
};
226-
static PollParamInfo poll_shrink_info = {
226+
static IOThreadParamInfo poll_shrink_info = {
227227
"poll-shrink", offsetof(IOThread, poll_shrink),
228228
};
229-
static PollParamInfo aio_max_batch_info = {
229+
static IOThreadParamInfo aio_max_batch_info = {
230230
"aio-max-batch", offsetof(IOThread, aio_max_batch),
231231
};
232232

233233
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)
235235
{
236236
IOThread *iothread = IOTHREAD(obj);
237-
PollParamInfo *info = opaque;
238237
int64_t *field = (void *)iothread + info->offset;
239238

240239
visit_type_int64(v, name, field, errp);
241240
}
242241

243242
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)
245244
{
246245
IOThread *iothread = IOTHREAD(obj);
247-
PollParamInfo *info = opaque;
248246
int64_t *field = (void *)iothread + info->offset;
249247
int64_t value;
250248

@@ -266,16 +264,18 @@ static bool iothread_set_param(Object *obj, Visitor *v,
266264
static void iothread_get_poll_param(Object *obj, Visitor *v,
267265
const char *name, void *opaque, Error **errp)
268266
{
267+
IOThreadParamInfo *info = opaque;
269268

270-
iothread_get_param(obj, v, name, opaque, errp);
269+
iothread_get_param(obj, v, name, info, errp);
271270
}
272271

273272
static void iothread_set_poll_param(Object *obj, Visitor *v,
274273
const char *name, void *opaque, Error **errp)
275274
{
276275
IOThread *iothread = IOTHREAD(obj);
276+
IOThreadParamInfo *info = opaque;
277277

278-
if (!iothread_set_param(obj, v, name, opaque, errp)) {
278+
if (!iothread_set_param(obj, v, name, info, errp)) {
279279
return;
280280
}
281281

@@ -291,16 +291,18 @@ static void iothread_set_poll_param(Object *obj, Visitor *v,
291291
static void iothread_get_aio_param(Object *obj, Visitor *v,
292292
const char *name, void *opaque, Error **errp)
293293
{
294+
IOThreadParamInfo *info = opaque;
294295

295-
iothread_get_param(obj, v, name, opaque, errp);
296+
iothread_get_param(obj, v, name, info, errp);
296297
}
297298

298299
static void iothread_set_aio_param(Object *obj, Visitor *v,
299300
const char *name, void *opaque, Error **errp)
300301
{
301302
IOThread *iothread = IOTHREAD(obj);
303+
IOThreadParamInfo *info = opaque;
302304

303-
if (!iothread_set_param(obj, v, name, opaque, errp)) {
305+
if (!iothread_set_param(obj, v, name, info, errp)) {
304306
return;
305307
}
306308

0 commit comments

Comments
 (0)