All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer
@ 2020-03-10  6:18 Lin Ma
  2020-03-10  9:24 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Lin Ma @ 2020-03-10  6:18 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Jon Maloy, pbonzini, qemu-devel, hare

[-- Attachment #1: Type: text/plain, Size: 1868 bytes --]

First of all, Thanks for your reply, Stefan.

We know that the GET LBA STATUS works well under scsi lun passthrough due to the vm directly talks to the scsi target.
I'm curious that if I use file backend image(say qcow2) + qemu scsi emulation, Does it make sense if I issue sg_get_lba_status in vm to get the lba status?
If it doesn't make sense, That could explain why qemu scsi emulation layer lack of this support for a long time and no user complains.

Thanks,
Lin
________________________________
From: Stefan Hajnoczi
Sent: Friday, March 6, 2020 9:01 PM
To: Lin Ma
Cc: qemu-devel@nongnu.org; pbonzini@redhat.com; hare@suse.de; Eric Blake; Jon Maloy
Subject: Re: [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer

On Sun, Mar 01, 2020 at 01:01:29PM +0000, Lin Ma wrote:
> Hi all,
>
> I'm not familiar with scsi, I'm curious why there is no GET LBA STATUS(16) support in qemu scsi emulation layer.
>
> So far, There is only one subcommand of SERVICE ACTION was implemented: The READ CAPACITY(16)
> e.g.
> static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
>     [......]
>     case SERVICE_ACTION_IN_16:
>         /* Service Action In subcommands. */
>         if ((req->cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) {
>             [......]
>         }
>         trace_scsi_disk_emulate_command_SAI_unsupported();
>         goto illegal_request;
>     [......]
>
>
> It seems that this situation has been for a long time. Is the GET LBA STATUS (16 or 32) unnessesary for qemu scsi emulation or did I misunderstand something?

GET LBA STATUS is optional according to the SBC specification so QEMU's
SCSI target is conformant.

I guess the question is which applications need this command?

It's probably a case of no one needing this command enough to implement
it yet.

Stefan

[-- Attachment #2: Type: text/html, Size: 3195 bytes --]

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

* Re: [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer
  2020-03-10  6:18 [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer Lin Ma
@ 2020-03-10  9:24 ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-03-10  9:24 UTC (permalink / raw)
  To: Lin Ma; +Cc: qemu-block, qemu-devel, Jon Maloy, hare, pbonzini

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

On Tue, Mar 10, 2020 at 06:18:00AM +0000, Lin Ma wrote:
> First of all, Thanks for your reply, Stefan.
> 
> We know that the GET LBA STATUS works well under scsi lun passthrough due to the vm directly talks to the scsi target.
> I'm curious that if I use file backend image(say qcow2) + qemu scsi emulation, Does it make sense if I issue sg_get_lba_status in vm to get the lba status?
> If it doesn't make sense, That could explain why qemu scsi emulation layer lack of this support for a long time and no user complains.

It does make sense to implement GET LBA STATUS because QEMU emulates the
UNMAP command.

Be careful though because there is no asynchronous bdrv_block_status()
API yet.  Internally the BlockDriver->bdrv_co_block_status() function is
already asynchronous because it runs in a coroutine.  It will be
necessary to expose a new bdrv_aio_get_block_status() or similar API so
the device models (i.e. SCSI emulation code) can take advantage of that.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer
@ 2020-03-10 13:51 Lin Ma
  0 siblings, 0 replies; 5+ messages in thread
From: Lin Ma @ 2020-03-10 13:51 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-block, qemu-devel, Jon Maloy, hare, pbonzini

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

Due to no users complain about it so far, It seems not many people need it.
I'll spend some time reading some code of qemu block and diving into SCSI command manual, then try to implement it.
If anyone's willing to implement it before this, it will be appreciated.

Thanks for your valuable information,
Lin
________________________________

From: Stefan Hajnoczi
Sent: Tuesday, March 10, 2020 5:24 PM
To: Lin Ma
Cc: qemu-devel@nongnu.org; pbonzini@redhat.com; hare@suse.de; Eric Blake; Jon Maloy; qemu-block@nongnu.org
Subject: Re: [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer

On Tue, Mar 10, 2020 at 06:18:00AM +0000, Lin Ma wrote:
> First of all, Thanks for your reply, Stefan.
>
> We know that the GET LBA STATUS works well under scsi lun passthrough due to the vm directly talks to the scsi target.
> I'm curious that if I use file backend image(say qcow2) + qemu scsi emulation, Does it make sense if I issue sg_get_lba_status in vm to get the lba status?
> If it doesn't make sense, That could explain why qemu scsi emulation layer lack of this support for a long time and no user complains.

It does make sense to implement GET LBA STATUS because QEMU emulates the
UNMAP command.

Be careful though because there is no asynchronous bdrv_block_status()
API yet.  Internally the BlockDriver->bdrv_co_block_status() function is
already asynchronous because it runs in a coroutine.  It will be
necessary to expose a new bdrv_aio_get_block_status() or similar API so
the device models (i.e. SCSI emulation code) can take advantage of that.

Stefan

[-- Attachment #2: Type: text/html, Size: 3061 bytes --]

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

* Re: [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer
  2020-03-01 13:01 Lin Ma
@ 2020-03-06 13:01 ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-03-06 13:01 UTC (permalink / raw)
  To: Lin Ma; +Cc: Jon Maloy, pbonzini, qemu-devel, hare

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

On Sun, Mar 01, 2020 at 01:01:29PM +0000, Lin Ma wrote:
> Hi all,
> 
> I'm not familiar with scsi, I'm curious why there is no GET LBA STATUS(16) support in qemu scsi emulation layer.
> 
> So far, There is only one subcommand of SERVICE ACTION was implemented: The READ CAPACITY(16)
> e.g.
> static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
>     [......]
>     case SERVICE_ACTION_IN_16:
>         /* Service Action In subcommands. */
>         if ((req->cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) {
>             [......]
>         }
>         trace_scsi_disk_emulate_command_SAI_unsupported();
>         goto illegal_request;
>     [......]
> 
> 
> It seems that this situation has been for a long time. Is the GET LBA STATUS (16 or 32) unnessesary for qemu scsi emulation or did I misunderstand something?

GET LBA STATUS is optional according to the SBC specification so QEMU's
SCSI target is conformant.

I guess the question is which applications need this command?

It's probably a case of no one needing this command enough to implement
it yet.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer
@ 2020-03-01 13:01 Lin Ma
  2020-03-06 13:01 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Lin Ma @ 2020-03-01 13:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, hare

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

Hi all,

I'm not familiar with scsi, I'm curious why there is no GET LBA STATUS(16) support in qemu scsi emulation layer.

So far, There is only one subcommand of SERVICE ACTION was implemented: The READ CAPACITY(16)
e.g.
static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
    [......]
    case SERVICE_ACTION_IN_16:
        /* Service Action In subcommands. */
        if ((req->cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) {
            [......]
        }
        trace_scsi_disk_emulate_command_SAI_unsupported();
        goto illegal_request;
    [......]


It seems that this situation has been for a long time. Is the GET LBA STATUS (16 or 32) unnessesary for qemu scsi emulation or did I misunderstand something?

TIA,
Lin

[-- Attachment #2: Type: text/html, Size: 1666 bytes --]

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

end of thread, other threads:[~2020-03-10 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10  6:18 [Question] About GET LBA STATUS(16) support in qemu scsi emulation layer Lin Ma
2020-03-10  9:24 ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2020-03-10 13:51 Lin Ma
2020-03-01 13:01 Lin Ma
2020-03-06 13:01 ` Stefan Hajnoczi

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.