diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 790440628c..da150e4cde 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -537,8 +537,18 @@ int openvzLoadDomains(struct openvz_driver *driver) { openvzReadFSConf(dom->def, veid); virUUIDFormat(dom->def->uuid, uuidstr); - if (virHashAddEntry(driver->domains.objs, uuidstr, dom) < 0) + if (virHashLookup(driver->domains.objs, uuidstr)) { + openvzError(VIR_ERR_INTERNAL_ERROR, + _("Duplicate container UUID %s detected for %d"), + uuidstr, + veid); goto cleanup; + } + if (virHashAddEntry(driver->domains.objs, uuidstr, dom) < 0) { + openvzError(VIR_ERR_INTERNAL_ERROR, + _("Could not add UUID for container %d"), veid); + goto cleanup; + } virDomainObjUnlock(dom); dom = NULL;