mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
nwfilter: prevent filters with different name but same UUID
Patch to prevent multiple nwfilters with different name but same UUID.
This commit is contained in:
parent
a33b7b6f35
commit
4cfcde2d83
@ -2399,6 +2399,20 @@ virNWFilterPoolObjAssignDef(virConnectPtr conn,
|
|||||||
{
|
{
|
||||||
virNWFilterPoolObjPtr pool;
|
virNWFilterPoolObjPtr pool;
|
||||||
|
|
||||||
|
pool = virNWFilterPoolObjFindByUUID(pools, def->uuid);
|
||||||
|
|
||||||
|
if (pool) {
|
||||||
|
if (!STREQ(def->name, pool->def->name)) {
|
||||||
|
virNWFilterReportError(VIR_ERR_INVALID_NWFILTER,
|
||||||
|
_("filter with same UUID but different name "
|
||||||
|
"('%s') already exists"),
|
||||||
|
pool->def->name);
|
||||||
|
virNWFilterPoolObjUnlock(pool);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
virNWFilterPoolObjUnlock(pool);
|
||||||
|
}
|
||||||
|
|
||||||
if (virNWFilterDefLoopDetect(conn, pools, def)) {
|
if (virNWFilterDefLoopDetect(conn, pools, def)) {
|
||||||
virNWFilterReportError(VIR_ERR_INVALID_NWFILTER,
|
virNWFilterReportError(VIR_ERR_INVALID_NWFILTER,
|
||||||
"%s", _("filter would introduce a loop"));
|
"%s", _("filter would introduce a loop"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user