From mboxrd@z Thu Jan 1 00:00:00 1970 From: ehrhardt@linux.vnet.ibm.com Date: Tue, 01 Apr 2008 12:01:15 +0000 Subject: [kvm-ppc-devel] [PATCH] kvm(ppc)-userspace: initialize virtio-block Message-Id: <1207051275240-git-send-email-ehrhardt@linux.vnet.ibm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org From: Christian Ehrhardt virtio-block support is atm initialized in qemu/hw/pc.c which is only called for the "standart pc" platform. In our case we need to call the virtio-block initialization from our platform init. It might be worth moving this initialization into a funvtion in virtio-block.c and only call that initializer from any platform init that supports virtio - any suggestions/preferences if we should do it now or when another architecture needs that - Anthony ? This patch adds that initialization for the kvmppc bamboo platform. Signed-off-by: Christian Ehrhardt --- [diffstat] ppc440_bamboo.c | 13 +++++++++++++ 1 files changed, 13 insertions(+) diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c --- a/qemu/hw/ppc440_bamboo.c +++ b/qemu/hw/ppc440_bamboo.c @@ -13,6 +13,7 @@ #include "net.h" #include "hw.h" #include "pci.h" +#include "sysemu.h" #include "ppc440.h" #include "qemu-kvm.h" #include "device_tree.h" @@ -185,6 +186,18 @@ void bamboo_init(ram_addr_t ram_size, in pci_nic_init(pci->bus, nd, -1); } + /* Add virtio block devices */ + if (pci) { + int index; + int unit_id = 0; + + while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) { + virtio_blk_init(pci->bus, 0x1AF4, 0x1001, + drives_table[index].bdrv); + unit_id++; + } + } + printf("%s: DONE\n", __func__); } ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ kvm-ppc-devel mailing list kvm-ppc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel