mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
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 <filipalac@gmail.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
1 parent
e387a1d796
commit
656151bf5d
1 file changed
+5
-2
@@ -91,10 +91,13 @@ xenParseXMOS(virConfPtr conf, virDomainDefPtr def)
|
|||||||
if (xenConfigGetString(conf, "root", &root, NULL) < 0)
|
if (xenConfigGetString(conf, "root", &root, NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (root) {
|
if (root && extra) {
|
||||||
if (virAsprintf(&def->os.cmdline, "root=%s %s", root, extra) < 0)
|
if (virAsprintf(&def->os.cmdline, "root=%s %s", root, extra) < 0)
|
||||||
return -1;
|
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)
|
if (VIR_STRDUP(def->os.cmdline, extra) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user