mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
conf: make teaming info an official type
This struct was previously defined only within virDomainNetDef where it was used, but I need to also use it in virDomainHostdevDef, so move the internal struct out to its own "official" struct and give it the standard typedef duo and *Free() function. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
114e3b4232
commit
5d74e2f168
@ -2476,6 +2476,17 @@ virDomainVsockDefFree(virDomainVsockDefPtr vsock)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
virDomainNetTeamingInfoFree(virDomainNetTeamingInfoPtr teaming)
|
||||
{
|
||||
if (!teaming)
|
||||
return;
|
||||
|
||||
g_free(teaming->persistent);
|
||||
g_free(teaming);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
virDomainNetDefFree(virDomainNetDefPtr def)
|
||||
{
|
||||
|
@ -956,6 +956,11 @@ typedef enum {
|
||||
VIR_DOMAIN_NET_TEAMING_TYPE_LAST
|
||||
} virDomainNetTeamingType;
|
||||
|
||||
struct _virDomainNetTeamingInfo {
|
||||
virDomainNetTeamingType type;
|
||||
char *persistent; /* alias name of persistent device */
|
||||
};
|
||||
|
||||
/* link interface states */
|
||||
typedef enum {
|
||||
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT = 0, /* Default link state (up) */
|
||||
@ -1033,10 +1038,7 @@ struct _virDomainNetDef {
|
||||
char *tap;
|
||||
char *vhost;
|
||||
} backend;
|
||||
struct {
|
||||
virDomainNetTeamingType type;
|
||||
char *persistent; /* alias name of persistent device */
|
||||
} teaming;
|
||||
virDomainNetTeamingInfo teaming;
|
||||
union {
|
||||
virDomainChrSourceDefPtr vhostuser;
|
||||
struct {
|
||||
@ -3100,6 +3102,8 @@ void virDomainActualNetDefFree(virDomainActualNetDefPtr def);
|
||||
virDomainVsockDefPtr virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt);
|
||||
void virDomainVsockDefFree(virDomainVsockDefPtr vsock);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainVsockDef, virDomainVsockDefFree);
|
||||
void virDomainNetTeamingInfoFree(virDomainNetTeamingInfoPtr teaming);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainNetTeamingInfo, virDomainNetTeamingInfoFree);
|
||||
void virDomainNetDefFree(virDomainNetDefPtr def);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainNetDef, virDomainNetDefFree);
|
||||
void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def);
|
||||
|
@ -246,6 +246,9 @@ typedef virDomainNVRAMDef *virDomainNVRAMDefPtr;
|
||||
typedef struct _virDomainNetDef virDomainNetDef;
|
||||
typedef virDomainNetDef *virDomainNetDefPtr;
|
||||
|
||||
typedef struct _virDomainNetTeamingInfo virDomainNetTeamingInfo;
|
||||
typedef virDomainNetTeamingInfo *virDomainNetTeamingInfoPtr;
|
||||
|
||||
typedef struct _virDomainOSDef virDomainOSDef;
|
||||
typedef virDomainOSDef *virDomainOSDefPtr;
|
||||
|
||||
|
@ -537,6 +537,7 @@ virDomainNetRemove;
|
||||
virDomainNetRemoveHostdev;
|
||||
virDomainNetResolveActualType;
|
||||
virDomainNetSetModelString;
|
||||
virDomainNetTeamingInfoFree;
|
||||
virDomainNetTypeFromString;
|
||||
virDomainNetTypeSharesHostView;
|
||||
virDomainNetTypeToString;
|
||||
|
Loading…
Reference in New Issue
Block a user