[Qemu-block] [PATCH] qemu-iotests: convert `pwd` and $(pwd) to $PWD

2018-10-22 Thread Mao Zhongyi
Suggested-by: Eric Blake Signed-off-by: Mao Zhongyi --- configure| 2 +- tests/check-block.sh | 6 ++-- tests/qemu-iotests/001 | 2 +- tests/qemu-iotests/002 | 2 +- tests/qemu-iotests/003 | 2 +- tests/qemu-iotests/004

[Qemu-block] [PATCH v3 2/9] iotests: Flush in iotests.py's QemuIoInteractive

2018-10-22 Thread Max Reitz
After issuing a command, flush the pipe. This does not change anything in Python 2, but it makes a difference in Python 3. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- tests/qemu-iotests/iotests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests

[Qemu-block] [PATCH v3 3/9] iotests: Use Python byte strings where appropriate

2018-10-22 Thread Max Reitz
Since byte strings are no longer the default in Python 3, we have to explicitly use them where we need to, which is mostly when working with structures. It also means that we need to open a file in binary mode when we want to use structures. On the other hand, we have to accomodate for the fact t

[Qemu-block] [PATCH v3 1/9] iotests: Make nbd-fault-injector flush

2018-10-22 Thread Max Reitz
When closing a connection, make the nbd-fault-injector flush the socket. Without this, the output is a bit unreliable with Python 3. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Reviewed-by: Eric Blake --- tests/qemu-iotests/083.out | 9

[Qemu-block] [PATCH v3 0/9] iotests: Make them work for both Python 2 and 3

2018-10-22 Thread Max Reitz
This series prepares the iotests to work with both Python 2 and 3. In some places, it adds version-specific code and decides what to do based on the version (for instance, whether to import the StringIO or the BytesIO class from 'io' for use with the test runner), but most of the time, it just mak

[Qemu-block] [PATCH v3 4/9] iotests: Use // for Python integer division

2018-10-22 Thread Max Reitz
In Python 3, / is always a floating-point division. We usually do not want this, and as Python 2.7 understands // as well, change all integer divisions to use that. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- tests/qemu-iotests/030| 2 +- tests/

[Qemu-block] [PATCH v3 6/9] iotests: Explicitly bequeath FDs in Python

2018-10-22 Thread Max Reitz
Python 3.4 introduced the inheritable attribute for FDs. At the same time, it changed the default so that all FDs are not inheritable by default, that only inheritable FDs are inherited to subprocesses, and only if close_fds is explicitly set to False. Adhere to this by setting close_fds to False

[Qemu-block] [PATCH v3 5/9] iotests: Different iterator behavior in Python 3

2018-10-22 Thread Max Reitz
In Python 3, several functions now return iterators instead of lists. This includes range(), items(), map(), and filter(). This means that if we really want a list, we have to wrap those instances with list(). But then again, the two instances where this is the case for map() and filter(), there

[Qemu-block] [PATCH v3 9/9] iotests: Unify log outputs between Python 2 and 3

2018-10-22 Thread Max Reitz
When dumping an object into the log, there are differences between Python 2 and 3. First, unicode strings are prefixed by 'u' in Python 2 (they are no longer in 3, because unicode strings are the default there). Second, the order of keys in dicts may differ. Third, especially long numbers are lo

[Qemu-block] [PATCH v3 8/9] iotests: Modify imports for Python 3

2018-10-22 Thread Max Reitz
There are two imports that need to be modified when running the iotests under Python 3: One is StringIO, which no longer exists; instead, the StringIO class comes from the io module, so import it from there (and use the BytesIO class for Python 2). The other is the ConfigParser, which has just bee

[Qemu-block] [PATCH v3 7/9] iotests: 'new' module replacement in 169

2018-10-22 Thread Max Reitz
iotest 169 uses the 'new' module to add methods to a class. This module no longer exists in Python 3. Instead, we can use a lambda. Best of all, this works in 2.7 just as well. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa --- tests/qemu-iotests/169 | 3 +--

[Qemu-block] [PATCH] file-posix: Use error API properly

2018-10-22 Thread Fam Zheng
Use error_report for situations that affect user operation (i.e. we're actually returning error), and warn_report/warn_report_err when some less critical error happened but the user operation can still carry on. Suggested-by: Markus Armbruster Signed-off-by: Fam Zheng --- block/file-posix.c |

Re: [Qemu-block] [PATCH v4 11/11] qemu-iotests: Test auto-read-only with -drive and -blockdev

2018-10-22 Thread Eric Blake
On 10/20/18 8:31 PM, Kevin Wolf wrote: Signed-off-by: Kevin Wolf --- tests/qemu-iotests/232 | 147 + tests/qemu-iotests/232.out | 59 +++ tests/qemu-iotests/group | 1 + 3 files changed, 207 insertions(+) create mode 100755 tests/qe

Re: [Qemu-block] [Qemu-devel] [PATCH v4 10/11] dp8393x: manage big endian bus

2018-10-22 Thread Philippe Mathieu-Daudé
On Thu, Oct 18, 2018 at 8:43 PM Mark Cave-Ayland wrote: > > From: Laurent Vivier > > This is needed by Quadra 800, this card can run on little-endian > or big-endian bus. > > Signed-off-by: Laurent Vivier > Tested-by: Hervé Poussineau Reviewed-by: Philippe Mathieu-Daudé > --- > hw/net/dp839

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Use error API properly

2018-10-22 Thread Markus Armbruster
Fam Zheng writes: > Use error_report for situations that affect user operation (i.e. we're > actually returning error), and warn_report/warn_report_err when some > less critical error happened but the user operation can still carry on. > > Suggested-by: Markus Armbruster > Signed-off-by: Fam Zh