diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 01a5b2ce2c..351daf7683 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -394,10 +394,8 @@ VIR_ENUM_IMPL(virDomainTimerMode, VIR_DOMAIN_TIMER_MODE_LAST, int virDomainObjListInit(virDomainObjListPtr doms) { doms->objs = virHashCreate(50); - if (!doms->objs) { - virReportOOMError(); + if (!doms->objs) return -1; - } return 0; } @@ -1061,7 +1059,6 @@ virDomainObjPtr virDomainAssignDef(virCapsPtr caps, virUUIDFormat(def->uuid, uuidstr); if (virHashAddEntry(doms->objs, uuidstr, domain) < 0) { VIR_FREE(domain); - virReportOOMError(); return NULL; } @@ -8189,10 +8186,8 @@ static virDomainObjPtr virDomainLoadStatus(virCapsPtr caps, goto error; } - if (virHashAddEntry(doms->objs, uuidstr, obj) < 0) { - virReportOOMError(); + if (virHashAddEntry(doms->objs, uuidstr, obj) < 0) goto error; - } if (notify) (*notify)(obj, 1, opaque); @@ -8750,7 +8745,6 @@ virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr s if (virHashAddEntry(snapshots->objs, snap->def->name, snap) < 0) { VIR_FREE(snap); - virReportOOMError(); return NULL; } @@ -8761,10 +8755,8 @@ virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr s int virDomainSnapshotObjListInit(virDomainSnapshotObjListPtr snapshots) { snapshots->objs = virHashCreate(50); - if (!snapshots->objs) { - virReportOOMError(); + if (!snapshots->objs) return -1; - } return 0; } @@ -9053,10 +9045,8 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk, _("could not close file %s"), path); - if (virHashAddEntry(paths, path, (void*)0x1) < 0) { - virReportOOMError(); + if (virHashAddEntry(paths, path, (void*)0x1) < 0) goto cleanup; - } depth++; nextpath = meta.backingStore; diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index a5703cb8b7..c6a4d6f6d7 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -2300,10 +2300,8 @@ virNWFilterTriggerVMFilterRebuild(virConnectPtr conn) .skipInterfaces = virHashCreate(0), }; - if (!cb.skipInterfaces) { - virReportOOMError(); + if (!cb.skipInterfaces) return 1; - } for (i = 0; i < nCallbackDriver; i++) { callbackDrvArray[i]->vmFilterRebuild(conn, diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 7a5938745b..23423fa8ea 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -121,7 +121,6 @@ virNWFilterHashTableCreate(int n) { } ret->hashTable = virHashCreate(n); if (!ret->hashTable) { - virReportOOMError(); VIR_FREE(ret); return NULL; } diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 9ef36925e1..d81aac8bb3 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -1037,8 +1037,6 @@ virNWFilterDomainFWUpdateCB(void *payload, cb->err = virHashAddEntry(cb->skipInterfaces, net->ifname, (void *)~0); - if (cb->err) - virReportOOMError(); } break; diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c index c593481631..02af9188b1 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -165,7 +165,6 @@ virNWFilterLockIface(const char *ifname) { } while (virHashAddEntry(ifaceLockMap, ifname, ifaceLock)) { - virReportOOMError(); VIR_FREE(ifaceLock); goto err_exit; } @@ -825,7 +824,6 @@ virNWFilterLearnInit(void) { pendingLearnReq = virHashCreate(0); if (!pendingLearnReq) { - virReportOOMError(); return 1; } @@ -848,7 +846,6 @@ virNWFilterLearnInit(void) { ifaceLockMap = virHashCreate(0); if (!ifaceLockMap) { - virReportOOMError(); virNWFilterLearnShutdown(); return 1; } diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index dae66a5c27..0eb5ab3075 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -526,7 +526,7 @@ int openvzLoadDomains(struct openvz_driver *driver) { virUUIDFormat(dom->def->uuid, uuidstr); if (virHashAddEntry(driver->domains.objs, uuidstr, dom) < 0) - goto no_memory; + goto cleanup; virDomainObjUnlock(dom); dom = NULL; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 618d3a97d4..c9feb9b0b7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -753,7 +753,7 @@ qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def) goto no_memory; if (!(addrs->used = virHashCreate(10))) - goto no_memory; + goto error; if (virDomainDeviceInfoIterate(def, qemuCollectPCIAddress, addrs) < 0) goto error; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 46da600a99..5237e2b08a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -995,10 +995,8 @@ qemuProcessWaitForMonitor(struct qemud_driver* driver, * Note that the monitor itself can be on a pty, so we still need to try the * log output method. */ paths = virHashCreate(0); - if (paths == NULL) { - virReportOOMError(); + if (paths == NULL) goto cleanup; - } qemuDomainObjEnterMonitorWithDriver(driver, vm); qemuDomainObjPrivatePtr priv = vm->privateData;