[PATCH] bootloader_args is named bootargs in xen-xm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 src/xen/xm_internal.c                          |    2 +-
 tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg |   12 +++++++++++
 tests/xmconfigdata/sexpr2xml-pv-bootloader.xml |   26 
++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletions(-)
 create mode 100644 tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg
 create mode 100644 tests/xmconfigdata/sexpr2xml-pv-bootloader.xml
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 20b828d..153c7a5 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -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)
diff --git a/tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg b/tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg
new file mode 100644
index 0000000..64b6a9a
--- /dev/null
+++ b/tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg
@@ -0,0 +1,12 @@
+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" ]
+
diff --git a/tests/xmconfigdata/sexpr2xml-pv-bootloader.xml b/tests/xmconfigdata/sexpr2xml-pv-bootloader.xml
new file mode 100644
index 0000000..920c058
--- /dev/null
+++ b/tests/xmconfigdata/sexpr2xml-pv-bootloader.xml
@@ -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>
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]