mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
storage: Clean up storageBackendCreateQemuImgCheckEncryption
Remove the checks for qcow encryption since both callers (create and resize) would have already disallowed usage. Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8f83af6823
commit
9fe597dd09
@ -891,25 +891,7 @@ storageBackendCreateQemuImgCheckEncryption(int format,
|
||||
{
|
||||
virStorageEncryptionPtr enc = vol->target.encryption;
|
||||
|
||||
if (format == VIR_STORAGE_FILE_QCOW || format == VIR_STORAGE_FILE_QCOW2) {
|
||||
if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_QCOW &&
|
||||
enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_DEFAULT) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported volume encryption format %d"),
|
||||
vol->target.encryption->format);
|
||||
return -1;
|
||||
}
|
||||
if (enc->nsecrets > 1) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("too many secrets for qcow encryption"));
|
||||
return -1;
|
||||
}
|
||||
if (enc->nsecrets == 0) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("no secret provided for qcow encryption"));
|
||||
return -1;
|
||||
}
|
||||
} else if (format == VIR_STORAGE_FILE_RAW) {
|
||||
if (format == VIR_STORAGE_FILE_RAW) {
|
||||
if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported volume encryption format %d"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user