mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: add privateData to virDomainVsockDef
An object for storing driver-specific data in the vsock definition. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3858da2a14
commit
c20bb30e8d
@ -2030,7 +2030,7 @@ virDomainActualNetDefFree(virDomainActualNetDefPtr def)
|
||||
|
||||
|
||||
virDomainVsockDefPtr
|
||||
virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED)
|
||||
virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt)
|
||||
{
|
||||
virDomainVsockDefPtr ret = NULL;
|
||||
virDomainVsockDefPtr vsock;
|
||||
@ -2038,7 +2038,14 @@ virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED)
|
||||
if (VIR_ALLOC(vsock) < 0)
|
||||
return NULL;
|
||||
|
||||
if (xmlopt &&
|
||||
xmlopt->privateData.vsockNew &&
|
||||
!(vsock->privateData = xmlopt->privateData.vsockNew()))
|
||||
goto cleanup;
|
||||
|
||||
VIR_STEAL_PTR(ret, vsock);
|
||||
cleanup:
|
||||
virDomainVsockDefFree(vsock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2046,6 +2053,10 @@ virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED)
|
||||
void
|
||||
virDomainVsockDefFree(virDomainVsockDefPtr vsock)
|
||||
{
|
||||
if (!vsock)
|
||||
return;
|
||||
|
||||
virObjectUnref(vsock->privateData);
|
||||
VIR_FREE(vsock);
|
||||
}
|
||||
|
||||
|
@ -2315,6 +2315,7 @@ struct _virDomainIOMMUDef {
|
||||
};
|
||||
|
||||
struct _virDomainVsockDef {
|
||||
virObjectPtr privateData;
|
||||
};
|
||||
|
||||
struct _virDomainVirtioOptions {
|
||||
@ -2687,6 +2688,7 @@ struct _virDomainXMLPrivateDataCallbacks {
|
||||
virDomainXMLPrivateDataNewFunc diskNew;
|
||||
virDomainXMLPrivateDataNewFunc vcpuNew;
|
||||
virDomainXMLPrivateDataNewFunc chrSourceNew;
|
||||
virDomainXMLPrivateDataNewFunc vsockNew;
|
||||
virDomainXMLPrivateDataFormatFunc format;
|
||||
virDomainXMLPrivateDataParseFunc parse;
|
||||
/* following function shall return a pointer which will be used as the
|
||||
|
Loading…
x
Reference in New Issue
Block a user