@@ -388,6 +388,15 @@ static DriveInfo *blockdev_init(QDict *bs_opts,
}
#endif
+ if ((buf = qemu_opt_get(opts, "workerthreads")) != NULL) {
+ if (!strcmp(buf, "pool")) {
+ /* this is the default */
+ } else {
+ error_report("invalid workerthreads option");
+ return NULL;
+ }
+ }
+
if ((buf = qemu_opt_get(opts, "format")) != NULL) {
if (is_help_option(buf)) {
error_printf("Supported formats:");
@@ -2269,6 +2278,10 @@ QemuOptsList qemu_common_drive_opts = {
.type = QEMU_OPT_STRING,
.help = "disk serial number",
},{
+ .name = "workerthreads",
+ .type = QEMU_OPT_STRING,
+ .help = "type of worker threads (pool)",
+ },{
.name = "rerror",
.type = QEMU_OPT_STRING,
.help = "read error action",
@@ -408,7 +408,7 @@ DEF("drive", HAS_ARG, QEMU_OPTION_drive,
" [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n"
" [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
" [,serial=s][,addr=A][,id=name][,aio=threads|native]\n"
- " [,readonly=on|off][,copy-on-read=on|off]\n"
+ " [,workerthreads=pool][,readonly=on|off][,copy-on-read=on|off]\n"
" [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
" [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
" [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
This patch allows the definition which thread pool will be used by every block device. The defintion of the workerthreads option allows this at the command line level. At the moment only the thread pool implementation "pool" can be chosen. Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com> --- blockdev.c | 13 +++++++++++++ qemu-options.hx | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-)