Explicitly reject unsupported storage types for legacy config generators

New storage types are not implemented in generators for -drive and the
xen config. Explicitly reject them in case of a programming error.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2023-06-09 16:27:57 +02:00
parent db4dd170a2
commit f4fea84f59
2 changed files with 6 additions and 3 deletions

View File

@ -1525,7 +1525,9 @@ xenFormatXLDiskSrc(virStorageSource *src, char **srcstr)
case VIR_STORAGE_TYPE_VHOST_USER:
case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST:
break;
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unsupported storage type for this code path"));
return -1;
}
return 0;

View File

@ -1638,10 +1638,11 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk,
case VIR_STORAGE_TYPE_VHOST_USER:
case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST:
break;
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unsupported storage type for this code path"));
return -1;
}
virBufferAddLit(buf, ",");
if (encinfo) {