mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
storage_util: Split backing_fmt set in storageBackendCreateQemuImgOpts
The only way backing_fmts could be set is if the info->format was not RAW (see storageBackendCreateQemuImgSetBacking), so let's just extract it from the if/else surrounding the application of the encryption options. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
3d14408c17
commit
c46fc572be
@ -822,12 +822,13 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr enc,
|
|||||||
{
|
{
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (info.format == VIR_STORAGE_FILE_RAW && enc) {
|
|
||||||
virQEMUBuildQemuImgKeySecretOpts(&buf, enc, info.secretAlias);
|
|
||||||
} else {
|
|
||||||
if (info.backingPath)
|
if (info.backingPath)
|
||||||
virBufferAsprintf(&buf, "backing_fmt=%s,",
|
virBufferAsprintf(&buf, "backing_fmt=%s,",
|
||||||
virStorageFileFormatTypeToString(info.backingFormat));
|
virStorageFileFormatTypeToString(info.backingFormat));
|
||||||
|
|
||||||
|
if (info.format == VIR_STORAGE_FILE_RAW && enc) {
|
||||||
|
virQEMUBuildQemuImgKeySecretOpts(&buf, enc, info.secretAlias);
|
||||||
|
} else {
|
||||||
if (info.encryption)
|
if (info.encryption)
|
||||||
virBufferAddLit(&buf, "encryption=on,");
|
virBufferAddLit(&buf, "encryption=on,");
|
||||||
if (info.preallocate) {
|
if (info.preallocate) {
|
||||||
|
Loading…
Reference in New Issue
Block a user