[PATCH 0/2] remove socket_scm_helper

2021-07-16 Thread John Snow
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-socket-scm-helper CI: https://gitlab.com/jsnow/qemu/-/pipelines/338595177 19 insertions(+) 208 deletions(-) Seems good to me ...? --js John Snow (2): python/qmp: add send_fd_scm directly to QEMUMonitorProtocol python, iotests: remove

[PATCH 2/2] python, iotests: remove socket_scm_helper

2021-07-16 Thread John Snow
It's not used anymore, now. Signed-off-by: John Snow --- tests/qemu-iotests/socket_scm_helper.c | 136 - python/qemu/machine/machine.py | 3 - python/qemu/machine/qtest.py | 2 - tests/Makefile.include | 1 - tests/meson.build

[PATCH 1/2] python/qmp: add send_fd_scm directly to QEMUMonitorProtocol

2021-07-16 Thread John Snow
It turns out you can do this directly from Python ... and because of this, you don't need to worry about setting the fds, or spawning another process. Doing this is helpful because it allows QEMUMonitorProtocol to keep its file descriptor and socket object as private implementation details, which

Re: [PATCH v5 3/5] block/nbd: refactor nbd_recv_coroutines_wake_all()

2021-07-16 Thread Eric Blake
On Wed, Jul 14, 2021 at 07:59:14PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Split out nbd_recv_coroutine_wake(), as it will be used in separate. s/in separate/separately/ > Also add a possibility to wake only first found sleeping coroutine. > > Signed-off-by: Vladimir Sementsov-Ogievskiy >

Re: [PATCH v5 2/5] block/nbd: move nbd_recv_coroutines_wake_all() up

2021-07-16 Thread Eric Blake
On Wed, Jul 14, 2021 at 07:59:13PM +0300, Vladimir Sementsov-Ogievskiy wrote: > We are going to use it in nbd_channel_error(), so move it up. Note, > that we are going also refactor and rename > nbd_recv_coroutines_wake_all() in future anyway, so keeping it where it > is and making forward

Re: [PATCH v2] docs: document file-posix locking protocol

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 21:47, Vladimir Sementsov-Ogievskiy wrote: 16.07.2021 19:21, Vladimir Sementsov-Ogievskiy wrote: 15.07.2021 23:00, Vladimir Sementsov-Ogievskiy wrote: 03.07.2021 16:50, Vladimir Sementsov-Ogievskiy wrote: +Permission bytes. If permission byte is rd-locked, it means that some

Re: [PATCH v5 1/5] block/nbd: nbd_channel_error() shutdown channel unconditionally

2021-07-16 Thread Eric Blake
On Wed, Jul 14, 2021 at 07:59:12PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Don't rely on connection being totally broken in case of -EIO. More > safe and correct just shutdown the channel anyway, as we change the > state and going to reconnect. > > Signed-off-by: Vladimir Sementsov-Ogievskiy

Re: [PATCH v2] docs: document file-posix locking protocol

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 19:21, Vladimir Sementsov-Ogievskiy wrote: 15.07.2021 23:00, Vladimir Sementsov-Ogievskiy wrote: 03.07.2021 16:50, Vladimir Sementsov-Ogievskiy wrote: +Permission bytes. If permission byte is rd-locked, it means that some process +uses corresponding permission on that file. + +Byte  

Re: [PATCH v2] docs: document file-posix locking protocol

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
15.07.2021 23:00, Vladimir Sementsov-Ogievskiy wrote: 03.07.2021 16:50, Vladimir Sementsov-Ogievskiy wrote: +Permission bytes. If permission byte is rd-locked, it means that some process +uses corresponding permission on that file. + +Byte    Operation +100 read +  Lock holder can

Re: [RFC PATCH 0/6] job: replace AioContext lock with job_mutex

2021-07-16 Thread Kevin Wolf
Am 13.07.2021 um 15:10 hat Stefan Hajnoczi geschrieben: > AIO_WAIT_WHILE() requires that AioContext is acquired according to its > documentation, but I'm not sure that's true anymore. Thread-safe/atomic > primitives are used by AIO_WAIT_WHILE(), so as long as the condition > being waited for is

Re: [PATCH 08/14] iotests/common.rc: _make_test_img(): smarter compressiont_type handling

2021-07-16 Thread Max Reitz
On 16.07.21 16:24, Vladimir Sementsov-Ogievskiy wrote: 16.07.2021 15:38, Max Reitz wrote: Subject: s/compressiont_type/compression_type/ On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Like it is done in iotests.py in qemu_img_create_prepare_args(), let's not follow

Re: [PATCH 11/14] iotests: bash tests: filter compression type

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 16:17, Max Reitz wrote: On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: We want iotests pass with both the default zlib compression and with IMGOPTS='compression_type=zstd'. Actually the only test that is interested in real compression type in test output is 287 (test for

Re: [PATCH 08/14] iotests/common.rc: _make_test_img(): smarter compressiont_type handling

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 15:38, Max Reitz wrote: Subject: s/compressiont_type/compression_type/ On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Like it is done in iotests.py in qemu_img_create_prepare_args(), let's not follow compression_type=zstd of IMGOPTS if test creates image in old format.

Re: [PATCH 12/14] iotests 60: more accurate set dirty bit in qcow2 header

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Don't touch other incompatible bits, like compression-type. This makes the test pass with IMGOPTS='compression_type=zstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/060 | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH 14/14] iotest 214: explicit compression type

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: The test-case "Corrupted size field in compressed cluster descriptor" heavily depends on zlib compression type. So, make it explicit. This way test passes with IMGOPTS='compression_type=zstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy

Re: [PATCH 13/14] iotest 39: use _qcow2_dump_header

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: _qcow2_dump_header has filter for compression type, so this change makes test pass with IMGOPTS='compression_type=zstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/039 | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH 11/14] iotests: bash tests: filter compression type

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: We want iotests pass with both the default zlib compression and with IMGOPTS='compression_type=zstd'. Actually the only test that is interested in real compression type in test output is 287 (test for qcow2 compression type), so implement

Re: [PATCH 10/14] iotests: massive use _qcow2_dump_header

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: We are going to add filtering in _qcow2_dump_header and want all tests use it. The patch is generated by commands: cd tests/qemu-iotests sed -ie 's/$PYTHON qcow2.py "$TEST_IMG" dump-header\($\| \)/_qcow2_dump_header\1/' ??? tests/*

Re: [PATCH 09/14] iotests/common.rc: introduce _qcow2_dump_header helper

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: We'll use it in tests instead of explicit qcow2.py. Then we are going to add some filtering in _qcow2_dump_header. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/common.rc | 10 ++ 1 file changed, 10

Re: [PATCH 08/14] iotests/common.rc: _make_test_img(): smarter compressiont_type handling

2021-07-16 Thread Max Reitz
Subject: s/compressiont_type/compression_type/ On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Like it is done in iotests.py in qemu_img_create_prepare_args(), let's not follow compression_type=zstd of IMGOPTS if test creates image in old format. Signed-off-by: Vladimir

Re: [PATCH 06/14] iotest 302: use img_info_log() helper

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 14:39, Max Reitz wrote: On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Instead of qemu_img_log("info", ..) use generic helper img_info_log(). img_info_log() has smarter logic. For example it use filter_img_info() to filter output, which in turns filter a compression type. So

Re: [PATCH 07/14] qcow2: simple case support for downgrading of qcow2 images with zstd

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: If image doesn't have any compressed cluster we can easily switch to zlib compression, which may allow to downgrade the image. That's mostly needed to support IMGOPTS='compression_type=zstd' in some iotests which do qcow2 downgrade. While

Re: [PATCH 06/14] iotest 302: use img_info_log() helper

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Instead of qemu_img_log("info", ..) use generic helper img_info_log(). img_info_log() has smarter logic. For example it use filter_img_info() to filter output, which in turns filter a compression type. So it will help us in future when we

Re: [PATCH 05/14] iotests.py: filter compression type out

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 14:15, Max Reitz wrote: On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: We want iotests pass with both the default zlib compression and with IMGOPTS='compression_type=zstd'. Actually the only test that is interested in real compression type in test output is 287 (test for

Re: [PATCH 05/14] iotests.py: filter compression type out

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: We want iotests pass with both the default zlib compression and with IMGOPTS='compression_type=zstd'. Actually the only test that is interested in real compression type in test output is 287 (test for qcow2 compression type) and it's in

Re: [PATCH 04/14] iotest 065: explicit compression type

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: The test checks different options. It of course fails if set IMGOPTS='compression_type=zstd'. So, let's be explicit in what compression type we want and independent of IMGOPTS. Test both existing compression types. Signed-off-by: Vladimir

Re: [PATCH 02/14] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd'

2021-07-16 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 13:07, Max Reitz wrote: On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Adding support of IMGOPTS (like in bash tests) allows user to pass a lot of different options. Still, some may require additional logic. Now we want compression_type option, so add some smart logic around

Re: [PATCH 03/14] iotest 303: explicit compression type

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: The test prints qcow2 header fields which depends on chosen compression type. So, let's be explicit in what compression type we want and independent of IMGOPTS. Test both existing compression types. Signed-off-by: Vladimir

Re: [PATCH 02/14] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd'

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Adding support of IMGOPTS (like in bash tests) allows user to pass a lot of different options. Still, some may require additional logic. Now we want compression_type option, so add some smart logic around it: ignore compression_type=zstd in

Re: [PATCH 01/14] iotests.py: img_info_log(): rename imgopts argument

2021-07-16 Thread Max Reitz
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: We are going to support IMGOPTS environment variable like in bash tests. Corresponding global variable in iotests.py should be called imgopts. So to not interfere with function argument, rename it in advance. Signed-off-by: Vladimir