Patchwork [2/6] add ahci device into i386 pc just for test.

login
register
mail settings
Submitter 乔崇
Date May 10, 2010, 11:19 p.m.
Message ID <1273533547-21789-3-git-send-email-qiaochong@loongson.cn>
Download mbox | patch
Permalink /patch/52247/
State New
Headers show

Comments

乔崇 - May 10, 2010, 11:19 p.m.
test like this:

dd if=/dev/zero of=/tmp/disk bs=1M count=100
./i386-softmmu/qemu  -cdrom /mnt/hdb1/knoppix-dvd/KNOPPIX_V6.0.1CD-2009-02-08-EN.iso -boot d -drive if=sd,file=/tmp/disk

Signed-off-by: QiaoChong <qiaochong@loongson.cn>
---
 default-configs/i386-softmmu.mak |    2 ++
 hw/pc.c                          |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 4c1495f..bd72f39 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -20,3 +20,5 @@  CONFIG_NE2000_ISA=y
 CONFIG_PIIX_PCI=y
 CONFIG_SOUND=y
 CONFIG_VIRTIO_PCI=y
+CONFIG_AHCI=y
+
diff --git a/hw/pc.c b/hw/pc.c
index db2b9a2..26a1eda 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1005,6 +1005,7 @@  static void pc_init1(ram_addr_t ram_size,
 
     if (pci_enabled) {
         pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
+		pci_create_simple(pci_bus,-1,"ahci");
     } else {
         for(i = 0; i < MAX_IDE_BUS; i++) {
             isa_ide_init(ide_iobase[i], ide_iobase2[i], ide_irq[i],