qemu: address: take fsdriver type into account

Split the switch by fsdriver type to allow adding a new one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Ján Tomko 2019-07-16 08:27:28 +02:00
parent 83f046458e
commit f363af7e35

View File

@ -672,18 +672,30 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
break; break;
case VIR_DOMAIN_DEVICE_FS: case VIR_DOMAIN_DEVICE_FS:
/* the only type of filesystem so far is virtio-9p-pci */ switch ((virDomainFSDriverType) dev->data.fs->fsdriver) {
switch ((virDomainFSModel) dev->data.fs->model) { case VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT:
case VIR_DOMAIN_FS_MODEL_VIRTIO_TRANSITIONAL: case VIR_DOMAIN_FS_DRIVER_TYPE_PATH:
/* Transitional devices only work in conventional PCI slots */ case VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE:
return pciFlags; /* these drivers are handled by virtio-9p-pci */
case VIR_DOMAIN_FS_MODEL_VIRTIO: switch ((virDomainFSModel) dev->data.fs->model) {
case VIR_DOMAIN_FS_MODEL_VIRTIO_NON_TRANSITIONAL: case VIR_DOMAIN_FS_MODEL_VIRTIO_TRANSITIONAL:
case VIR_DOMAIN_FS_MODEL_DEFAULT: /* Transitional devices only work in conventional PCI slots */
return virtioFlags; return pciFlags;
case VIR_DOMAIN_FS_MODEL_LAST: case VIR_DOMAIN_FS_MODEL_VIRTIO:
break; case VIR_DOMAIN_FS_MODEL_VIRTIO_NON_TRANSITIONAL:
case VIR_DOMAIN_FS_MODEL_DEFAULT:
return virtioFlags;
case VIR_DOMAIN_FS_MODEL_LAST:
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:
return 0;
} }
return 0; return 0;
case VIR_DOMAIN_DEVICE_NET: { case VIR_DOMAIN_DEVICE_NET: {