Re: [RFC 0/4] POC: Generating realistic block errors

2019-11-26 Thread Tony Asleson
On 11/21/19 4:30 AM, Stefan Hajnoczi wrote: > blkdebug can inject EIO when a specific LBA is accessed. Is that > enough for what you want to do? Then you can reuse and maybe extend > blkdebug. Not exactly. For SCSI, I would like to be able to return different types of device errors on reads

[Bug 1853898] [NEW] qemu/hw/scsi/lsi53c895a.c:417: lsi_soft_reset: Assertion `QTAILQ_EMPTY(>queue)' failed.

2019-11-25 Thread Tony Asleson
Public bug reported: While experimenting with blkdebug I can consistently hit this assertion in lsi53c895a.c. Using locally built from master, commit: 2061735ff09f9d5e67c501a96227b470e7de69b1 Steps to reproduce $ qemu-img create -f raw empty.raw 8G $ sudo losetup -f --show empty.raw $ sudo

Re: [RFC 0/4] POC: Generating realistic block errors

2019-11-14 Thread Tony Asleson
On 9/20/19 12:28 PM, Tony Asleson wrote: > On 9/20/19 4:22 AM, Stefan Hajnoczi wrote: >> blkdebug is purely at the QEMU block layer level. It is not aware of >> storage controller-specific error information or features. If you want >> to inject NVMe- or SCSI-specific erro

Re: [RFC 4/4] ahci media error reporting

2019-09-20 Thread Tony Asleson
On 9/20/19 11:18 AM, John Snow wrote: > For sure -- I handle the normative cases, but I don't test what happens > if you issue an unsupported NCQ command. (I don't know what real > hardware does right now, either. I'm sure I could read the spec and find > out, but don't have a testing setup that

Re: [RFC 0/4] POC: Generating realistic block errors

2019-09-20 Thread Tony Asleson
On 9/20/19 12:08 PM, Eric Blake wrote: > I am worried, however, that making data transactions have to go through > QMP to get an answer on how to handle a specific guest request will slow > things down; QMP is not built to be an efficient dataplane interface. IMHO we only need to make the code

Re: [RFC 0/4] POC: Generating realistic block errors

2019-09-20 Thread Tony Asleson
On 9/20/19 1:11 PM, Kevin Wolf wrote: > Emitting a QMP event when blkdebug injects an error makes sense to me. > > I wouldn't use it for this case, though, because this would become racy. > It could happen that the guest writes to the image, which sends a QMP > event, and then reads before the

Re: [RFC 0/4] POC: Generating realistic block errors

2019-09-20 Thread Tony Asleson
On 9/20/19 4:22 AM, Stefan Hajnoczi wrote: > blkdebug is purely at the QEMU block layer level. It is not aware of > storage controller-specific error information or features. If you want > to inject NVMe- or SCSI-specific errors that make no sense in QEMU's > block layer, then trying to do it in

Re: [RFC 0/4] POC: Generating realistic block errors

2019-09-20 Thread Tony Asleson
On 9/20/19 3:36 AM, Kevin Wolf wrote: > I/O error inserted by blkdebug can be one-off or permanent, but since it > also supports using a small state machine, I think you should already be > able to configure your errors that are corrected by a rewrite, too, even > if there is no explicit support

Re: [RFC 1/4] Add qapi for block error injection

2019-09-20 Thread Tony Asleson
On 9/20/19 4:03 AM, Philippe Mathieu-Daudé wrote: > Hi Tony, Hi Phil > > On 9/19/19 9:48 PM, Tony Asleson wrote: ... >> +void media_error_delete(const char *device_id, uint64_t lba) > > Can you explain the goal of this function? I don't understand it from > the hardwar

Re: [RFC 4/4] ahci media error reporting

2019-09-19 Thread Tony Asleson
On 9/19/19 3:43 PM, John Snow wrote: > > > On 9/19/19 3:48 PM, Tony Asleson wrote: >> Initial attempt at returning a media error for ahci. This is certainly >> wrong and needs serious improvement. >> > > Hi; I have the unfortunate distinction of being th

[RFC 1/4] Add qapi for block error injection

2019-09-19 Thread Tony Asleson
interaction. Signed-off-by: Tony Asleson --- block/Makefile.objs | 2 +- block/error_inject.c | 179 +++ block/error_inject.h | 43 +++ block/qapi.c | 18 + qapi/block.json | 36 + 5 files changed, 277 insertions(+), 1

[RFC 3/4] NVMe media error reporting

2019-09-19 Thread Tony Asleson
Rudimentary and basic support for returning NVMe errors. Signed-off-by: Tony Asleson --- hw/block/nvme.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 12d8254250..faf72c2b8c 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -25,6 +25,7

[RFC 2/4] SCSI media error reporting

2019-09-19 Thread Tony Asleson
Add abilility to return media errors for SCSI block devices. Needs improvement. Signed-off-by: Tony Asleson --- hw/scsi/scsi-disk.c | 33 + include/scsi/utils.h | 4 scsi/utils.c | 31 +++ 3 files changed, 68 insertions

[RFC 0/4] POC: Generating realistic block errors

2019-09-19 Thread Tony Asleson
as interesting as I do. Or perhaps, to find out that I've been re-inventing the wheel. I'm interested in learning what thoughts people have on this. Thanks, Tony Tony Asleson (4): Add qapi for block error injection SCSI media error reporting NVMe media error reporting ahci media error

[RFC 4/4] ahci media error reporting

2019-09-19 Thread Tony Asleson
Initial attempt at returning a media error for ahci. This is certainly wrong and needs serious improvement. Signed-off-by: Tony Asleson --- hw/ide/ahci.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d45393c019..f487764106