When detected invalid 'memAccess', virCPUDefParseXML should report error.
Resolves
https://bugzilla.redhat.com/show_bug.cgi?id=1146334
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/conf/cpu_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 116aa58..a1081b9 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -510,13 +510,13 @@ virCPUDefParseXML(xmlNodePtr node,
def->cells[cur_cell].memAccess =
virMemAccessTypeFromString(memAccessStr);
- if (def->cells[cur_cell].memAccess <= 0) {
+ if ((int)def->cells[cur_cell].memAccess <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Invalid 'memAccess' attribute "
"value '%s'"),
memAccessStr);
VIR_FREE(memAccessStr);
- goto cleanup;
+ goto error;
}
VIR_FREE(memAccessStr);
}
--
1.9.3