Re: 回复: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-07-08 Thread Paolo Bonzini
On 08/07/20 14:29, Stefan Hajnoczi wrote: > Something similar is needed for GET_LBA_STATUS. Since there is no > bdrv_aio_block_status() you can create a coroutine instead of an aiocb: > > static void coroutine_fn scsi_co_block_status(void *opaque) > { > int ret; > > aio_context_ac

Re: 回复: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-07-08 Thread Stefan Hajnoczi
t.com > > 主题: Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 > > command > > > > On Wed, Jun 17, 2020 at 06:30:18PM +0800, Lin Ma wrote: > > > Signed-off-by: Lin Ma > > > --- > > > hw/scsi/scsi-disk.c| 90 > >

Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-30 Thread Paolo Bonzini
On 29/06/20 18:02, Eric Blake wrote: > - allocation implies that data comes from this layer of a backing chain, > rather than deferring to a backing image > > - allocation implies that storage is reserved (that is, not sparse) > > It sounds like we are trying to represent the second question fo

Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-29 Thread Eric Blake
On 6/29/20 5:39 AM, Stefan Hajnoczi wrote: SCSI defines 3 values and QEMU can represent all of them: 0 - mapped or unknown 1 - deallocated 2 - anchored See the BDRV_BLOCK_* constants in include/block/block.h. The is_deallocated boolean is not enough to represent this state, but the bdrv_block_

Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-29 Thread Paolo Bonzini
On 29/06/20 12:39, Stefan Hajnoczi wrote: >> I don't know which one in BDRV_BLOCK_* can be used to represent 'anchored'. >> It seems that I need to use BDRV_BLOCK_* combination to recognized >> 'anchored', >> >> I'd like to use these combinations to analyze the bdrv_block_status() return >> value

Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-29 Thread Stefan Hajnoczi
On Thu, Jun 25, 2020 at 01:31:56PM +, Lin Ma wrote: > On 2020-06-25 21:25, Lin Ma wrote: > >> +/* > >> + * 8 + 16 is the length in bytes of response header and > >> + * one LBA status descriptor > >> + */ > >> +memset(outbuf, 0, 8 + 16); > >> +outbuf[3] = 20; > >> +o

回复: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-29 Thread Lin Ma
> -邮件原件- > 发件人: Stefan Hajnoczi > 发送时间: 2020年6月22日 20:14 > 收件人: Lin Ma > 抄送: qemu-devel@nongnu.org; f...@euphon.net; kw...@redhat.com; > mre...@redhat.com; pbonz...@redhat.com > 主题: Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 > command &

Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-25 Thread Lin Ma
On 2020-06-25 21:25, Lin Ma wrote: > From: Stefan Hajnoczi > Sent: Monday, June 22, 2020 8:14 PM > ... >> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c >> index 387503e11b..9e3002ddaf 100644 >> --- a/hw/scsi/scsi-disk.c >> +++ b/hw/scsi/scsi-disk.c >> @@ -1866,6 +1866,89 @@ static void scs

Re: [PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-22 Thread Stefan Hajnoczi
On Wed, Jun 17, 2020 at 06:30:18PM +0800, Lin Ma wrote: > Signed-off-by: Lin Ma > --- > hw/scsi/scsi-disk.c| 90 ++ > include/block/accounting.h | 1 + > include/scsi/constants.h | 1 + > 3 files changed, 92 insertions(+) > > diff --git a/hw/scsi/s

[PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-17 Thread Lin Ma
Signed-off-by: Lin Ma --- hw/scsi/scsi-disk.c| 90 ++ include/block/accounting.h | 1 + include/scsi/constants.h | 1 + 3 files changed, 92 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 387503e11b..9e3002ddaf 100644 ---

[PATCH v2 3/3] scsi-disk: Add support for the GET LBA STATUS 16 command

2020-06-17 Thread Lin Ma
Signed-off-by: Lin Ma --- hw/scsi/scsi-disk.c| 90 ++ include/block/accounting.h | 1 + include/scsi/constants.h | 1 + 3 files changed, 92 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 387503e11b..9e3002ddaf 100644 ---