(from bug 584777) # cat f kernel = '/boot/vmlinuz-2.6.26-2-xen-amd64' ramdisk = '/boot/initrd.img-2.6.26-2-xen-amd64' memory = '128' root = '/dev/xvda2 ro' disk = [ 'file:/opt/xen/domains/domU/swap.img,xvda1,w', 'file:/opt/xen/domains/domU/disk.img,xvda2,w', ] name = 'domU' dhcp = 'dhcp' vif = [ 'mac=00:16:3E:70:61:00,bridge=xenbr0' ] on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart' # sudo virsh domxml-from-native xen-xm f | grep cmdline <cmdline>root=/dev/xvda2 ro (null)</cmdline> Notice the '(null)' bit. If root= is specified, the code expects that extra= was always specified too. The code is in src/xenconfig/xen_xm.c: if (xenConfigGetString(conf, "extra", &extra, NULL) < 0) return -1; if (xenConfigGetString(conf, "root", &root, NULL) < 0) return -1; if (root) { if (virAsprintf(&def->os.cmdline, "root=%s %s", root, extra) < 0) return -1; } else { if (VIR_STRDUP(def->os.cmdline, extra) < 0) return -1; root and extra need to be handled separately. Note, this can be tested without a xen setup, just drop that xm config in tests/xmconfigdata and extend tests/xmconfigtest.c to test it.
Upstream now: commit 656151bf5dd299322dcf37d06d20534e667a1963 Author: Filip Alac <filipalac> Date: Sat May 12 17:45:02 2018 +0200 xenconfig: xm: Fix checking for extra in parser