Split the formatting by fsdriver type to allow adding a new type.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_command.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3b18282de4..90236620a1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2684,8 +2684,21 @@ qemuBuildFilesystemCommandLine(virCommandPtr cmd,
size_t i;
for (i = 0; i < def->nfss; i++) {
- if (qemuBuildFSDevCommandLine(cmd, def->fss[i], def, qemuCaps) < 0)
- return -1;
+ switch ((virDomainFSDriverType) def->fss[i]->fsdriver) {
+ case VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT:
+ case VIR_DOMAIN_FS_DRIVER_TYPE_PATH:
+ case VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE:
+ /* these drivers are handled by virtio-9p-pci */
+ if (qemuBuildFSDevCommandLine(cmd, def->fss[i], def, qemuCaps) < 0)
+ return -1;
+ break;
+
+ case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
+ case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
+ case VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP:
+ case VIR_DOMAIN_FS_DRIVER_TYPE_LAST:
+ break;
+ }
}
return 0;
--
2.21.0