mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 07:22:07 +03:00
network: allow VIR_NETWORK_DEFINE_VALIDATE flag
Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8555dee6ba
commit
cc195a2da6
@ -292,13 +292,13 @@ esxNetworkDefineXMLFlags(virConnectPtr conn, const char *xml,
|
||||
|
||||
unsigned char md5[VIR_CRYPTO_HASH_SIZE_MD5]; /* VIR_CRYPTO_HASH_SIZE_MD5 = VIR_UUID_BUFLEN = 16 */
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
virCheckFlags(VIR_NETWORK_DEFINE_VALIDATE, NULL);
|
||||
|
||||
if (esxVI_EnsureSession(priv->primary) < 0)
|
||||
return NULL;
|
||||
|
||||
/* Parse network XML */
|
||||
def = virNetworkDefParseString(xml, NULL, 0);
|
||||
def = virNetworkDefParseString(xml, NULL, flags);
|
||||
|
||||
if (!def)
|
||||
return NULL;
|
||||
|
@ -3527,9 +3527,9 @@ networkDefineXMLFlags(virConnectPtr conn,
|
||||
virNetworkPtr net = NULL;
|
||||
virObjectEvent *event = NULL;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
virCheckFlags(VIR_NETWORK_DEFINE_VALIDATE, NULL);
|
||||
|
||||
if (!(def = virNetworkDefParseString(xml, network_driver->xmlopt, 0)))
|
||||
if (!(def = virNetworkDefParseString(xml, network_driver->xmlopt, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virNetworkDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
@ -5618,9 +5618,9 @@ testNetworkDefineXMLFlags(virConnectPtr conn,
|
||||
virNetworkPtr net = NULL;
|
||||
virObjectEvent *event = NULL;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
virCheckFlags(VIR_NETWORK_DEFINE_VALIDATE, NULL);
|
||||
|
||||
if ((newDef = virNetworkDefParseString(xml, NULL, 0)) == NULL)
|
||||
if ((newDef = virNetworkDefParseString(xml, NULL, flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (!(obj = virNetworkObjAssignDef(privconn->networks, newDef, 0)))
|
||||
|
@ -386,7 +386,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start,
|
||||
virNetworkPtr ret = NULL;
|
||||
nsresult rc;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
virCheckFlags(VIR_NETWORK_DEFINE_VALIDATE, NULL);
|
||||
|
||||
if (!data->vboxObj)
|
||||
return ret;
|
||||
@ -397,7 +397,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start,
|
||||
|
||||
VBOX_IID_INITIALIZE(&vboxnetiid);
|
||||
|
||||
if (!(def = virNetworkDefParseString(xml, NULL, 0)) ||
|
||||
if (!(def = virNetworkDefParseString(xml, NULL, flags)) ||
|
||||
(def->forward.type != VIR_NETWORK_FORWARD_NONE) ||
|
||||
(def->nips == 0 || !def->ips))
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user