Re: [PATCH 1/2] tests: Trying fixes test-replication.c on msys2/mingw.

2020-09-06 Thread Yonggang Luo
On Sun, Sep 6, 2020 at 5:49 AM Stefan Weil wrote: > Am 05.09.20 um 23:10 schrieb Yonggang Luo: > > > On Windows there is no path like /tmp/s_local_disk.XX > > > > Signed-off-by: Yonggang Luo > > --- > > tests/test-replication.c | 13 + > > 1 file changed, 9 insertions(+), 4

Re: [PATCH v4 2/2] file-posix: add sg_get_max_segments that actually works with sg

2020-09-06 Thread Tom Yan
In commit 867eccfed84f96b54f4a432c510a02c2ce03b430, Levitsky appears to have assumed that the only "SCSI Passthrough" is `-device scsi-generic`, while the fact is there's also `-device scsi-block` (passthrough without the sg driver). Unlike `-device scsi-hd`, getting max_sectors is necessary to it

Re: [PATCH v4 2/2] file-posix: add sg_get_max_segments that actually works with sg

2020-09-06 Thread Tom Yan
Maybe you want to add some condition for this: https://github.com/qemu/qemu/blob/v5.1.0/nbd/server.c#L659 Or not clamp it at all. On Sun, 6 Sep 2020 at 18:58, Tom Yan wrote: > > In commit 867eccfed84f96b54f4a432c510a02c2ce03b430, Levitsky appears > to have assumed that the only "SCSI

Re: [PATCH v4 2/2] file-posix: add sg_get_max_segments that actually works with sg

2020-09-06 Thread Maxim Levitsky
On Sun, 2020-09-06 at 19:04 +0800, Tom Yan wrote: > Maybe you want to add some condition for this: > https://github.com/qemu/qemu/blob/v5.1.0/nbd/server.c#L659 > Or not clamp it at all. > > On Sun, 6 Sep 2020 at 18:58, Tom Yan wrote: > > In commit 867eccfed84f96b54f4a432c510a02c2ce03b430,

Re: [PATCH v4 2/2] file-posix: add sg_get_max_segments that actually works with sg

2020-09-06 Thread Tom Yan
Your patch only fixed it for sg devices. S_ISBLK() will never be true when sg_get_max_segments() is only called in raw_refresh_limits() when bs->sg is true. With that said, it's not like we cannot ditch the bs->sg check in raw_refresh_limits() and switch to S_ISBLK()/S_ISCHR(). (Although not

Re: [PATCH 07/17] hw/block/nvme: add symbolic command name to trace events

2020-09-06 Thread Philippe Mathieu-Daudé
On 9/4/20 4:19 PM, Klaus Jensen wrote: > From: Klaus Jensen > > Add the symbolic command name to the pci_nvme_{io,admin}_cmd and > pci_nvme_rw trace events. > [...]> diff --git a/hw/block/trace-events b/hw/block/trace-events > index 50d5702e6b80..0823d0fb47c5 100644 > ---

Re: [PATCH v5 09/11] meson: Fixes qapi tests.

2020-09-06 Thread Yonggang Luo
On Sat, Sep 5, 2020 at 4:42 PM Thomas Huth wrote: > On 05/09/2020 08.23, Yonggang Luo wrote: > > The error are: > > +@end table > > + > > +@end deftypefn > > + > > make: *** [Makefile.mtest:63: check-qapi-schema] Error 1 > > > > Signed-off-by: Yonggang Luo > > --- > >

Re: [PATCH 10/13] dma: Let dma_memory_rw_relaxed() take MemTxAttrs argument

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:53写道: > > We will add the MemTxAttrs argument to dma_memory_rw() in > the next commit. Since dma_memory_rw_relaxed() is only used > by dma_memory_rw(), modify it first in a separate commit to > keep the next commit easier to review. > > Signed-off-by:

Re: [PATCH 01/13] pci: pass along the return value of dma_memory_rw

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:47写道: > > From: Klaus Jensen > > Some might actually care about the return value of dma_memory_rw. So > let us pass it along instead of ignoring it. > > There are no existing users of the return value, so this patch should be > safe. > > Signed-off-by:

Re: [PATCH 07/13] dma: Let dma_memory_write() propagate MemTxResult

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:46写道: > > dma_memory_rw_relaxed() returns a MemTxResult type. > Do not discard it, return it to the caller. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang > --- > include/sysemu/dma.h | 22 ++ > 1 file changed, 18

Re: [PATCH 06/13] dma: Let dma_memory_read() propagate MemTxResult

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:50写道: > > dma_memory_rw_relaxed() returns a MemTxResult type. > Do not discard it, return it to the caller. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang > --- > include/sysemu/dma.h | 21 + > 1 file changed, 17

Re: [PATCH 12/13] dma: Let dma_memory_read/write() take MemTxAttrs argument

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:52写道: > > Let devices specify transaction attributes when calling > dma_memory_read() or dma_memory_write(). > > Patch created mechanically using spatch with this script: > > @@ > expression E1, E2, E3, E4; > @@ > ( > - dma_memory_read(E1, E2,

Re: [PATCH 13/13] dma: Let dma_memory_map() take MemTxAttrs argument

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:52写道: > > Let devices specify transaction attributes when calling > dma_memory_map(). > > Patch created mechanically using spatch with this script: > > @@ > expression E1, E2, E3, E4; > @@ > - dma_memory_map(E1, E2, E3, E4) > + dma_memory_map(E1,

Re: [PATCH 11/13] dma: Let dma_memory_rw() take MemTxAttrs argument

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:53写道: > > Let devices specify transaction attributes when calling > dma_memory_rw(). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang > --- > include/hw/pci/pci.h | 3 ++- > include/sysemu/dma.h | 11 ++- > dma-helpers.c

Re: [PATCH 04/17] hw/block/nvme: alignment style fixes

2020-09-06 Thread Philippe Mathieu-Daudé
On 9/4/20 4:19 PM, Klaus Jensen wrote: > From: Klaus Jensen > > Style fixes. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 25 + > 1 file changed, 13 insertions(+), 12 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 17/17] hw/block/nvme: change controller pci id

2020-09-06 Thread Philippe Mathieu-Daudé
+David in case On 9/4/20 4:19 PM, Klaus Jensen wrote: > From: Klaus Jensen > > There are two reasons for changing this: > > 1. The nvme device currently uses an internal Intel device id. > > 2. Since commits "nvme: fix write zeroes offset and count" and "nvme: > support multiple

Re: [PATCH] hw: ide: check the pointer before do dma memory unmap

2020-09-06 Thread Li Qiang
Ping! Li Qiang 于2020年9月1日周二 下午6:34写道: > > Ping. > > Li Qiang 于2020年8月15日周六 下午3:21写道: > > > > In 'map_page' we need to check the return value of > > 'dma_memory_map' to ensure the we actully maped something. > > Otherwise, we will hit an assert in 'address_space_unmap'. > > This is because we

Re: [PATCH 09/17] hw/block/nvme: default request status to success

2020-09-06 Thread Philippe Mathieu-Daudé
On 9/4/20 4:19 PM, Klaus Jensen wrote: > From: Klaus Jensen > > Make the default request status NVME_SUCCESS so only error status codes > has to be set. Typo 'has' -> 'have'. > > Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-Daudé > --- > hw/block/nvme.c | 4 +--- > 1 file

Re: [PATCH 04/13] dma: Let dma_memory_set() propagate MemTxResult

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:47写道: > > address_space_write() returns a MemTxResult type. > Do not discard it, return it to the caller. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang > --- > include/sysemu/dma.h | 15 ++- > dma-helpers.c| 7

Re: [PATCH 05/13] dma: Let dma_memory_rw() propagate MemTxResult

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:46写道: > > address_space_rw() returns a MemTxResult type. > Do not discard it, return it to the caller. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang > --- > include/sysemu/dma.h | 30 ++ > 1 file changed,

Re: [PATCH 09/13] dma: Let dma_memory_set() take MemTxAttrs argument

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:49写道: > > Let devices specify transaction attributes when calling > dma_memory_set(). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang > --- > include/hw/ppc/spapr_vio.h | 3 ++- > include/sysemu/dma.h | 3 ++- > dma-helpers.c

Re: [PATCH 08/13] dma: Let dma_memory_valid() take MemTxAttrs argument

2020-09-06 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月4日周五 下午11:48写道: > > Let devices specify transaction attributes when calling > dma_memory_valid(). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang > --- > include/hw/ppc/spapr_vio.h | 2 +- > include/sysemu/dma.h | 4 ++-- > 2 files

Re: [PATCH 02/17] hw/block/nvme: handle dma errors

2020-09-06 Thread Philippe Mathieu-Daudé
Hi Klaus, On 9/4/20 4:19 PM, Klaus Jensen wrote: > From: Klaus Jensen > > Handling DMA errors gracefully is required for the device to pass the > block/011 test ("disable PCI device while doing I/O") in the blktests > suite. > > With this patch the device passes the test by retrying "critical"

Re: [PATCH] hw/block/nand: Decommission the NAND museum

2020-09-06 Thread Philippe Mathieu-Daudé
ping^2 On 8/22/20 10:03 PM, Philippe Mathieu-Daudé wrote: > ping? > > On 8/14/20 3:23 PM, Philippe Mathieu-Daudé wrote: >> I forgot to Cc qemu-arm@, doing it now since most of the users >> of this are ARM machines. >> >> On 8/14/20 3:21 PM, Philippe Mathieu-Daudé wrote: >>> This is the QEMU

Re: [PATCH v4 2/2] file-posix: add sg_get_max_segments that actually works with sg

2020-09-06 Thread Tom Yan
I don't disagree with your proposal, but the thing is, do we even need another field/limit for case 1? For example, do we *really* need to clamp sizes[2] (NBD_INFO_BLOCK_SIZE) in nbd/server.c and max_io_sectors (SCSIBlockLimits) in hw/scsi/scsi-disk.c to to any kind of "dynamic" limit? Either way

Re: [PATCH v4 2/2] file-posix: add sg_get_max_segments that actually works with sg

2020-09-06 Thread Maxim Levitsky
On Sun, 2020-09-06 at 23:26 +0800, Tom Yan wrote: > I don't disagree with your proposal, but the thing is, do we even need > another field/limit for case 1? For example, do we *really* need to > clamp sizes[2] (NBD_INFO_BLOCK_SIZE) in nbd/server.c and > max_io_sectors (SCSIBlockLimits) in

RE: [PATCH v4 2/2] file-posix: add sg_get_max_segments that actually works with sg

2020-09-06 Thread Dmitry Fomichev
> -Original Message- > From: Qemu-block bounces+dmitry.fomichev=wdc@nongnu.org> On Behalf Of Maxim > Levitsky > Sent: Sunday, September 6, 2020 1:06 PM > To: Tom Yan ; ebl...@redhat.com; > pbonz...@redhat.com; f...@euphon.net; anie...@linux.vnet.ibm.com; > kw...@redhat.com;