提交 c46fc572 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
上级 3d14408c
......@@ -822,12 +822,13 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr enc,
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
if (info.format == VIR_STORAGE_FILE_RAW && enc) {
virQEMUBuildQemuImgKeySecretOpts(&buf, enc, info.secretAlias);
} else {
if (info.backingPath)
virBufferAsprintf(&buf, "backing_fmt=%s,",
virStorageFileFormatTypeToString(info.backingFormat));
if (info.format == VIR_STORAGE_FILE_RAW && enc) {
virQEMUBuildQemuImgKeySecretOpts(&buf, enc, info.secretAlias);
} else {
if (info.encryption)
virBufferAddLit(&buf, "encryption=on,");
if (info.preallocate) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册