Do not allow changing the UUID of a nwfilter

https://bugzilla.redhat.com/show_bug.cgi?id=1077009
This commit is contained in:
Hu Jianwei 2014-07-07 15:55:16 +02:00 committed by Ján Tomko
parent ba8c83614a
commit 46a811db07

View File

@ -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) {