* [Qemu-devel] [PATCH] spapr: Allow boot from vhost-*-scsi backends
@ 2017-06-01 7:51 Felipe Franciosi
2017-06-03 11:54 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: Felipe Franciosi @ 2017-06-01 7:51 UTC (permalink / raw)
To: David Gibson, Alexey Kardashevskiy, Alexander Graf, Paolo Bonzini
Cc: qemu-devel, qemu-ppc, Felipe Franciosi, Mike Cui
This makes VMs bootable on spapr when using vhost-*-scsi.
Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
Signed-off-by: Mike Cui <cui@nutanix.com>
---
hw/ppc/spapr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ab3aab1..1c87886 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"
@@ -2388,6 +2389,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");
@@ -2444,6 +2446,12 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
return g_strdup_printf("pci@%"PRIX64, phb->buid);
}
+ if (vsc) {
+ /* Same logic as virtio above */
+ unsigned id = 0x1000000 | (vsc->target << 16) | vsc->lun;
+ return g_strdup_printf("disk@%"PRIX64, (uint64_t)id << 32);
+ }
+
return NULL;
}
--
1.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr: Allow boot from vhost-*-scsi backends
2017-06-01 7:51 [Qemu-devel] [PATCH] spapr: Allow boot from vhost-*-scsi backends Felipe Franciosi
@ 2017-06-03 11:54 ` David Gibson
2017-06-05 15:56 ` Felipe Franciosi
0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2017-06-03 11:54 UTC (permalink / raw)
To: Felipe Franciosi
Cc: Alexey Kardashevskiy, Alexander Graf, Paolo Bonzini, qemu-devel,
qemu-ppc, Mike Cui
[-- Attachment #1: Type: text/plain, Size: 1863 bytes --]
On Thu, Jun 01, 2017 at 08:51:58AM +0100, Felipe Franciosi wrote:
> This makes VMs bootable on spapr when using vhost-*-scsi.
This commit message needs more information: what previously prevented
vhost-*-scsi from working?
> Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
> Signed-off-by: Mike Cui <cui@nutanix.com>
> ---
> hw/ppc/spapr.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index ab3aab1..1c87886 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"
> @@ -2388,6 +2389,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");
> @@ -2444,6 +2446,12 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
> return g_strdup_printf("pci@%"PRIX64, phb->buid);
> }
>
> + if (vsc) {
> + /* Same logic as virtio above */
> + unsigned id = 0x1000000 | (vsc->target << 16) | vsc->lun;
> + return g_strdup_printf("disk@%"PRIX64, (uint64_t)id << 32);
> + }
> +
> return NULL;
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr: Allow boot from vhost-*-scsi backends
2017-06-03 11:54 ` David Gibson
@ 2017-06-05 15:56 ` Felipe Franciosi
0 siblings, 0 replies; 3+ messages in thread
From: Felipe Franciosi @ 2017-06-05 15:56 UTC (permalink / raw)
To: David Gibson
Cc: Felipe Franciosi, Alexey Kardashevskiy, Alexander Graf,
Paolo Bonzini, qemu-devel, qemu-ppc, Mike Cui
> On 3 Jun 2017, at 12:54, David Gibson <david@gibson.dropbear.id.au> wrote:
>
> On Thu, Jun 01, 2017 at 08:51:58AM +0100, Felipe Franciosi wrote:
>> This makes VMs bootable on spapr when using vhost-*-scsi.
>
> This commit message needs more information: what previously prevented
> vhost-*-scsi from working?
Fair point. I elaborated on the commit message and sent a v2.
Thanks,
F.
>
>> Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
>> Signed-off-by: Mike Cui <cui@nutanix.com>
>> ---
>> hw/ppc/spapr.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index ab3aab1..1c87886 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"
>> @@ -2388,6 +2389,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");
>> @@ -2444,6 +2446,12 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
>> return g_strdup_printf("pci@%"PRIX64, phb->buid);
>> }
>>
>> + if (vsc) {
>> + /* Same logic as virtio above */
>> + unsigned id = 0x1000000 | (vsc->target << 16) | vsc->lun;
>> + return g_strdup_printf("disk@%"PRIX64, (uint64_t)id << 32);
>> + }
>> +
>> return NULL;
>> }
>>
>
> --
> David Gibson | I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
> | _way_ _around_!
> http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-05 15:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01 7:51 [Qemu-devel] [PATCH] spapr: Allow boot from vhost-*-scsi backends Felipe Franciosi
2017-06-03 11:54 ` David Gibson
2017-06-05 15:56 ` Felipe Franciosi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.