提交 95ae4e7f 编写于 作者: L Laine Stump

conf: use a unique data type for PF array in virDomainNetDef

This array was originally defined using the existing
virNetworkForwardIfDef, but that struct has a UsageCount field that
isn't used in the case of PFs. This patch just copies that struct and
removes UsageCount. It ends up being a struct with a single field, but
I left it as a struct in case we need to add other fields to it in the
future.
上级 c606671a
......@@ -97,6 +97,12 @@ virNetworkForwardIfDefClear(virNetworkForwardIfDefPtr def)
VIR_FREE(def->dev);
}
static void
virNetworkForwardPfDefClear(virNetworkForwardPfDefPtr def)
{
VIR_FREE(def->dev);
}
static void virNetworkIpDefClear(virNetworkIpDefPtr def)
{
int ii;
......@@ -157,7 +163,7 @@ void virNetworkDefFree(virNetworkDefPtr def)
VIR_FREE(def->domain);
for (ii = 0 ; ii < def->nForwardPfs && def->forwardPfs ; ii++) {
virNetworkForwardIfDefClear(&def->forwardPfs[ii]);
virNetworkForwardPfDefClear(&def->forwardPfs[ii]);
}
VIR_FREE(def->forwardPfs);
......@@ -1113,7 +1119,6 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
goto error;
}
def->forwardPfs->usageCount = 0;
def->forwardPfs->dev = forwardDev;
forwardDev = NULL;
def->nForwardPfs++;
......
......@@ -135,6 +135,12 @@ struct _virNetworkForwardIfDef {
int usageCount; /* how many guest interfaces are bound to this device? */
};
typedef struct _virNetworkForwardPfDef virNetworkForwardPfDef;
typedef virNetworkForwardPfDef *virNetworkForwardPfDefPtr;
struct _virNetworkForwardPfDef {
char *dev; /* name of device */
};
typedef struct _virPortGroupDef virPortGroupDef;
typedef virPortGroupDef *virPortGroupDefPtr;
struct _virPortGroupDef {
......@@ -164,7 +170,7 @@ struct _virNetworkDef {
* interfaces), they will be listed here.
*/
size_t nForwardPfs;
virNetworkForwardIfDefPtr forwardPfs;
virNetworkForwardPfDefPtr forwardPfs;
size_t nForwardIfs;
virNetworkForwardIfDefPtr forwardIfs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册