[PATCH] iotests/testrunner.py: refactor test_field_width

2021-12-10 Thread Vladimir Sementsov-Ogievskiy
A lot of Optional[] types doesn't make code beautiful. test_field_width defaults to 8, but that is never used in the code. More over, if we want some default behavior for single call of test_run(), it should just print the whole test name, not limiting or expanding its width, so 8 is bad default.

Re: [PATCH 2/3] iotests/testrunner.py: move updating last_elapsed to run_tests

2021-12-10 Thread Vladimir Sementsov-Ogievskiy
10.12.2021 17:47, Vladimir Sementsov-Ogievskiy wrote: 10.12.2021 17:25, Kevin Wolf wrote: Am 06.12.2021 um 18:59 hat John Snow geschrieben: On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: We are going to use do_run_test() in multiprocessing envir

Re: [PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS

2021-12-10 Thread Vladimir Sementsov-Ogievskiy
04.12.2021 02:14, Eric Blake wrote: Add a new negotiation feature where the client and server agree to use larger packet headers on every packet sent during transmission phase. This has two purposes: first, it makes it possible to perform operations like trim, write zeroes, and block status on mo

Re: [PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS

2021-12-10 Thread Vladimir Sementsov-Ogievskiy
07.12.2021 12:08, Vladimir Sementsov-Ogievskiy wrote: 07.12.2021 02:00, Eric Blake wrote: On Mon, Dec 06, 2021 at 02:40:45PM +0300, Vladimir Sementsov-Ogievskiy wrote: [..] +S: 64 bits, padding (MUST be zero) Hmm. Extra 8 bytes to be power-of-2. Does 32 bytes really perform better than

Re: [PATCH v5 09/31] block: introduce assert_bdrv_graph_writable

2021-12-10 Thread Hanna Reitz
On 24.11.21 07:43, Emanuele Giuseppe Esposito wrote: We want to be sure that the functions that write the child and parent list of a bs are under BQL and drain. BQL prevents from concurrent writings from the GS API, while drains protect from I/O. TODO: drains are missing in some functions using

Re: [PATCH 3/3] iotests: check: multiprocessing support

2021-12-10 Thread Kevin Wolf
Am 10.12.2021 um 15:46 hat Vladimir Sementsov-Ogievskiy geschrieben: > 10.12.2021 17:36, Kevin Wolf wrote: > > Am 03.12.2021 um 13:22 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > Add -j parameter, to run tests in several jobs simultaneously. > > > For realization - simply utilize multiproce

Re: [PATCH 0/2] block-backend: Retain permissions after migration

2021-12-10 Thread Kevin Wolf
Am 25.11.2021 um 14:53 hat Hanna Reitz geschrieben: > Hi, > > Peng Liang has reported an issue regarding migration of raw images here: > https://lists.nongnu.org/archive/html/qemu-block/2021-11/msg00673.html > > It turns out that after migrating, all permissions are shared when they > weren’t bef

Re: [PATCH v5 06/31] block/block-backend.c: assertions for block-backend

2021-12-10 Thread Hanna Reitz
On 24.11.21 07:43, Emanuele Giuseppe Esposito wrote: All the global state (GS) API functions will check that qemu_in_main_thread() returns true. If not, it means that the safety of BQL cannot be guaranteed, and they need to be moved to I/O. Signed-off-by: Emanuele Giuseppe Esposito --- block/

Re: [PATCH 3/3] iotests: check: multiprocessing support

2021-12-10 Thread Vladimir Sementsov-Ogievskiy
10.12.2021 17:36, Kevin Wolf wrote: Am 03.12.2021 um 13:22 hat Vladimir Sementsov-Ogievskiy geschrieben: Add -j parameter, to run tests in several jobs simultaneously. For realization - simply utilize multiprocessing.Pool class. Notes: 1. Of course, tests can't run simultaneously in same TEST

Re: [PATCH 2/3] iotests/testrunner.py: move updating last_elapsed to run_tests

2021-12-10 Thread Vladimir Sementsov-Ogievskiy
10.12.2021 17:25, Kevin Wolf wrote: Am 06.12.2021 um 18:59 hat John Snow geschrieben: On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: We are going to use do_run_test() in multiprocessing environment, where we'll not be able to change original runn

Re: [PATCH 1/3] iotests/testrunner.py: add doc string for run_test()

2021-12-10 Thread Vladimir Sementsov-Ogievskiy
10.12.2021 17:12, Kevin Wolf wrote: Am 03.12.2021 um 13:22 hat Vladimir Sementsov-Ogievskiy geschrieben: We are going to modify these methods and will add more documentation in further commit. As a preparation add basic documentation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qem

Re: [PATCH v5 05/31] block-backend: special comments for blk_set/get_perm due to fuse

2021-12-10 Thread Hanna Reitz
On 24.11.21 07:43, Emanuele Giuseppe Esposito wrote: Fuse logic can be classified as I/O, so there is no BQL held during its execution. And yet, it uses blk_{get/set}_perm functions, that are classified as BQL and clearly require the BQL lock. Since there is no easy solution for this, add a coupl

Re: [PATCH 3/3] iotests: check: multiprocessing support

2021-12-10 Thread Kevin Wolf
Am 03.12.2021 um 13:22 hat Vladimir Sementsov-Ogievskiy geschrieben: > Add -j parameter, to run tests in several jobs simultaneously. > For realization - simply utilize multiprocessing.Pool class. > > Notes: > > 1. Of course, tests can't run simultaneously in same TEST_DIR. So, >use subdirec

Re: [PATCH 2/3] iotests/testrunner.py: move updating last_elapsed to run_tests

2021-12-10 Thread Kevin Wolf
Am 06.12.2021 um 18:59 hat John Snow geschrieben: > On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < > vsement...@virtuozzo.com> wrote: > > > We are going to use do_run_test() in multiprocessing environment, where > > we'll not be able to change original runner object. > > > > Happily

Re: [PATCH v5 04/31] include/sysemu/block-backend: split header into I/O and global state (GS) API

2021-12-10 Thread Hanna Reitz
On 24.11.21 07:43, Emanuele Giuseppe Esposito wrote: Similarly to the previous patches, split block-backend.h in block-backend-io.h and block-backend-global-state.h In addition, remove "block/block.h" include as it seems it is not necessary anymore, together with "qemu/iov.h" block-backend-comm

[PATCH 1/2] scsi/scsi_bus: use host_status as parameter for scsi_sense_from_host_status()

2021-12-10 Thread Dongli Zhang
The scsi_sense_from_host_status() always returns GOOD since req->host_status is 255 (-1) at this time. Change req->host_status to host_status so that scsi_sense_from_host_status() will be able to return the expected value. Fixes: f3126d65b393("scsi: move host_status handling into SCSI drivers") Cc

[PATCH 2/2] scsi/utils: pass host_status = SCSI_HOST_ERROR to guest kernel

2021-12-10 Thread Dongli Zhang
For scsi_req_complete_failed() and when the req->bus->info->fail() is implemented, the virtio-scsi passes SCSI_HOST_ERROR to the guest kernel as VIRTIO_SCSI_S_FAILURE, while the pvscsi passes SCSI_HOST_ERROR to guest kernel as BTSTAT_HASOFTWARE. However, the scsi_req_complete_failed()->scsi_sense_

[PATCH 0/2] scsi: to fix issue on passing host_status to the guest kernel

2021-12-10 Thread Dongli Zhang
This patchset fixes the issue on passing 'host_status' to the guest kernel. The 1st patch fixes the erroneous usage of req->host_status. The 2nd patch is to pass the SCSI_HOST_ERROR to the guest kernel when the req->bus->info->fail() is not implemented. I do not add 'Fixes:' because I am not sure

Re: [PATCH 1/3] iotests/testrunner.py: add doc string for run_test()

2021-12-10 Thread Kevin Wolf
Am 03.12.2021 um 13:22 hat Vladimir Sementsov-Ogievskiy geschrieben: > We are going to modify these methods and will add more documentation in > further commit. As a preparation add basic documentation. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/testrunner.py | 13

Re: [RFC] block-backend: prevent dangling BDS pointer in blk_drain()

2021-12-10 Thread Kevin Wolf
Am 09.12.2021 um 15:23 hat Stefan Hajnoczi geschrieben: > The BlockBackend root child can change during bdrv_drained_begin() when > aio_poll() is invoked. In fact the BlockDriverState can reach refcnt 0 > and blk_drain() is left with a dangling BDS pointer. > > One example is scsi_device_purge_req

Re: [PATCH v4 0/3] hw/block/fdc: Fix CVE-2021-20196

2021-12-10 Thread Kevin Wolf
Am 24.11.2021 um 17:15 hat Philippe Mathieu-Daudé geschrieben: > Since v3: > - Preliminary extract blk_create_empty_drive() > - qtest checks qtest_check_clang_sanitizer() enabled > - qtest uses null-co:// driver instead of file > > Philippe Mathieu-Daudé (3): > hw/block/fdc: Extract blk_create_e

Re: [PATCH 2/2] iotests/149: Skip on unsupported ciphers

2021-12-10 Thread Kevin Wolf
Am 17.11.2021 um 16:05 hat Hanna Reitz geschrieben: > On 17.11.21 16:01, Hanna Reitz wrote: > > Whenever qemu-img or qemu-io report that some cipher is unsupported, > > skip the whole test, because that is probably because qemu has been > > configured with the gnutls crypto backend. > > > > We cou

Re: [PATCH 3/4] Move CONFIG_XFS handling to meson.build

2021-12-10 Thread Paolo Bonzini
On 12/10/21 09:46, Thomas Huth wrote: platform_test_xfs_fd() is only used to decide whether to invoke XFS_IOC_DIOINFO; but failures of XFS_IOC_DIOINFO are ignored anyway, so we can get rid of is_xfs in BDRVRawState, too. After staring at the code for a while, I wonder why we're not simply u

Re: [PATCH 3/4] Move CONFIG_XFS handling to meson.build

2021-12-10 Thread Thomas Huth
On 10/12/2021 09.39, Paolo Bonzini wrote: On 12/10/21 08:53, Thomas Huth wrote: On 02/11/2021 12.34, Paolo Bonzini wrote: On 28/10/21 20:59, Thomas Huth wrote: Checking for xfsctl() can be done more easily in meson.build. Also, this is not a "real" feature like the other features that we provi

Re: [PATCH 3/4] Move CONFIG_XFS handling to meson.build

2021-12-10 Thread Paolo Bonzini
On 12/10/21 08:53, Thomas Huth wrote: On 02/11/2021 12.34, Paolo Bonzini wrote: On 28/10/21 20:59, Thomas Huth wrote: Checking for xfsctl() can be done more easily in meson.build. Also, this is not a "real" feature like the other features that we provide with the "--enable-xxx" and "--disable-x

Re: [Libguestfs] [libnbd PATCH 00/13] libnbd patches for NBD_OPT_EXTENDED_HEADERS

2021-12-10 Thread Laszlo Ersek
On 12/04/21 00:17, Eric Blake wrote: > Available here: > https://repo.or.cz/libnbd/ericb.git/shortlog/refs/tags/exthdr-v1 > > I also want to do followup patches to teach 'nbdinfo --map' and > 'nbdcopy' to utilize 64-bit extents. > > Eric Blake (13): > golang: Simplify nbd_block_status callback