qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

fsdev: Add return value to fsdev_throttle_parse_opts()

It is more convenient to use the return value of the function to notify
errors, rather than to be tied up setting up the &local_err boilerplate.

Signed-off-by: Greg Kurz <groug@kaod.org>

+4 -5
+2 -2
fsdev/qemu-fsdev-throttle.c
··· 31 31 qemu_co_enter_next(&fst->throttled_reqs[true], NULL); 32 32 } 33 33 34 - void fsdev_throttle_parse_opts(QemuOpts *opts, FsThrottle *fst, Error **errp) 34 + int fsdev_throttle_parse_opts(QemuOpts *opts, FsThrottle *fst, Error **errp) 35 35 { 36 36 throttle_config_init(&fst->cfg); 37 37 fst->cfg.buckets[THROTTLE_BPS_TOTAL].avg = ··· 75 75 fst->cfg.op_size = 76 76 qemu_opt_get_number(opts, "throttling.iops-size", 0); 77 77 78 - throttle_is_valid(&fst->cfg, errp); 78 + return throttle_is_valid(&fst->cfg, errp) ? 0 : -1; 79 79 } 80 80 81 81 void fsdev_throttle_init(FsThrottle *fst)
+1 -1
fsdev/qemu-fsdev-throttle.h
··· 26 26 CoQueue throttled_reqs[2]; 27 27 } FsThrottle; 28 28 29 - void fsdev_throttle_parse_opts(QemuOpts *, FsThrottle *, Error **); 29 + int fsdev_throttle_parse_opts(QemuOpts *, FsThrottle *, Error **); 30 30 31 31 void fsdev_throttle_init(FsThrottle *); 32 32
+1 -2
hw/9pfs/9p-local.c
··· 1511 1511 return -1; 1512 1512 } 1513 1513 1514 - fsdev_throttle_parse_opts(opts, &fse->fst, &local_err); 1515 - if (local_err) { 1514 + if (fsdev_throttle_parse_opts(opts, &fse->fst, &local_err)) { 1516 1515 error_propagate_prepend(errp, local_err, 1517 1516 "invalid throttle configuration: "); 1518 1517 return -1;