提交 8a78f88a 编写于 作者: P Peter Krempa

qemu: domain: Carefuly transfer configuration from disk to storage source

Some properties don't make sense to be configured for every single layer
of the backing chain, but to avoid needing to pass the disk structure we
will copy them to the individual virStorageSource.

Zero detection is applied only for the top layer image, while caching
and iomode for all layers.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 d302b589
...@@ -11834,6 +11834,9 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk, ...@@ -11834,6 +11834,9 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk,
if (!src) if (!src)
src = disk->src; src = disk->src;
/* transfer properties valid only for the top level image */
src->detect_zeroes = disk->detect_zeroes;
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
if (n->type == VIR_STORAGE_TYPE_NETWORK && if (n->type == VIR_STORAGE_TYPE_NETWORK &&
n->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER && n->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER &&
...@@ -11844,6 +11847,11 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk, ...@@ -11844,6 +11847,11 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk,
if (qemuDomainValidateStorageSource(n, qemuCaps) < 0) if (qemuDomainValidateStorageSource(n, qemuCaps) < 0)
return -1; return -1;
/* transfer properties valid for the full chain */
n->iomode = disk->iomode;
n->cachemode = disk->cachemode;
n->discard = disk->discard;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册