All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] scsi-disk: support setting CD-ROM block size via device options.
       [not found] <20220726034206.515097-1-john@john-millikin.com>
@ 2022-08-01 11:08 ` John Millikin
  2022-08-04  8:06   ` Mark Cave-Ayland
  0 siblings, 1 reply; 2+ messages in thread
From: John Millikin @ 2022-08-01 11:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Fam Zheng

Gentle ping -- this is my first time sending a patch for QEMU and it
hasn't shown up in the qemu-devel mailing list web UI yet, so I can't
tell whether the mail is being sent/received successfully.

On Tue, Jul 26, 2022 at 12:42:06PM +0900, John Millikin wrote:
> SunOS expects CD-ROM devices to have a block size of 512, and will
> fail to mount or install using QEMU's default block size of 2048.
> 
> When initializing the SCSI device, allow the `physical_block_device'
> block device option to override the default block size.
> 
> Signed-off-by: John Millikin <john@john-millikin.com>
> ---
>  hw/scsi/scsi-disk.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index f5cdb9ad4b..acdf8dc05c 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -2533,6 +2533,7 @@ static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
>      SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
>      AioContext *ctx;
>      int ret;
> +    uint32_t blocksize = 2048;
>  
>      if (!dev->conf.blk) {
>          /* Anonymous BlockBackend for an empty drive. As we put it into
> @@ -2542,9 +2543,13 @@ static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
>          assert(ret == 0);
>      }
>  
> +    if (dev->conf.physical_block_size != 0) {
> +        blocksize = dev->conf.physical_block_size;
> +    }
> +
>      ctx = blk_get_aio_context(dev->conf.blk);
>      aio_context_acquire(ctx);
> -    s->qdev.blocksize = 2048;
> +    s->qdev.blocksize = blocksize;
>      s->qdev.type = TYPE_ROM;
>      s->features |= 1 << SCSI_DISK_F_REMOVABLE;
>      if (!s->product) {
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi-disk: support setting CD-ROM block size via device options.
  2022-08-01 11:08 ` [PATCH] scsi-disk: support setting CD-ROM block size via device options John Millikin
@ 2022-08-04  8:06   ` Mark Cave-Ayland
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Cave-Ayland @ 2022-08-04  8:06 UTC (permalink / raw)
  To: John Millikin, qemu-devel; +Cc: Paolo Bonzini, Fam Zheng

On 01/08/2022 12:08, John Millikin wrote:

> Gentle ping -- this is my first time sending a patch for QEMU and it
> hasn't shown up in the qemu-devel mailing list web UI yet, so I can't
> tell whether the mail is being sent/received successfully.
> 
> On Tue, Jul 26, 2022 at 12:42:06PM +0900, John Millikin wrote:
>> SunOS expects CD-ROM devices to have a block size of 512, and will
>> fail to mount or install using QEMU's default block size of 2048.
>>
>> When initializing the SCSI device, allow the `physical_block_device'
>> block device option to override the default block size.
>>
>> Signed-off-by: John Millikin <john@john-millikin.com>
>> ---
>>   hw/scsi/scsi-disk.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
>> index f5cdb9ad4b..acdf8dc05c 100644
>> --- a/hw/scsi/scsi-disk.c
>> +++ b/hw/scsi/scsi-disk.c
>> @@ -2533,6 +2533,7 @@ static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
>>       SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
>>       AioContext *ctx;
>>       int ret;
>> +    uint32_t blocksize = 2048;
>>   
>>       if (!dev->conf.blk) {
>>           /* Anonymous BlockBackend for an empty drive. As we put it into
>> @@ -2542,9 +2543,13 @@ static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
>>           assert(ret == 0);
>>       }
>>   
>> +    if (dev->conf.physical_block_size != 0) {
>> +        blocksize = dev->conf.physical_block_size;
>> +    }
>> +
>>       ctx = blk_get_aio_context(dev->conf.blk);
>>       aio_context_acquire(ctx);
>> -    s->qdev.blocksize = 2048;
>> +    s->qdev.blocksize = blocksize;
>>       s->qdev.type = TYPE_ROM;
>>       s->features |= 1 << SCSI_DISK_F_REMOVABLE;
>>       if (!s->product) {
>> -- 
>> 2.25.1

Hi John,

I saw this reply but didn't see the original patch - were you subscribed to the list 
before you first sent it? If not, it may be that it got caught in a moderation queue 
somewhere.

The CC email addresses look right, but do bear in mind that people are busy as the 
7.1 release is just around the corner and so may not get to your patch right away.

The reason your patch caught my eye is that I've been having a similar discussion on 
Gitlab at https://gitlab.com/qemu-project/qemu/-/issues/1127. Could you check your 
git send-email configuration and then try and resend your patch to see if it appears 
on the list?


ATB,

Mark.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-04  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220726034206.515097-1-john@john-millikin.com>
2022-08-01 11:08 ` [PATCH] scsi-disk: support setting CD-ROM block size via device options John Millikin
2022-08-04  8:06   ` Mark Cave-Ayland

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.