mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
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: John Ferlan <jferlan@redhat.com>
This commit is contained in:
1 parent
c46fc572be
commit
b5c8c547b7
1 file changed
+7
-6
@@ -831,12 +831,13 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr enc,
|
||||
} else {
|
||||
if (info.encryption)
|
||||
virBufferAddLit(&buf, "encryption=on,");
|
||||
if (info.preallocate) {
|
||||
if (info.size_arg > info.allocation)
|
||||
virBufferAddLit(&buf, "preallocation=metadata,");
|
||||
else
|
||||
virBufferAddLit(&buf, "preallocation=falloc,");
|
||||
}
|
||||
}
|
||||
|
||||
if (info.preallocate) {
|
||||
if (info.size_arg > info.allocation)
|
||||
virBufferAddLit(&buf, "preallocation=metadata,");
|
||||
else
|
||||
virBufferAddLit(&buf, "preallocation=falloc,");
|
||||
}
|
||||
|
||||
if (info.nocow)
|
||||
|
||||
Reference in new issue
Block a user