]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: add support for splash-timeout
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 22 Aug 2014 12:13:37 +0000 (14:13 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 25 Aug 2014 12:11:41 +0000 (14:11 +0200)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1021703

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args [new file with mode: 0644]
tests/qemuxml2argvtest.c

index 0d7b12dade3bd36cea15210c0d90f1a239415bce..6dac9d3045733d81adc910189a4800b63396d388 100644 (file)
@@ -7927,6 +7927,21 @@ qemuBuildCommandLine(virConnectPtr conn,
                               def->os.bios.rt_delay);
         }
 
+        if (def->os.bm_timeout_set) {
+            if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPLASH_TIMEOUT)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("splash timeout is not supported "
+                                 "by this QEMU binary"));
+                virBufferFreeAndReset(&boot_buf);
+                goto error;
+            }
+
+            if (boot_nparams++)
+                virBufferAddChar(&boot_buf, ',');
+
+            virBufferAsprintf(&boot_buf, "splash-time=%u", def->os.bm_timeout);
+        }
+
         if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOT_STRICT)) {
             if (boot_nparams++)
                 virBufferAddChar(&boot_buf, ',');
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args
new file mode 100644 (file)
index 0000000..6141259
--- /dev/null
@@ -0,0 +1,15 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-S \
+-M pc \
+-m 214 \
+-smp 1 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot order=d,menu=on,splash-time=3000 \
+-usb \
+-drive file=/dev/cdrom,if=none,media=cdrom,id=drive-ide0-1-0 \
+-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 6255b51ab9ee3a2411fea042b5499737ed7a0c0f..74072723d345f945fa6a40b2772309854a671f99 100644 (file)
@@ -607,6 +607,10 @@ mymain(void)
     DO_TEST("boot-menu-enable",
             QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
             QEMU_CAPS_BOOTINDEX);
+    DO_TEST("boot-menu-enable-with-timeout",
+            QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE,
+            QEMU_CAPS_DRIVE, QEMU_CAPS_SPLASH_TIMEOUT);
+    DO_TEST_FAILURE("boot-menu-enable-with-timeout", QEMU_CAPS_BOOT_MENU);
     DO_TEST_PARSE_ERROR("boot-menu-enable-with-timeout-invalid", NONE);
     DO_TEST("boot-menu-disable", QEMU_CAPS_BOOT_MENU);
     DO_TEST("boot-menu-disable-drive",