diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index ba31263a08..8a4e3fe261 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -556,9 +556,11 @@ - - - + + + + + diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 13ca015577..bd770bc261 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -2261,6 +2261,12 @@ xenFormatSxpr(virConnectPtr conn, } virBufferAddLit(&buf, "))"); + } else { + /* PV domains accept kernel cmdline args */ + if (def->os.cmdline) { + virBufferEscapeSexpr(&buf, "(image (linux (args '%s')))", + def->os.cmdline); + } } for (i = 0 ; i < def->ndisks ; i++) diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-bootloader-cmdline.sexpr b/tests/sexpr2xmldata/sexpr2xml-pv-bootloader-cmdline.sexpr new file mode 100644 index 0000000000..67c9a6008b --- /dev/null +++ b/tests/sexpr2xmldata/sexpr2xml-pv-bootloader-cmdline.sexpr @@ -0,0 +1,5 @@ +(domain (domid 6)(name 'pvtest')(memory 420)(maxmem 420)(vcpus 2)\ +(uuid '596a5d2171f48fb2e068e2386a5c413e')(bootloader '/usr/bin/pygrub')\ +(bootloader_args '-q')(image (linux (args 'xenfb.video=8,1280,1024')))\ +(on_poweroff 'destroy')(on_reboot 'destroy')(on_crash 'destroy')\ +(device (vbd (dev 'xvda')(uname 'file:/root/some.img')(mode 'w')))) diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-bootloader-cmdline.xml b/tests/sexpr2xmldata/sexpr2xml-pv-bootloader-cmdline.xml new file mode 100644 index 0000000000..b336d77e40 --- /dev/null +++ b/tests/sexpr2xmldata/sexpr2xml-pv-bootloader-cmdline.xml @@ -0,0 +1,27 @@ + + pvtest + 596a5d21-71f4-8fb2-e068-e2386a5c413e + 430080 + 430080 + 2 + /usr/bin/pygrub + -q + + linux + xenfb.video=8,1280,1024 + + + destroy + destroy + destroy + + + + + + + + + + + diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index f393935a73..26a987dbce 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -134,6 +134,7 @@ mymain(void) DO_TEST("pv-vfb-type-crash", "pv-vfb-type-crash", 3); DO_TEST("fv-autoport", "fv-autoport", 3); DO_TEST("pv-bootloader", "pv-bootloader", 1); + DO_TEST("pv-bootloader-cmdline", "pv-bootloader-cmdline", 1); DO_TEST("pv-vcpus", "pv-vcpus", 1); DO_TEST("disk-file", "disk-file", 2); diff --git a/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr index 8c0b1cdff4..b8387e597e 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr @@ -1,6 +1,7 @@ (vm (name 'pvtest')(memory 384)(maxmem 512)(vcpus 1)\ (uuid '49a0c6ff-c066-5392-6498-3632d093c2e7')(bootloader '/usr/bin/pygrub')\ (on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')\ +(image (linux (args 'ro root=/dev/VolGroup00/LogVol00')))\ (device (tap (dev 'xvda')(uname 'tap:aio:/var/lib/xen/images/rhel5pv.img')\ (mode 'w!')))(device (vif (mac '00:16:3e:23:9e:eb')(bridge 'xenbr0')\ (script 'vif-bridge'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr b/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr new file mode 100644 index 0000000000..236017e768 --- /dev/null +++ b/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr @@ -0,0 +1,5 @@ +(vm (name 'pvtest')(memory 420)(maxmem 420)(vcpus 2)\ +(uuid '596a5d21-71f4-8fb2-e068-e2386a5c413e')(bootloader '/usr/bin/pygrub')\ +(bootloader_args '-q')(on_poweroff 'destroy')(on_reboot 'destroy')\ +(on_crash 'destroy')(image (linux (args 'xenfb.video=8,1280,1024')))\ +(device (vbd (dev 'xvda')(uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.xml b/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.xml new file mode 100644 index 0000000000..40bff6bae5 --- /dev/null +++ b/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.xml @@ -0,0 +1,22 @@ + + pvtest + 596a5d2171f48fb2e068e2386a5c413e + /usr/bin/pygrub + -q + + linux + xenfb.video=8,1280,1024 + + 430080 + 2 + destroy + destroy + destroy + + + + + + + + diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index d8cdcbbe5b..e068e696a1 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -116,6 +116,7 @@ mymain(void) DO_TEST("pv-vfb-new", "pv-vfb-new", "pvtest", 3); DO_TEST("pv-vfb-new-auto", "pv-vfb-new-auto", "pvtest", 3); DO_TEST("pv-bootloader", "pv-bootloader", "pvtest", 1); + DO_TEST("pv-bootloader-cmdline", "pv-bootloader-cmdline", "pvtest", 1); DO_TEST("pv-vcpus", "pv-vcpus", "pvtest", 1); DO_TEST("disk-file", "disk-file", "pvtest", 2);