On 03/22/2013 07:44 AM, Michal Privoznik wrote:
Adapt code under src/util/ to fact, that VIR_ALLOC* now reports OOM
error. There is no need to report it twice now.
---
src/util/iohelper.c | 4 +---
src/util/virauthconfig.c | 8 ++------
src/util/vircommand.c | 13 +++----------
src/util/virconf.c | 10 ++--------
src/util/virdnsmasq.c | 19 +++++++------------
src/util/vireventpoll.c | 4 +---
src/util/virfile.c | 4 +---
src/util/virhash.c | 10 ++--------
src/util/virkeyfile.c | 4 +---
src/util/virlockspace.c | 11 +++--------
src/util/virnetdev.c | 4 +---
src/util/virnetdevbandwidth.c | 12 +++---------
src/util/virnetdevmacvlan.c | 4 ++--
src/util/virnetdevvlan.c | 4 +---
src/util/virnetdevvportprofile.c | 4 +---
src/util/virnetlink.c | 8 ++------
src/util/virobject.c | 9 ++++-----
src/util/virpci.c | 13 +++----------
src/util/virprocess.c | 4 +---
src/util/virsexpr.c | 4 +---
src/util/virstoragefile.c | 24 ++++++------------------
src/util/virstring.c | 5 +++--
src/util/virsysinfo.c | 8 +++-----
src/util/virthreadpool.c | 21 +++++----------------
src/util/virtime.c | 8 ++------
src/util/virtypedparam.c | 36 +++++++++---------------------------
src/util/viruri.c | 2 +-
src/util/virusb.c | 8 ++------
src/util/virutil.c | 36 ++++++++----------------------------
src/util/virxml.c | 1 -
30 files changed, 81 insertions(+), 221 deletions(-)
diff --git a/src/util/virxml.c b/src/util/virxml.c
index aa55a33..c8ec805 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -609,7 +609,6 @@ virXPathNodeSet(const char *xpath,
ret = obj->nodesetval->nodeNr;
if (list != NULL && ret) {
if (VIR_ALLOC_N(*list, ret) < 0) {
- virReportOOMError();
ret = -1;
} else {
memcpy(*list, obj->nodesetval->nodeTab,
Maybe an sed script could help here at least in removing the
virReportOOMError, not so easily in removing the '{' and '}'.
Now I doubt we will see lots of OOM errors, but there are a lot more
that may now report twice ...
ACK