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

storage_util: Split preallocate set in storageBackendCreateQemuImgOpts

The only way preallocate 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>
上级 c46fc572
...@@ -831,13 +831,14 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr enc, ...@@ -831,13 +831,14 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr enc,
} else { } else {
if (info.encryption) if (info.encryption)
virBufferAddLit(&buf, "encryption=on,"); virBufferAddLit(&buf, "encryption=on,");
}
if (info.preallocate) { if (info.preallocate) {
if (info.size_arg > info.allocation) if (info.size_arg > info.allocation)
virBufferAddLit(&buf, "preallocation=metadata,"); virBufferAddLit(&buf, "preallocation=metadata,");
else else
virBufferAddLit(&buf, "preallocation=falloc,"); virBufferAddLit(&buf, "preallocation=falloc,");
} }
}
if (info.nocow) if (info.nocow)
virBufferAddLit(&buf, "nocow=on,"); virBufferAddLit(&buf, "nocow=on,");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册