Introduce virDomainVsockDef

A type to represent the new vsock device.
Also implement an allocation function to allow future addition
of private data.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Ján Tomko 2018-05-22 10:37:50 +02:00
parent ff57a713a4
commit 3858da2a14
3 changed files with 31 additions and 0 deletions

View File

@ -2028,6 +2028,28 @@ virDomainActualNetDefFree(virDomainActualNetDefPtr def)
VIR_FREE(def);
}
virDomainVsockDefPtr
virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED)
{
virDomainVsockDefPtr ret = NULL;
virDomainVsockDefPtr vsock;
if (VIR_ALLOC(vsock) < 0)
return NULL;
VIR_STEAL_PTR(ret, vsock);
return ret;
}
void
virDomainVsockDefFree(virDomainVsockDefPtr vsock)
{
VIR_FREE(vsock);
}
void
virDomainNetDefClear(virDomainNetDefPtr def)
{

View File

@ -157,6 +157,9 @@ typedef virDomainTPMDef *virDomainTPMDefPtr;
typedef struct _virDomainIOMMUDef virDomainIOMMUDef;
typedef virDomainIOMMUDef *virDomainIOMMUDefPtr;
typedef struct _virDomainVsockDef virDomainVsockDef;
typedef virDomainVsockDef *virDomainVsockDefPtr;
typedef struct _virDomainVirtioOptions virDomainVirtioOptions;
typedef virDomainVirtioOptions *virDomainVirtioOptionsPtr;
@ -2311,6 +2314,9 @@ struct _virDomainIOMMUDef {
virTristateSwitch iotlb;
};
struct _virDomainVsockDef {
};
struct _virDomainVirtioOptions {
virTristateSwitch iommu;
virTristateSwitch ats;
@ -2800,6 +2806,8 @@ bool virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont);
virDomainFSDefPtr virDomainFSDefNew(void);
void virDomainFSDefFree(virDomainFSDefPtr def);
void virDomainActualNetDefFree(virDomainActualNetDefPtr def);
virDomainVsockDefPtr virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt);
void virDomainVsockDefFree(virDomainVsockDefPtr vsock);
void virDomainNetDefClear(virDomainNetDefPtr def);
void virDomainNetDefFree(virDomainNetDefPtr def);
void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def);

View File

@ -574,6 +574,7 @@ virDomainVideoVGAConfTypeFromString;
virDomainVideoVGAConfTypeToString;
virDomainVirtTypeFromString;
virDomainVirtTypeToString;
virDomainVsockDefNew;
virDomainWatchdogActionTypeFromString;
virDomainWatchdogActionTypeToString;
virDomainWatchdogDefFree;