[PATCH] Wire up <loader> to set the QEMU BIOS path

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

* src/qemu/qemu_command.c: Wire up -bios with <loader>
* tests/qemuxml2argvdata/qemuxml2argv-bios.args,
  tests/qemuxml2argvdata/qemuxml2argv-bios.xml: Expand
  existing BIOS test case to cover <loader>
---
 src/qemu/qemu_command.c                       |    9 +++++++++
 tests/qemuxml2argvdata/qemuxml2argv-bios.args |    3 ++-
 tests/qemuxml2argvdata/qemuxml2argv-bios.xml  |    1 +
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ea9431f..c82f5bc 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4052,6 +4052,11 @@ qemuBuildCommandLine(virConnectPtr conn,
     if (enableKVM)
         virCommandAddArg(cmd, "-enable-kvm");
 
+    if (def->os.loader) {
+        virCommandAddArg(cmd, "-bios");
+        virCommandAddArg(cmd, def->os.loader);
+    }
+
     /* Set '-m MB' based on maxmem, because the lower 'memory' limit
      * is set post-startup using the balloon driver. If balloon driver
      * is not supported, then they're out of luck anyway.  Update the
@@ -7581,6 +7586,10 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
             WANT_VALUE();
             if (!(def->os.kernel = strdup(val)))
                 goto no_memory;
+        } else if (STREQ(arg, "-bios")) {
+            WANT_VALUE();
+            if (!(def->os.loader = strdup(val)))
+                goto no_memory;
         } else if (STREQ(arg, "-initrd")) {
             WANT_VALUE();
             if (!(def->os.initrd = strdup(val)))
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios.args b/tests/qemuxml2argvdata/qemuxml2argv-bios.args
index f9727c4..ac98000 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-bios.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios.args
@@ -1,5 +1,6 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nodefaults -device sga \
+/usr/bin/qemu -S -M pc -bios /usr/share/seabios/bios.bin \
+-m 1024 -smp 1 -nodefaults -device sga \
 -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
 -hda /dev/HostVG/QEMUGuest1 -serial pty \
 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios.xml b/tests/qemuxml2argvdata/qemuxml2argv-bios.xml
index cfc5587..ac15d45 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-bios.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios.xml
@@ -6,6 +6,7 @@
   <vcpu>1</vcpu>
   <os>
     <type arch='i686' machine='pc'>hvm</type>
+    <loader>/usr/share/seabios/bios.bin</loader>
     <boot dev='hd'/>
     <bootmenu enable='yes'/>
     <bios useserial='yes'/>
-- 
1.7.7.6

--
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]