Commit 8a073d01 authored by Ian Campbell's avatar Ian Campbell

libxl: do not start a xenpv qemu solely for tap devices if blktap is available

qemu is used as a fallback for DISK_BACKEND_TAP if no blktap is
available but if blktap is available, or for DISK_BACKEND_PHY, we
don't need a qemu process.
Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
Acked-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
Committed-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
parent 4867ed76
......@@ -828,8 +828,29 @@ int libxl__need_xenpv_qemu(libxl_ctx *ctx,
goto out;
}
if (nr_disks > 0 && !libxl__blktap_enabled(&gc))
ret = 1;
if (nr_disks > 0) {
int blktap_enabled = -1;
for (i = 0; i < nr_disks; i++) {
switch (disks[i].backend) {
case DISK_BACKEND_TAP:
if (blktap_enabled == -1)
blktap_enabled = libxl__blktap_enabled(&gc);
if (!blktap_enabled) {
ret = 1;
goto out;
}
break;
case DISK_BACKEND_QDISK:
ret = 1;
goto out;
case DISK_BACKEND_PHY:
case DISK_BACKEND_UNKNOWN:
break;
}
}
}
out:
libxl__free_all(&gc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment