[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 11/17] spapr: Allow boot from vhost-*-scsi backends
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 11/17] spapr: Allow boot from vhost-*-scsi backends |
Date: |
Tue, 6 Jun 2017 12:51:29 +1000 |
From: Felipe Franciosi <address@hidden>
The current implementation of spapr_get_fw_dev_path() doesn't take into
consideration vhost-*-scsi devices. This makes said devices unbootable
on PPC as SLOF is unable to work out the path to scan boot disks.
This makes VMs bootable on spapr when using vhost-*-scsi by implementing
a disk path for VHostSCSICommon (which currently includes both
vhost-user-scsi and vhost-scsi).
Signed-off-by: Felipe Franciosi <address@hidden>
Signed-off-by: Mike Cui <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5d10366..c1c0951 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -57,6 +57,7 @@
#include "hw/pci/pci.h"
#include "hw/scsi/scsi.h"
#include "hw/virtio/virtio-scsi.h"
+#include "hw/virtio/vhost-scsi-common.h"
#include "exec/address-spaces.h"
#include "hw/usb.h"
@@ -2384,6 +2385,7 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p,
BusState *bus,
((type *)object_dynamic_cast(OBJECT(obj), (name)))
SCSIDevice *d = CAST(SCSIDevice, dev, TYPE_SCSI_DEVICE);
sPAPRPHBState *phb = CAST(sPAPRPHBState, dev, TYPE_SPAPR_PCI_HOST_BRIDGE);
+ VHostSCSICommon *vsc = CAST(VHostSCSICommon, dev, TYPE_VHOST_SCSI_COMMON);
if (d) {
void *spapr = CAST(void, bus->parent, "spapr-vscsi");
@@ -2440,6 +2442,12 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p,
BusState *bus,
return g_strdup_printf("address@hidden"PRIX64, phb->buid);
}
+ if (vsc) {
+ /* Same logic as virtio above */
+ unsigned id = 0x1000000 | (vsc->target << 16) | vsc->lun;
+ return g_strdup_printf("address@hidden"PRIX64, (uint64_t)id << 32);
+ }
+
return NULL;
}
--
2.9.4
- [Qemu-ppc] [PULL 09/17] spapr_nvram: Check return value from blk_getlength(), (continued)
- [Qemu-ppc] [PULL 09/17] spapr_nvram: Check return value from blk_getlength(), David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 04/17] spapr: Abolish DRC get_fdt method, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 17/17] spapr: Remove some non-useful properties on DRC objects, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 05/17] spapr: Abolish DRC set_configured method, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 03/17] spapr: Move DRC RTAS calls into spapr_drc.c, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 08/17] target/ppc: Fixup set_spr error in h_register_process_table, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 16/17] spapr: Eliminate spapr_drc_get_type_str(), David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 06/17] spapr: Make DRC get_index and get_type methods into plain functions, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 14/17] spapr: Clean up spapr_dr_connector_by_*(), David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 13/17] spapr: Introduce DRC subclasses, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 11/17] spapr: Allow boot from vhost-*-scsi backends,
David Gibson <=
- [Qemu-ppc] [PULL 15/17] spapr: Move configure-connector state into DRC, David Gibson, 2017/06/05
- Re: [Qemu-ppc] [PULL 00/17] ppc-for-2.10 queue 20170606, Peter Maydell, 2017/06/06