From 028275d6da5d9baf52f467da35fe78583181b478 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 5 Nov 2007 10:14:42 +0000 Subject: [PATCH] * src/xml.c: patch from Beth Kon to fix a problem when the cpuset parameter for numa uses cpu maxcpu-1 Daniel --- ChangeLog | 5 +++++ src/xml.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9543602559..4d74a78da6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Nov 5 11:11:45 CET 2007 Daniel Veillard + + * src/xml.c: patch from Beth Kon to fix a problem when the + cpuset parameter for numa uses cpu maxcpu-1 + Thu Nov 1 14:32:07 CET 2007 Daniel Veillard * src/xm_internal.c: patches from Masayuki Sunou to fix a problem diff --git a/src/xml.c b/src/xml.c index 4eca53313e..f2c0ff027c 100644 --- a/src/xml.c +++ b/src/xml.c @@ -126,7 +126,7 @@ parseCpuNumber(const char **str, int maxcpu) while ((*cur >= '0') && (*cur <= '9')) { ret = ret * 10 + (*cur - '0'); - if (ret > maxcpu) + if (ret >= maxcpu) return (-1); cur++; } @@ -1647,6 +1647,8 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, } } free(cpuset); + if (res < 0) + goto error; } else { virXMLError(conn, VIR_ERR_NO_MEMORY, xmldesc, 0); }