diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 0f633da5df..52f24e42a0 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -3058,6 +3058,17 @@ virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters, return NULL; } virNWFilterObjUnlock(nwfilter); + } else { + nwfilter = virNWFilterObjFindByName(nwfilters, def->name); + if (nwfilter) { + char uuidstr[VIR_UUID_STRING_BUFLEN]; + virUUIDFormat(nwfilter->def->uuid, uuidstr); + virReportError(VIR_ERR_OPERATION_FAILED, + _("filter '%s' already exists with uuid %s"), + def->name, uuidstr); + virNWFilterObjUnlock(nwfilter); + return NULL; + } } if (virNWFilterDefLoopDetect(nwfilters, def) < 0) {