From 656151bf5dd299322dcf37d06d20534e667a1963 Mon Sep 17 00:00:00 2001 From: Filip Alac Date: Sat, 12 May 2018 17:45:02 +0200 Subject: [PATCH] xenconfig: xm: Fix checking for extra in parser Parser assumed extra was always present when root was specified. Fixed by handling root and extra separately. Signed-off-by: Filip Alac Reviewed-by: Jim Fehlig --- src/xenconfig/xen_xm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c index 8ef68bbc0e..4becb40b4c 100644 --- a/src/xenconfig/xen_xm.c +++ b/src/xenconfig/xen_xm.c @@ -91,10 +91,13 @@ xenParseXMOS(virConfPtr conf, virDomainDefPtr def) if (xenConfigGetString(conf, "root", &root, NULL) < 0) return -1; - if (root) { + if (root && extra) { if (virAsprintf(&def->os.cmdline, "root=%s %s", root, extra) < 0) return -1; - } else { + } else if (root) { + if (virAsprintf(&def->os.cmdline, "root=%s", root) < 0) + return -1; + } else if (extra) { if (VIR_STRDUP(def->os.cmdline, extra) < 0) return -1; }