mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: domain: Store and restore TLS object alias of a disk
Libvirt uses the stored alias to detach the TLS x509 object on disk unplug. As the alias was not stored, the object would not be detached if unplugging disks after libvirtd restart. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
5e8218fad7
commit
1f1aa21cb9
@ -2023,6 +2023,7 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt,
|
||||
|
||||
src->nodestorage = virXPathString("string(./nodenames/nodename[@type='storage']/@name)", ctxt);
|
||||
src->nodeformat = virXPathString("string(./nodenames/nodename[@type='format']/@name)", ctxt);
|
||||
src->tlsAlias = virXPathString("string(./objects/TLSx509/@alias)", ctxt);
|
||||
|
||||
if (src->pr)
|
||||
src->pr->mgralias = virXPathString("string(./reservations/@mgralias)", ctxt);
|
||||
@ -2102,6 +2103,9 @@ qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src,
|
||||
qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->encinfo, "encryption");
|
||||
}
|
||||
|
||||
if (src->tlsAlias)
|
||||
virBufferAsprintf(&tmp, "<TLSx509 alias='%s'/>\n", src->tlsAlias);
|
||||
|
||||
if (virXMLFormatElement(buf, "objects", NULL, &tmp) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -322,6 +322,7 @@
|
||||
<objects>
|
||||
<secret type='auth' alias='test-auth-alias'/>
|
||||
<secret type='encryption' alias='test-encryption-alias'/>
|
||||
<TLSx509 alias='transport-alias'/>
|
||||
</objects>
|
||||
</privateData>
|
||||
</source>
|
||||
|
Loading…
x
Reference in New Issue
Block a user