bootloader_args is named bootargs in xen-xm

According to <xen-3.4.3/tools/python/xen/xm/create.py:158>
	gopts.var('bootargs', val='NAME',
			  fn=set_value, default=None,
			  use="Arguments to pass to boot loader")
the "bootloader_args" parameter needs to be translated into "bootargs"
when using "virsh domxml-to-native xen-xm".
The reverse direction (domxml-from-native) is already okay.

This patch fixes domxml-to-native and adds two test files to catch this
problem.

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn 2010-08-05 17:07:18 +02:00 committed by Eric Blake
parent 6324949fb1
commit ab8b2bea47
3 changed files with 38 additions and 1 deletions

View File

@ -2346,7 +2346,7 @@ virConfPtr xenXMDomainConfigFormat(virConnectPtr conn,
xenXMConfigSetString(conf, "bootloader", def->os.bootloader) < 0)
goto no_memory;
if (def->os.bootloaderArgs &&
xenXMConfigSetString(conf, "bootloader_args", def->os.bootloaderArgs) < 0)
xenXMConfigSetString(conf, "bootargs", def->os.bootloaderArgs) < 0)
goto no_memory;
if (def->os.kernel &&
xenXMConfigSetString(conf, "kernel", def->os.kernel) < 0)

View File

@ -0,0 +1,11 @@
name = "pvtest"
uuid = "596a5d21-71f4-8fb2-e068-e2386a5c413e"
maxmem = 420
memory = 420
vcpus = 2
bootloader = "/usr/bin/pypxeboot"
bootargs = "mac=AA:00:86:e2:35:72"
on_poweroff = "destroy"
on_reboot = "destroy"
on_crash = "destroy"
disk = [ "file:/root/some.img,xvda,w" ]

View File

@ -0,0 +1,26 @@
<domain type='xen' id='6'>
<name>pvtest</name>
<uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
<memory>430080</memory>
<currentMemory>430080</currentMemory>
<vcpu>2</vcpu>
<bootloader>/usr/bin/pypxeboot</bootloader>
<bootloader_args>mac=AA:00:86:e2:35:72</bootloader_args>
<os>
<type>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
<target type='xen' port='0'/>
</console>
</devices>
</domain>