mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: domain: Prepare TLS data for the whole backing chain
Iterate through the backing chain when setting up TLS for disks.
This commit is contained in:
parent
beb1661f3d
commit
b0a46b609e
@ -7880,28 +7880,31 @@ int
|
|||||||
qemuDomainPrepareDiskSourceTLS(virStorageSourcePtr src,
|
qemuDomainPrepareDiskSourceTLS(virStorageSourcePtr src,
|
||||||
virQEMUDriverConfigPtr cfg)
|
virQEMUDriverConfigPtr cfg)
|
||||||
{
|
{
|
||||||
|
virStorageSourcePtr next;
|
||||||
|
|
||||||
/* VxHS uses only client certificates and thus has no need for
|
for (next = src; virStorageSourceIsBacking(next); next = next->backingStore) {
|
||||||
* the server-key.pem nor a secret that could be used to decrypt
|
/* VxHS uses only client certificates and thus has no need for
|
||||||
* the it, so no need to add a secinfo for a secret UUID. */
|
* the server-key.pem nor a secret that could be used to decrypt
|
||||||
if (src->type == VIR_STORAGE_TYPE_NETWORK &&
|
* the it, so no need to add a secinfo for a secret UUID. */
|
||||||
src->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS) {
|
if (next->type == VIR_STORAGE_TYPE_NETWORK &&
|
||||||
|
next->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS) {
|
||||||
|
|
||||||
if (src->haveTLS == VIR_TRISTATE_BOOL_ABSENT) {
|
if (next->haveTLS == VIR_TRISTATE_BOOL_ABSENT) {
|
||||||
if (cfg->vxhsTLS)
|
if (cfg->vxhsTLS)
|
||||||
src->haveTLS = VIR_TRISTATE_BOOL_YES;
|
next->haveTLS = VIR_TRISTATE_BOOL_YES;
|
||||||
else
|
else
|
||||||
src->haveTLS = VIR_TRISTATE_BOOL_NO;
|
next->haveTLS = VIR_TRISTATE_BOOL_NO;
|
||||||
src->tlsFromConfig = true;
|
next->tlsFromConfig = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src->haveTLS == VIR_TRISTATE_BOOL_YES) {
|
if (next->haveTLS == VIR_TRISTATE_BOOL_YES) {
|
||||||
/* Grab the vxhsTLSx509certdir and set the verify/listen values.
|
/* Grab the vxhsTLSx509certdir and set the verify/listen values.
|
||||||
* NB: tlsAlias filled in during qemuDomainGetTLSObjects. */
|
* NB: tlsAlias filled in during qemuDomainGetTLSObjects. */
|
||||||
if (VIR_STRDUP(src->tlsCertdir, cfg->vxhsTLSx509certdir) < 0)
|
if (VIR_STRDUP(next->tlsCertdir, cfg->vxhsTLSx509certdir) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
src->tlsVerify = true;
|
next->tlsVerify = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user