mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
e1255ac77e
commit
d9e46835ab
1 file changed
+23
-2
+23
-2
@@ -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);
|
||||
|
||||