Patchwork [1.0,v2] scsi: fix fw path

login
register
mail settings
Submitter Paolo Bonzini
Date Nov. 18, 2011, 1:59 p.m.
Message ID <4EC664AD.9080307@redhat.com>
Download mbox | patch
Permalink /patch/126411/
State New
Headers show

Comments

Paolo Bonzini - Nov. 18, 2011, 1:59 p.m.
On 11/18/2011 02:36 PM, Andreas Färber wrote:
> Am 18.11.2011 13:35, schrieb Kevin Wolf:
>> Am 15.11.2011 17:36, schrieb Paolo Bonzini:
>>> The pre-1.0 firmware path for SCSI devices already included the LUN
>>> using the suffix argument to add_boot_device_path.  I missed that when
>>> making channel and LUN customizable.  Avoid that it is included twice, and
>>> convert the colons to commas for consistency with other kinds of devices
>>>
>>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>>> ---
>>> 	v1->v2: include scsi-disk hunk too
>>
>> Thanks, applied to the block-stable branch (for 1.0)
>
> Did you guys check the consistency part against OpenFirmware syntax? I
> didn't get around to that yet.

No, I wasn't aware about the existence of an OF spec for that (only that 
fw_dev_path design was roughly corresponding to OF).  Based on 
http://www.openfirmware.org/ofwg/practice/spi/spi1_0.ps it looks like 
this (followup) patch would be preferrable:


Kevin, how do you want to proceed?

Paolo
Paolo Bonzini - Nov. 18, 2011, 2:07 p.m.
On 11/18/2011 03:10 PM, Kevin Wolf wrote:
> Whatever you think is best. I already included the other patch in the
> pull request, so any other change would have to be on top.

Ok, I'll put together a formal patch today and test it with seabios.

Paolo
Kevin Wolf - Nov. 18, 2011, 2:10 p.m.
Am 18.11.2011 14:59, schrieb Paolo Bonzini:
> On 11/18/2011 02:36 PM, Andreas Färber wrote:
>> Am 18.11.2011 13:35, schrieb Kevin Wolf:
>>> Am 15.11.2011 17:36, schrieb Paolo Bonzini:
>>>> The pre-1.0 firmware path for SCSI devices already included the LUN
>>>> using the suffix argument to add_boot_device_path.  I missed that when
>>>> making channel and LUN customizable.  Avoid that it is included twice, and
>>>> convert the colons to commas for consistency with other kinds of devices
>>>>
>>>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>>>> ---
>>>> 	v1->v2: include scsi-disk hunk too
>>>
>>> Thanks, applied to the block-stable branch (for 1.0)
>>
>> Did you guys check the consistency part against OpenFirmware syntax? I
>> didn't get around to that yet.
> 
> No, I wasn't aware about the existence of an OF spec for that (only that 
> fw_dev_path design was roughly corresponding to OF).  Based on 
> http://www.openfirmware.org/ofwg/practice/spi/spi1_0.ps it looks like 
> this (followup) patch would be preferrable:
> 
> diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
> index b4e6e29..4c33583 100644
> --- a/hw/scsi-bus.c
> +++ b/hw/scsi-bus.c
> @@ -1304,7 +1304,7 @@ static char *scsibus_get_fw_dev_path(DeviceState *dev)
>       SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev);
>       char path[100];
> 
> -    snprintf(path, sizeof(path), "%s@%d,%d,%d", qdev_fw_name(dev),
> +    snprintf(path, sizeof(path), "scsi@%x/%s@%x,%x", qdev_fw_name(dev),
>                d->channel, d->id, d->lun);

The parameter order doesn't look right.

> 
>       return strdup(path);
> 
> Kevin, how do you want to proceed?

Whatever you think is best. I already included the other patch in the
pull request, so any other change would have to be on top.

Kevin

Patch

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index b4e6e29..4c33583 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -1304,7 +1304,7 @@  static char *scsibus_get_fw_dev_path(DeviceState *dev)
      SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev);
      char path[100];

-    snprintf(path, sizeof(path), "%s@%d,%d,%d", qdev_fw_name(dev),
+    snprintf(path, sizeof(path), "scsi@%x/%s@%x,%x", qdev_fw_name(dev),
               d->channel, d->id, d->lun);

      return strdup(path);