rpms/kvm/devel kvm-36-pxeboot.patch,NONE,1.1 kvm.spec,1.27,1.28

Daniel P. Berrange (berrange) fedora-extras-commits at redhat.com
Mon Oct 15 18:01:20 UTC 2007


Author: berrange

Update of /cvs/pkgs/rpms/kvm/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29011

Modified Files:
	kvm.spec 
Added Files:
	kvm-36-pxeboot.patch 
Log Message:
Fixed PXE boot

kvm-36-pxeboot.patch:

--- NEW FILE kvm-36-pxeboot.patch ---
commit faa1b77a54e2a2c403f36a134aeb1a238e0cc600
Author: Anthony Liguori <aliguori at us.ibm.com>
Date:   Wed Sep 5 10:35:01 2007 -0500

    kvm: qemu: fix option ROM loading
    
    Make sure to copy the option ROMs into physical memory so they're visible to
    KVM guests.  With the older BIOS, this allows -boot n to work although the CVS
    BIOS does not work.
    
    Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
    Signed-off-by: Avi Kivity <avi at qumranet.com>

diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index e4c5f21..d3b8786 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -588,6 +588,11 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, int boot_device,
 	}
 	cpu_register_physical_memory(0xd0000 + option_rom_offset,
 				     size, offset | IO_MEM_ROM);
+
+	if (kvm_allowed)
+		memcpy(phys_ram_base + 0xd0000 + option_rom_offset,
+		       phys_ram_base + offset, size);
+
 	option_rom_offset += size + 2047;
 	option_rom_offset -= (option_rom_offset % 2048);
     }

commit 10857254ecf04f2327760acd517549ca10971b61
Author: Anthony Liguori <aliguori at us.ibm.com>
Date:   Wed Sep 5 10:35:00 2007 -0500

    kvm: libkvm: round memory to next page
    
    In general, the BIOS, VGA BIOS, and option ROMs are not required to be multiple
    of page sizes.  This means that phys_ram_size may not be a multiple of page.
    Address this at the kvm_create() level to make things simplier for future
    callers.
    
    Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
    Signed-off-by: Avi Kivity <avi at qumranet.com>

diff --git a/user/kvmctl.c b/user/kvmctl.c
index 795e7b3..f358dc1 100644
--- a/user/kvmctl.c
+++ b/user/kvmctl.c
@@ -40,6 +40,7 @@
 static int kvm_abi = EXPECTED_KVM_API_VERSION;
 
 #define PAGE_SIZE 4096ul
+#define PAGE_MASK (~(PAGE_SIZE - 1))
 
 /* FIXME: share this number with kvm */
 /* FIXME: or dynamically alloc/realloc regions */
@@ -242,11 +243,12 @@ int kvm_create_vcpu(kvm_context_t kvm, int slot)
 	return 0;
 }
 
-int kvm_create(kvm_context_t kvm, unsigned long memory, void **vm_mem)
+int kvm_create(kvm_context_t kvm, unsigned long phys_mem_bytes, void **vm_mem)
 {
 	unsigned long dosmem = 0xa0000;
 	unsigned long exmem = 0xc0000;
 	unsigned long pcimem = 0xf0000000;
+	unsigned long memory = (phys_mem_bytes + PAGE_SIZE - 1) & PAGE_MASK;
 	int fd = kvm->fd;
 	int zfd;
 	int r;

commit 4c40db21123acf844001ccac669d9bace396abf5
Author: Anthony Liguori <aliguori at us.ibm.com>
Date:   Wed Sep 5 10:35:02 2007 -0500

    kvm: qemu: fix network boot with newer BIOS
    
    This patch is in QEMU CVS and allows network boot to work with newer BIOSes.
    It was originally written by Bernhard Kauer and committed (and modified) by
    Thiemo Seufer.
    
    Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
    Signed-off-by: Avi Kivity <avi at qumranet.com>

diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index a5c08bc..e4c5f21 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -214,6 +214,9 @@ static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, int boo
     case 'd':
         rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */
         break;
+    case 'n':
+        rtc_set_memory(s, 0x3d, 0x04); /* Expansion ROM boot */
+        break;
     }
 
     /* floppy type */
diff --git a/qemu/vl.c b/qemu/vl.c
index 0a55aae..71e6c0d 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -7529,7 +7529,6 @@ int main(int argc, char **argv)
 	    fprintf(stderr, "No valid PXE rom found for network device\n");
 	    exit(1);
 	}
-	boot_device = 'c'; /* to prevent confusion by the BIOS */
     }
 #endif
 


Index: kvm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kvm/devel/kvm.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- kvm.spec	27 Sep 2007 03:04:28 -0000	1.27
+++ kvm.spec	15 Oct 2007 18:00:47 -0000	1.28
@@ -1,7 +1,7 @@
 Summary: Kernel-based Virtual Machine
 Name: kvm
 Version: 36
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: GPLv2+, LGPLv2+
 Group: Development/Tools
 URL: http://kvm.sf.net
@@ -15,6 +15,7 @@
 Patch102: qemu-atapi-hsm.patch
 Patch103: qemu-0.9.0-vnc-authentication.patch
 Patch104: kvm-rtl8139-checksum.patch
+Patch105: kvm-36-pxeboot.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel 
 # to build the bios
@@ -50,6 +51,7 @@
 %patch102 -p0
 %patch103 -p1 -b .vnc
 %patch104 -p1
+%patch105 -p1
 
 %build
 LDFLAGS=-Wl,--build-id ./configure --with-patched-kernel --qemu-cc=gcc34 --kerneldir=$(pwd)/kernel --prefix=%{_prefix}
@@ -97,6 +99,9 @@
 %{_sysconfdir}/sysconfig/modules/kvm.modules
 
 %changelog
+* Mon Oct 15 2007 Daniel P. Berrange <berrange at redhat.com> - 36-7.fc8
+- Fixed PXE boot when KVM is enabled (rhbz #331191)
+
 * Wed Sep 26 2007 Daniel P. Berrange <berrange at redhat.com> - 36-6.fc8
 - Fixed rtl8139 checksum calculation for Vista (rhbz #308201)
 




More information about the fedora-extras-commits mailing list