From dd9f21eaa2efe10a4f14337947fa3b431fc10b5f Mon Sep 17 00:00:00 2001 From: Daniel P. Berrange Date: Jul 08 2008 13:10:54 +0000 Subject: Fix CDROM boot for KVM guests (rhbz #452355) --- diff --git a/libvirt-0.4.4-boot-cdrom.patch b/libvirt-0.4.4-boot-cdrom.patch new file mode 100644 index 0000000..4b35d2b --- /dev/null +++ b/libvirt-0.4.4-boot-cdrom.patch @@ -0,0 +1,99 @@ +diff -rupN libvirt-0.4.4.orig/src/qemu_conf.c libvirt-0.4.4.new/src/qemu_conf.c +--- libvirt-0.4.4.orig/src/qemu_conf.c 2008-06-19 14:15:02.000000000 +0100 ++++ libvirt-0.4.4.new/src/qemu_conf.c 2008-07-08 12:24:07.000000000 +0100 +@@ -2616,7 +2616,8 @@ int qemudBuildCommandLine(virConnectPtr + disk->src, qemudBusIdToName(disk->bus, 1), + media ? media : "", + idx, +- bootable ? ",boot=on" : ""); ++ bootable && disk->device == QEMUD_DISK_DISK ++ ? ",boot=on" : ""); + + ADD_ARG_LIT("-drive"); + ADD_ARG_LIT(opt); +diff -rupN libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args +--- libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args 1970-01-01 01:00:00.000000000 +0100 ++++ libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args 2008-07-08 12:25:59.000000000 +0100 +@@ -0,0 +1 @@ ++/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot d -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb +\ No newline at end of file +diff -rupN libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml +--- libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml 1970-01-01 01:00:00.000000000 +0100 ++++ libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml 2008-07-08 12:20:42.000000000 +0100 +@@ -0,0 +1,26 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219200 ++ 219200 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -rupN libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args +--- libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args 1970-01-01 01:00:00.000000000 +0100 ++++ libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args 2008-07-08 12:13:15.000000000 +0100 +@@ -0,0 +1 @@ ++/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb +\ No newline at end of file +diff -rupN libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml +--- libvirt-0.4.4.orig/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml 1970-01-01 01:00:00.000000000 +0100 ++++ libvirt-0.4.4.new/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml 2008-07-08 12:12:41.000000000 +0100 +@@ -0,0 +1,26 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219200 ++ 219200 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -rupN libvirt-0.4.4.orig/tests/qemuxml2argvtest.c libvirt-0.4.4.new/tests/qemuxml2argvtest.c +--- libvirt-0.4.4.orig/tests/qemuxml2argvtest.c 2008-06-02 10:16:46.000000000 +0100 ++++ libvirt-0.4.4.new/tests/qemuxml2argvtest.c 2008-07-08 12:21:53.000000000 +0100 +@@ -158,6 +158,10 @@ mymain(int argc, char **argv) + QEMUD_CMD_FLAG_DRIVE_BOOT); + DO_TEST("disk-xenvbd", QEMUD_CMD_FLAG_DRIVE | + QEMUD_CMD_FLAG_DRIVE_BOOT); ++ DO_TEST("disk-drive-boot-disk", QEMUD_CMD_FLAG_DRIVE | ++ QEMUD_CMD_FLAG_DRIVE_BOOT); ++ DO_TEST("disk-drive-boot-cdrom", QEMUD_CMD_FLAG_DRIVE | ++ QEMUD_CMD_FLAG_DRIVE_BOOT); + DO_TEST("graphics-vnc", 0); + DO_TEST("graphics-sdl", 0); + DO_TEST("input-usbmouse", 0); diff --git a/libvirt.spec b/libvirt.spec index dc8383a..59b7510 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -28,10 +28,11 @@ Summary: Library providing a simple API virtualization Name: libvirt Version: 0.4.4 -Release: 1%{?dist}%{?extra_release} +Release: 2%{?dist}%{?extra_release} License: LGPL Group: Development/Libraries Source: libvirt-%{version}.tar.gz +Patch1: %{name}-%{version}-boot-cdrom.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root URL: http://libvirt.org/ BuildRequires: python python-devel @@ -141,6 +142,7 @@ of recent versions of Linux (and other OSes). %prep %setup -q +%patch1 -p1 %build %if ! %{with_xen} @@ -279,6 +281,9 @@ fi %doc docs/examples/python %changelog +* Tue Jul 8 2008 Daniel P. Berrange - 0.4.4-2.fc10 +- Fix booting of CDROM images with KVM (rhbz #452355) + * Wed Jun 25 2008 Daniel Veillard - 0.4.4-1.fc10 - upstream release 0.4.4 - fix a few bugs in previous release