Re: [PATCH] iotests/pylintrc: allow up to 10 similar lines

2024-05-28 Thread Kevin Wolf
block branch, and > resend "[PULL 0/6] Block jobs patches for 2024-04-29" which is blocked > on this problem. Sorry, I only just returned from PTO and now have to catch up with things. But yes, if John doesn't have any objections, it's fine with me, too. Reviewed-by: Kevin Wolf

Re: [PATCH 0/2] Revert "monitor: use aio_co_reschedule_self()"

2024-05-28 Thread Kevin Wolf
Am 06.05.2024 um 21:06 hat Stefan Hajnoczi geschrieben: > This series fixes RHEL-34618 "qemu crash on Assertion `luringcb->co->ctx == > s->aio_context' failed when do block_resize on hotplug disk with > aio=io_uring": > https://issues.redhat.com/browse/RHEL-34618 > > Kevin identified commit 1f25c

Re: [PATCH 1/1] block: drop force_dup parameter of raw_reconfigure_getfd()

2024-05-28 Thread Kevin Wolf
Am 30.04.2024 um 19:02 hat Denis V. Lunev via geschrieben: > This parameter is always passed as 'false' from the caller. > > Signed-off-by: Denis V. Lunev > CC: Andrey Zhadchenko > CC: Kevin Wolf > CC: Hanna Reitz Let me add a "Since commit 72373e40fb

Re: [PATCH] qemu-io: add cvtnum() error handling for zone commands

2024-05-28 Thread Kevin Wolf
Am 07.05.2024 um 20:05 hat Stefan Hajnoczi geschrieben: > cvtnum() parses positive int64_t values and returns a negative errno on > failure. Print errors and return early when cvtnum() fails. > > While we're at it, also reject nr_zones values greater or equal to 2^32 > since they cannot be represe

Re: [PATCH] block/copy-before-write: use uint64_t for timeout in nanoseconds

2024-05-28 Thread Kevin Wolf
Am 29.04.2024 um 16:19 hat Fiona Ebner geschrieben: > rather than the uint32_t for which the maximum is slightly more than 4 > seconds and larger values would overflow. The QAPI interface allows > specifying the number of seconds, so only values 0 to 4 are safe right > now, other values lead to a m

Re: [PATCH v5] linux-aio: add IO_CMD_FDSYNC command support

2024-05-28 Thread Kevin Wolf
Am 25.04.2024 um 09:04 hat Prasad Pandit geschrieben: > From: Prasad Pandit > > Libaio defines IO_CMD_FDSYNC command to sync all outstanding > asynchronous I/O operations, by flushing out file data to the > disk storage. Enable linux-aio to submit such aio request. > > When using aio=native with

Re: block snapshot issue with RBD

2024-05-29 Thread Kevin Wolf
Am 29.05.2024 um 12:14 hat Fiona Ebner geschrieben: > I bisected this issue to d3007d348a ("block: Fix crash when loading > snapshot on inactive node"). > > > diff --git a/block/snapshot.c b/block/snapshot.c > > index ec8cf4810b..c4d40e80dd 100644 > > --- a/block/snapshot.c > > +++ b/block/snapsho

Re: [PATCH 1/2] Revert "monitor: use aio_co_reschedule_self()"

2024-05-29 Thread Kevin Wolf
Am 29.05.2024 um 12:33 hat Fiona Ebner geschrieben: > CC-ing stable since 1f25c172f83704e350c0829438d832384084a74d is in 9.0.0 Good point, I'm also updating the commit message in my tree to add a Cc: line. Thanks for catching this, Fiona! Kevin

Re: [PATCH 0/2] block/crypto: do not require number of threads upfront

2024-05-29 Thread Kevin Wolf
; I'm not familiar with this code or a crypto expert. I would assume the same, but I'm not merging this yet because I think you said you'd like to have input from danpb? Reviewed-by: Kevin Wolf

Re: [PATCH v2 2/2] iotests: test NBD+TLS+iothread

2024-05-31 Thread Kevin Wolf
Am 18.05.2024 um 04:50 hat Eric Blake geschrieben: > Prevent regressions when using NBD with TLS in the presence of > iothreads, adding coverage the fix to qio channels made in the > previous patch. > > CC: qemu-sta...@nongnu.org > Signed-off-by: Eric Blake > diff --git a/tests/qemu-iotests/test

Re: [PATCH v3 1/6] vvfat: Fix bug in writing to middle of file

2024-05-31 Thread Kevin Wolf
ster for the read operation. > > This is due to off-by-one error here, where `i=0x2000 !< offset=0x2000`, > thus not fetching the next cluster. > > Signed-off-by: Amjad Alsharafi Reviewed-by: Kevin Wolf Tested-by: Kevin Wolf > diff --git a/block/vvfat.c b/block/vvfat.c

Re: [PATCH v3 0/6] vvfat: Fix write bugs for large files and add iotests

2024-05-31 Thread Kevin Wolf
Am 26.05.2024 um 11:56 hat Amjad Alsharafi geschrieben: > These patches fix some bugs found when modifying files in vvfat. > First, there was a bug when writing to the cluster 2 or above of a file, it > will copy the cluster before it instead, so, when writing to cluster=2, the > content of cluster

Re: [PATCH v3 5/6] iotests: Filter out `vvfat` fmt from failing tests

2024-05-31 Thread Kevin Wolf
Am 26.05.2024 um 11:56 hat Amjad Alsharafi geschrieben: > `vvfat` is a special format and not all tests (even generic) can run > without crashing. So, added `unsupported_fmt: vvfat` to all failling > tests. > > Also added `vvfat` format into `meson.build`, vvfaat tests can be run > on the `block-

Re: [PATCH 0/2] block/crypto: do not require number of threads upfront

2024-06-03 Thread Kevin Wolf
Am 27.05.2024 um 17:58 hat Stefan Hajnoczi geschrieben: > The block layer does not know how many threads will perform I/O. It is > possible > to exceed the number of threads that is given to qcrypto_block_open() and this > can trigger an assertion failure in qcrypto_block_pop_cipher(). > > This p

Re: [PATCH] block/copy-before-write: use uint64_t for timeout in nanoseconds

2024-06-03 Thread Kevin Wolf
Am 03.06.2024 um 16:45 hat Fiona Ebner geschrieben: > Am 28.05.24 um 18:06 schrieb Kevin Wolf: > > Am 29.04.2024 um 16:19 hat Fiona Ebner geschrieben: > >> rather than the uint32_t for which the maximum is slightly more than 4 > >> seconds and larger values would o

Re: [PATCH v3 2/2] iotests: test NBD+TLS+iothread

2024-06-03 Thread Kevin Wolf
Am 03.06.2024 um 13:45 hat Daniel P. Berrangé geschrieben: > On Fri, May 31, 2024 at 01:04:59PM -0500, Eric Blake wrote: > > Prevent regressions when using NBD with TLS in the presence of > > iothreads, adding coverage the fix to qio channels made in the > > previous patch. > > > > The shell funct

Re: [PATCH v3 2/4] block-backend: fix edge case in bdrv_next() where BDS associated to BB changes

2024-06-03 Thread Kevin Wolf
Am 03.06.2024 um 16:17 hat Fiona Ebner geschrieben: > Hi Kevin, > > Am 26.03.24 um 13:44 schrieb Kevin Wolf: > > Am 22.03.2024 um 10:50 hat Fiona Ebner geschrieben: > >> The old_bs variable in bdrv_next() is currently determined by looking > >> at the old blo

Re: [PATCH v3 2/4] block-backend: fix edge case in bdrv_next() where BDS associated to BB changes

2024-06-04 Thread Kevin Wolf
Am 04.06.2024 um 09:58 hat Fiona Ebner geschrieben: > Am 03.06.24 um 18:21 schrieb Kevin Wolf: > > Am 03.06.2024 um 16:17 hat Fiona Ebner geschrieben: > >> Am 26.03.24 um 13:44 schrieb Kevin Wolf: > >>> > >>> The fix for bdrv_flush_all() is probably t

[PATCH] scsi-disk: Don't silently truncate serial number

2024-06-04 Thread Kevin Wolf
n't silently truncate the serial number string any more, but just error out if it would be truncated. Buglink: https://issues.redhat.com/browse/RHEL-3542 Suggested-by: Peter Krempa Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 20 +--- 1 file changed, 17 insertions(+), 3

Re: [PATCH v4 4/4] iotests: Add `vvfat` tests

2024-06-10 Thread Kevin Wolf
Am 05.06.2024 um 02:58 hat Amjad Alsharafi geschrieben: > Added several tests to verify the implementation of the vvfat driver. > > We needed a way to interact with it, so created a basic `fat16.py` driver > that handled writing correct sectors for us. > > Added `vvfat` to the non-generic format

Re: [PATCH v4 2/4] vvfat: Fix usage of `info.file.offset`

2024-06-10 Thread Kevin Wolf
Am 05.06.2024 um 02:58 hat Amjad Alsharafi geschrieben: > The field is marked as "the offset in the file (in clusters)", but it > was being used like this > `cluster_size*(nums)+mapping->info.file.offset`, which is incorrect. > > Additionally, removed the `abort` when `first_mapping_index` does no

Re: [PATCH v4 4/4] iotests: Add `vvfat` tests

2024-06-10 Thread Kevin Wolf
Am 10.06.2024 um 16:11 hat Amjad Alsharafi geschrieben: > On Mon, Jun 10, 2024 at 02:01:24PM +0200, Kevin Wolf wrote: > > With the updated test, I can catch the problems that are fixed by > > patches 1 and 2, but it still doesn't need patch 3 to pass. > > > > Kevi

Re: [PATCH v4 2/4] vvfat: Fix usage of `info.file.offset`

2024-06-11 Thread Kevin Wolf
Am 11.06.2024 um 14:31 hat Amjad Alsharafi geschrieben: > On Mon, Jun 10, 2024 at 06:49:43PM +0200, Kevin Wolf wrote: > > Am 05.06.2024 um 02:58 hat Amjad Alsharafi geschrieben: > > > The field is marked as "the offset in the file (in clusters)", but it &g

[PULL 2/8] Revert "monitor: use aio_co_reschedule_self()"

2024-06-11 Thread Kevin Wolf
From: Stefan Hajnoczi Commit 1f25c172f837 ("monitor: use aio_co_reschedule_self()") was a code cleanup that uses aio_co_reschedule_self() instead of open coding coroutine rescheduling. Bug RHEL-34618 was reported and Kevin Wolf identified the root cause. I missed that aio_co_resch

[PULL 7/8] block/crypto: create ciphers on demand

2024-06-11 Thread Kevin Wolf
rid of qcrypto_block_init_cipher() n_thread's argument and allocate ciphers on demand. Reported-by: Qing Wang Buglink: https://issues.redhat.com/browse/RHEL-36159 Signed-off-by: Stefan Hajnoczi Message-ID: <20240527155851.892885-2-stefa...@redhat.com> Reviewed-by: Kevin Wolf Acked-by: Daniel P. Berran

[PULL 3/8] aio: warn about iohandler_ctx special casing

2024-06-11 Thread Kevin Wolf
texts. Document this in order to reduce the chance of future bugs. Signed-off-by: Stefan Hajnoczi Message-ID: <20240506190622.56095-3-stefa...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/aio.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/in

[PULL 1/8] block: drop force_dup parameter of raw_reconfigure_getfd()

2024-06-11 Thread Kevin Wolf
From: "Denis V. Lunev via" Since commit 72373e40fbc, this parameter is always passed as 'false' from the caller. Signed-off-by: Denis V. Lunev CC: Andrey Zhadchenko CC: Kevin Wolf CC: Hanna Reitz Message-ID: <20240430170213.148558-1-...@openvz.org> Reviewed-by:

[PULL 6/8] linux-aio: add IO_CMD_FDSYNC command support

2024-06-11 Thread Kevin Wolf
pthreads results in TLB flushes. In a real-time guest environment, TLB flushes cause a latency spike. This patch helps to avoid such spikes. Reviewed-by: Stefan Hajnoczi Signed-off-by: Prasad Pandit Message-ID: <20240425070412.37248-1-ppan...@redhat.com> Reviewed-by: Kevin Wolf Signed-

[PULL 8/8] crypto/block: drop qcrypto_block_open() n_threads argument

2024-06-11 Thread Kevin Wolf
From: Stefan Hajnoczi The n_threads argument is no longer used since the previous commit. Remove it. Signed-off-by: Stefan Hajnoczi Message-ID: <20240527155851.892885-3-stefa...@redhat.com> Reviewed-by: Kevin Wolf Acked-by: Daniel P. Berrangé Signed-off-by: Kevin Wolf ---

[PULL 4/8] qemu-io: add cvtnum() error handling for zone commands

2024-06-11 Thread Kevin Wolf
l Cc: Sam Li Signed-off-by: Stefan Hajnoczi Message-ID: <20240507180558.377233-1-stefa...@redhat.com> Reviewed-by: Sam Li Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- qemu-io-cmds.c | 48 +++- 1 file changed, 47 insertions(+), 1 deleti

[PULL 0/8] Block layer patches

2024-06-11 Thread Kevin Wolf
The following changes since commit 80e8f0602168f451a93e71cbb1d59e93d745e62e: Merge tag 'bsd-user-misc-2024q2-pull-request' of gitlab.com:bsdimp/qemu into staging (2024-06-09 11:21:55 -0700) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you

[PULL 5/8] block/copy-before-write: use uint64_t for timeout in nanoseconds

2024-06-11 Thread Kevin Wolf
442154-1-f.eb...@proxmox.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/copy-before-write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/copy-before-write.c b/block/copy-befo

Re: [PATCH v4 5/5] iotests: add backup-discard-source

2024-06-11 Thread Kevin Wolf
Am 13.03.2024 um 16:28 hat Vladimir Sementsov-Ogievskiy geschrieben: > Add test for a new backup option: discard-source. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Fiona Ebner > Tested-by: Fiona Ebner This test fails for me, and it already does so after this commit that int

Re: [PATCH v4 2/4] vvfat: Fix usage of `info.file.offset`

2024-06-11 Thread Kevin Wolf
Am 11.06.2024 um 18:22 hat Amjad Alsharafi geschrieben: > On Tue, Jun 11, 2024 at 04:30:53PM +0200, Kevin Wolf wrote: > > Am 11.06.2024 um 14:31 hat Amjad Alsharafi geschrieben: > > > On Mon, Jun 10, 2024 at 06:49:43PM +0200, Kevin Wolf wrote: > > > > Am 05.06.202

Re: [PATCH v4 5/5] iotests: add backup-discard-source

2024-06-13 Thread Kevin Wolf
Am 12.06.2024 um 21:21 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 11.06.24 20:49, Kevin Wolf wrote: > > Am 13.03.2024 um 16:28 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > Add test for a new backup option: discard-source. > > > > > > Signed-

Re: [PATCH v5 5/5] iotests: Add `vvfat` tests

2024-06-13 Thread Kevin Wolf
Am 13.06.2024 um 16:07 hat Amjad Alsharafi geschrieben: > On Wed, Jun 12, 2024 at 08:43:26PM +0800, Amjad Alsharafi wrote: > > Added several tests to verify the implementation of the vvfat driver. > > > > We needed a way to interact with it, so created a basic `fat16.py` driver > > that handled wr

Re: [PATCH] block/file-posix: Consider discard flag when opening

2024-06-19 Thread Kevin Wolf
Am 18.06.2024 um 23:24 hat Nir Soffer geschrieben: > Set has_discard only when BDRV_O_UNMAP is not set. With this users that > want to keep their images fully allocated can disable hole punching > when writing zeros or discarding using: > >-drive file=thick.img,discard=off > > This change is

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-24 Thread Kevin Wolf
Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > > Tested using: > > Hi Nir, > This looks like a good candidate for the qemu-iotests test suite. Adding > it to the automated tests will protect against future regressions. > > P

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-26 Thread Kevin Wolf
Am 24.06.2024 um 23:12 hat Nir Soffer geschrieben: > On Mon, Jun 24, 2024 at 7:08 PM Kevin Wolf wrote: > > > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > > > > Tested using: > >

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-27 Thread Kevin Wolf
Am 26.06.2024 um 18:27 hat Nir Soffer geschrieben: > On Wed, Jun 26, 2024 at 12:17 PM Daniel P. Berrangé > wrote: > > > On Mon, Jun 24, 2024 at 06:08:26PM +0200, Kevin Wolf wrote: > > > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > > > On Wed, J

Re: [PATCH] block/curl: explicitly assert that strchr returns non-NULL value

2024-06-27 Thread Kevin Wolf
Am 27.06.2024 um 17:30 hat Vladimir Sementsov-Ogievskiy geschrieben: > strchr may return NULL if colon is not found. It seems clearer to > assert explicitly that we don't expect it here, than dereference 1 in > the next line. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/curl.c |

[PATCH 1/2] block-copy: Fix missing graph lock

2024-06-27 Thread Kevin Wolf
which allows calling functions that require the lock), but we never deal with the unlocking (so even after the scope of the guard, the compiler assumes that the lock is still held). This is why the compiler didn't catch this locking error. Signed-off-by: Kevin Wolf --- block/block-copy.c |

[PATCH 0/2] block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked

2024-06-27 Thread Kevin Wolf
Newer clang versions allow us to check scoped guards more thoroughly. Surprisingly, we only seem to have missed one instance with the old incomplete checks. Kevin Wolf (2): block-copy: Fix missing graph lock block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked include/block/graph

[PATCH 2/2] block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked

2024-06-27 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- include/block/graph-lock.h | 21 ++--- meson.build| 14 +- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/include/block/graph-lock.h b/include/block/graph-lock.h index d7545e82d0..dc8d949184 100644 --- a/incl

Re: [PATCH] scsi: Don't ignore most usb-storage properties

2024-07-02 Thread Kevin Wolf
Am 01.07.2024 um 15:08 hat Fiona Ebner geschrieben: > Hi, > > we got a user report about bootindex for an 'usb-storage' device not > working anymore [0] and I reproduced it and bisected it to this patch. > > Am 31.01.24 um 14:06 schrieb Kevin Wolf: > >

[PULL 0/4] Block layer patches (CVE-2024-4467)

2024-07-02 Thread Kevin Wolf
open qcow2 data files in 'qemu-img info' - Disallow protocol prefixes for qcow2 data files, VMDK extent files and other child nodes that are neither 'file' nor 'backing' ---- Kevin Wolf (4): qcow2: Don

[PULL 1/4] qcow2: Don't open data_file with BDRV_O_NO_IO

2024-07-02 Thread Kevin Wolf
ucceeds. Replace this part of the test with a qemu-io call, but keep the final 'qemu-img info' to show that the invalid data file is correctly displayed in the output. Fixes: CVE-2024-4467 Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stef

[PULL 4/4] block: Parse filenames only when explicitly requested

2024-07-02 Thread Kevin Wolf
file child. All other callers pass false and disable filename parsing this way. Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Hanna Czenczek --- block.c | 90 -

[PULL 2/4] iotests/244: Don't store data-file with protocol in image

2024-07-02 Thread Kevin Wolf
We want to disable filename parsing for data files because it's too easy to abuse in malicious image files. Make the test ready for the change by passing the data file explicitly in command line options. Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Review

[PULL 3/4] iotests/270: Don't store data-file with json: prefix in image

2024-07-02 Thread Kevin Wolf
We want to disable filename parsing for data files because it's too easy to abuse in malicious image files. Make the test ready for the change by passing the data file explicitly in command line options. Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Review

Re: [PULL 4/4] block: Parse filenames only when explicitly requested

2024-07-04 Thread Kevin Wolf
Am 03.07.2024 um 23:16 hat Michael Tokarev geschrieben: > 02.07.2024 19:39, Kevin Wolf wrote: > > When handling image filenames from legacy options such as -drive or from > > tools, these filenames are parsed for protocol prefixes, including for > > the json:{} pseudo-pr

Re: [PATCH v5 4/5] vvfat: Fix reading files with non-continuous clusters

2024-07-18 Thread Kevin Wolf
Am 12.06.2024 um 14:43 hat Amjad Alsharafi geschrieben: > When reading with `read_cluster` we get the `mapping` with > `find_mapping_for_cluster` and then we call `open_file` for this > mapping. > The issue appear when its the same file, but a second cluster that is > not immediately after it, imag

Re: [PATCH v5 2/5] vvfat: Fix usage of `info.file.offset`

2024-07-18 Thread Kevin Wolf
Am 12.06.2024 um 14:43 hat Amjad Alsharafi geschrieben: > The field is marked as "the offset in the file (in clusters)", but it > was being used like this > `cluster_size*(nums)+mapping->info.file.offset`, which is incorrect. > > Signed-off-by: Amjad Alsharafi Reviewed-by: Kevin Wolf

Re: [PATCH v5 5/5] iotests: Add `vvfat` tests

2024-07-18 Thread Kevin Wolf
+self.update_direntry(entry) > + > +# trigger every affected cluster > + for cluster in affected_clusters: > +first_sector = self.boot_sector.first_sector_of_cluster(cluster) > +first_sector_data = self.read_sectors(first_sector, 1) > +self.write_sectors(first_sector, first_sector_data) Other than this, the patch looks good to me and we seem to test all the cases that are fixed by the previous patches. Reviewed-by: Kevin Wolf Tested-by: Kevin Wolf Kevin

Re: [PATCH v5 3/5] vvfat: Fix wrong checks for cluster mappings invariant

2024-07-18 Thread Kevin Wolf
first_mapping_index != -1` since we know that this is the > value for the only entry where `offset == 0` (i.e. first mapping). > > Signed-off-by: Amjad Alsharafi Reviewed-by: Kevin Wolf

Re: [PATCH v3 1/3] block: zero data data corruption using prealloc-filter

2024-07-18 Thread Kevin Wolf
Am 16.07.2024 um 16:41 hat Andrey Drobyshev geschrieben: > From: "Denis V. Lunev" > > We have observed that some clusters in the QCOW2 files are zeroed > while preallocation filter is used. > > We are able to trace down the following sequence when prealloc-filter > is used: > co=0x55e7cbed76

Re: [PATCH] qapi-block-core: Clean up blockdev-snapshot-internal-sync doc

2024-07-18 Thread Kevin Wolf
Am 18.07.2024 um 14:36 hat Markus Armbruster geschrieben: > BlockdevSnapshotInternal is the arguments type of command > blockdev-snapshot-internal-sync. Its doc comment contains this note: > > # .. note:: In a transaction, if @name is empty or any snapshot matching > #@name exists, th

Re: [PATCH] block/curl: rewrite http header parsing function

2024-07-18 Thread Kevin Wolf
Am 29.06.2024 um 16:25 hat Michael Tokarev geschrieben: > Existing code was long, unclear and twisty. > > Signed-off-by: Michael Tokarev > --- > block/curl.c | 44 ++-- > 1 file changed, 18 insertions(+), 26 deletions(-) > > diff --git a/block/curl.c b/bl

Re: [PATCH v2] block-backend: per-device throttling of BLOCK_IO_ERROR reports

2024-07-18 Thread Kevin Wolf
Am 09.01.2024 um 14:13 hat Vladimir Sementsov-Ogievskiy geschrieben: > From: Leonid Kaplan > > BLOCK_IO_ERROR events comes from guest, so we must throttle them. > We still want per-device throttling, so let's use device id as a key. > > Signed-off-by: Leonid Kaplan > Signed-off-by: Vladimir Sem

Re: [PATCH v2 1/3] block/commit: implement final flush

2024-07-18 Thread Kevin Wolf
Am 26.06.2024 um 16:50 hat Vladimir Sementsov-Ogievskiy geschrieben: > Actually block job is not completed without the final flush. It's > rather unexpected to have broken target when job was successfully > completed long ago and now we fail to flush or process just > crashed/killed. > > Mirror jo

Re: [PATCH v5 4/5] vvfat: Fix reading files with non-continuous clusters

2024-07-19 Thread Kevin Wolf
Am 19.07.2024 um 02:29 hat Amjad Alsharafi geschrieben: > > > On Jul 19 2024, at 8:20 am, Amjad Alsharafi wrote: > > > On Thu, Jul 18, 2024 at 05:20:36PM +0200, Kevin Wolf wrote: > >> Am 12.06.2024 um 14:43 hat Amjad Alsharafi geschrieben: > >> > When

Re: [PATCH v2] block-backend: per-device throttling of BLOCK_IO_ERROR reports

2024-07-19 Thread Kevin Wolf
Am 19.07.2024 um 06:54 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 09.01.2024 um 14:13 hat Vladimir Sementsov-Ogievskiy geschrieben: > >> From: Leonid Kaplan > >> > >> BLOCK_IO_ERROR events comes from guest, so we must throt

[PATCH 4/4] scsi-disk: Always report RESERVATION_CONFLICT to guest

2024-07-29 Thread Kevin Wolf
entionally tries to execute invalid requests to see if they are properly rejected. Buglink: https://issues.redhat.com/browse/RHEL-5 Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw

[PATCH 0/4] scsi-block: Fix error handling with r/werror=stop

2024-07-29 Thread Kevin Wolf
CT is treated as a host error and stops the VM, which in some cases can't be resumed at all because nothing will make the error go away on retry. The error should always go to the guest instead, it's an invalid request from the guest. This series fixes these problems. Kevin Wolf (

[PATCH 3/4] scsi-disk: Add warning comments that host_status errors take a shortcut

2024-07-29 Thread Kevin Wolf
ly on the callback doing some cleanup until this code smell is fixed. For now, just add warnings to make people aware of the trap. Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 6e1a5

[PATCH 2/4] scsi-block: Don't skip callback for sgio error status/driver_status

2024-07-29 Thread Kevin Wolf
: inline sg_io_sense_from_errno() into the callers.") Buglink: https://issues.redhat.com/browse/RHEL-5 Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 3ff6798bde..6e1a5c98df 100644 --- a/hw/scs

[PATCH 1/4] scsi-disk: Use positive return value for status in dma_readv/writev

2024-07-29 Thread Kevin Wolf
callbacks that represent the status code that should be used to complete the request. scsi_handle_rw_error() already handles positive values for its ret parameter because scsi_block_sgio_complete() calls directly into it. Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 21

Re: [PATCH 4/4] scsi-disk: Always report RESERVATION_CONFLICT to guest

2024-07-29 Thread Kevin Wolf
Am 29.07.2024 um 13:55 hat Paolo Bonzini geschrieben: > On Mon, Jul 29, 2024 at 11:47 AM Kevin Wolf wrote: > > RESERVATION_CONFLICT is not a backend error, but indicates that the > > guest tried to make a request that it isn't allowed to execute. Pass the > > error t

Re: [PATCH v2 1/3] block/commit: implement final flush

2024-07-29 Thread Kevin Wolf
Am 19.07.2024 um 12:35 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 18.07.24 22:22, Kevin Wolf wrote: > > Am 26.06.2024 um 16:50 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > Actually block job is not completed without the final flush. It's > > > rather

Re: [PATCH 4/4] scsi-disk: Always report RESERVATION_CONFLICT to guest

2024-07-29 Thread Kevin Wolf
Am 29.07.2024 um 14:26 hat Paolo Bonzini geschrieben: > Il lun 29 lug 2024, 14:20 Kevin Wolf ha scritto: > > > Apparently both oVirt and Kubevirt unconditionally use the stop policy, > > so I'm afraid in this case we must acknowledge that our expectations > > don&#

Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix'

2024-07-31 Thread Kevin Wolf
Am 30.07.2024 um 10:10 hat Markus Armbruster geschrieben: > camel_to_upper() converts its argument from camel case to upper case > with '_' between words. Used for generated enumeration constant > prefixes. > > When some of the words are spelled all caps, where exactly to insert > '_' is guesswor

[PATCH v2 1/4] scsi-disk: Use positive return value for status in dma_readv/writev

2024-07-31 Thread Kevin Wolf
callbacks that represent the status code that should be used to complete the request. scsi_handle_rw_error() already handles positive values for its ret parameter because scsi_block_sgio_complete() calls directly into it. Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 21

[PATCH v2 0/4] scsi-block: Fix error handling with r/werror=stop

2024-07-31 Thread Kevin Wolf
Patch 4: [Paolo] * Set error = 0 explicitly, remove useless variable initialisation * Add comment to explain why we consider it a guest error * Mention scsi-block specifically in the commit message Kevin Wolf (4): scsi-disk: Use positive return value for status in dma_readv/writev scsi-bl

[PATCH v2 2/4] scsi-block: Don't skip callback for sgio error status/driver_status

2024-07-31 Thread Kevin Wolf
: inline sg_io_sense_from_errno() into the callers.") Buglink: https://issues.redhat.com/browse/RHEL-5 Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 3ff6798bde..6e1a5c98df 100644 --- a/hw/scs

[PATCH v2 4/4] scsi-disk: Always report RESERVATION_CONFLICT to guest

2024-07-31 Thread Kevin Wolf
n the guest is running the validation tests in Windows 2019's Failover Cluster Manager, which intentionally tries to execute invalid requests to see if they are properly rejected. Buglink: https://issues.redhat.com/browse/RHEL-5 Signed-off-by: Kevin Wolf --- hw/scsi/scsi-d

[PATCH v2 3/4] scsi-disk: Add warning comments that host_status errors take a shortcut

2024-07-31 Thread Kevin Wolf
ly on the callback doing some cleanup until this code smell is fixed. For now, just add warnings to make people aware of the trap. Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 6e1a5

Re: [PATCH 5/7] hw/block/fdc-isa: Assert that isa_fdc_get_drive_max_chs() found something

2024-07-31 Thread Kevin Wolf
ible bugs in the data in fd_formats. > > Resolves: Coverity CID 1547663 > Signed-off-by: Peter Maydell Reviewed-by: Kevin Wolf

Re: [PATCH 4/7] hw/ide/atapi: Be explicit that assigning to s->lcyl truncates

2024-07-31 Thread Kevin Wolf
rity warns that the first line here can overflow the > 8-bit s->lcyl variable. This is true, and in this case we're > deliberately only after the low 8 bits of the value. The > code is clearer to both humans and Coverity if we're explicit > that we only wanted the low 8 bits

Re: [PATCH 1/7] block/vdi.c: Avoid potential overflow when calculating size of write

2024-07-31 Thread Kevin Wolf
Am 31.07.2024 um 16:36 hat Peter Maydell geschrieben: > In vdi_co_pwritev() we multiply a sector count by SECTOR_SIZE to > get the size to write in bytes. Coverity notes that this means that > we do the multiply as a 32x32->32 multiply before converting to > 64 bits, which has the potential to over

Re: [PATCH 2/7] block/gluster: Use g_autofree for string in qemu_gluster_parse_json()

2024-07-31 Thread Kevin Wolf
ckdevOptionsGluster > *gconf, > tail = &gconf->server; > > for (i = 0; i < num_servers; i++) { > -str = g_strdup_printf(GLUSTER_OPT_SERVER_PATTERN"%d.", i); > +g_autofree char *str = > g_strdup_printf(GLUSTER_OPT_SERVER_PATTERN"%d.", i); This line is too long now. With this fixed: Reviewed-by: Kevin Wolf

Re: [PATCH 3/7] hw/block/pflash_cfi01: Don't decrement pfl->counter below 0

2024-07-31 Thread Kevin Wolf
> 0" if(), to avoid the decrement-below-zero. > > Resolves: Coverity CID 1547611 > Signed-off-by: Peter Maydell Reviewed-by: Kevin Wolf

Re: [PATCH 6/7] hw/ide/pci.c: Remove dead code from bmdma_prepare_buf()

2024-07-31 Thread Kevin Wolf
s->io_buffer_size += l; > } > } > - > -qemu_sglist_destroy(&s->sg); > -s->io_buffer_size = 0; > -return -1; > } Should we put a g_assert_not_reached() here instead to make it easier for the reader to understand how this function works? Either way: Reviewed-by: Kevin Wolf

Re: [PATCH 7/7] block/ssh.c: Don't double-check that characters are hex digits

2024-07-31 Thread Kevin Wolf
_check[0]) * 16 + > -hex2decimal(host_key_check[1]); > +} > + c = c0 * 16 + c1; > if (c - *fingerprint != 0) > return c - *fingerprint; > fingerprint++; Reviewed-by: Kevin Wolf

Re: [PATCH v6 4/5] vvfat: Fix reading files with non-continuous clusters

2024-08-05 Thread Kevin Wolf
Am 20.07.2024 um 12:13 hat Amjad Alsharafi geschrieben: > When reading with `read_cluster` we get the `mapping` with > `find_mapping_for_cluster` and then we call `open_file` for this > mapping. > The issue appear when its the same file, but a second cluster that is > not immediately after it, imag

Re: [PATCH v6 0/5] vvfat: Fix write bugs for large files and add iotests

2024-08-05 Thread Kevin Wolf
Am 20.07.2024 um 12:13 hat Amjad Alsharafi geschrieben: > These patches fix some bugs found when modifying files in vvfat. > First, there was a bug when writing to the cluster 2 or above of a file, it > will copy the cluster before it instead, so, when writing to cluster=2, the > content of cluster

Re: [PATCH] iotests/024: exclude 'backing file format' field from the output

2024-08-05 Thread Kevin Wolf
Am 30.07.2024 um 11:47 hat Andrey Drobyshev geschrieben: > Apparently 'qemu-img info' doesn't report the backing file format field > for qed (as it does for qcow2): > > $ qemu-img create -f qed base.qed 1M && qemu-img create -f qed -b base.qed -F > qed top.qed 1M > $ qemu-img create -f qcow2 base

Re: [PATCH v3 1/3] block: zero data data corruption using prealloc-filter

2024-08-05 Thread Kevin Wolf
Am 18.07.2024 um 21:46 hat Denis V. Lunev geschrieben: > On 7/18/24 17:51, Kevin Wolf wrote: > > Am 16.07.2024 um 16:41 hat Andrey Drobyshev geschrieben: > > > From: "Denis V. Lunev" > > > > > > We have observed that some clusters in the QCOW2 files

Re: [PATCH v3 2/3] iotests/298: add testcase for async writes with preallocation filter

2024-08-05 Thread Kevin Wolf
Am 16.07.2024 um 16:41 hat Andrey Drobyshev geschrieben: > The testcase simply creates a 64G image with 1M clusters, generates a list > of 1M aligned offsets and feeds aio_write commands with those offsets to > qemu-io run with '--aio native --nocache'. Then we check the data > written at each of

Re: [PATCH v3 3/3] scripts: add filev2p.py script for mapping virtual file offsets mapping

2024-08-05 Thread Kevin Wolf
Am 16.07.2024 um 16:41 hat Andrey Drobyshev geschrieben: > The script is basically a wrapper around "filefrag" utility. This might > be used to map virtual offsets within the file to the underlying block > device offsets. In addition, a chunk size might be specified, in which > case a list of suc

Re: [PATCH v3 2/3] iotests/298: add testcase for async writes with preallocation filter

2024-08-05 Thread Kevin Wolf
Am 05.08.2024 um 14:56 hat Andrey Drobyshev geschrieben: > On 8/5/24 3:04 PM, Kevin Wolf wrote: > > Am 16.07.2024 um 16:41 hat Andrey Drobyshev geschrieben: > >> The testcase simply creates a 64G image with 1M clusters, generates a list > >> of 1M aligned offsets and fe

[PULL 00/13] Block layer patches

2024-08-05 Thread Kevin Wolf
vvfat` tests Andrey Drobyshev (1): iotests/024: exclude 'backing file format' field from the output Kevin Wolf (6): block-copy: Fix missing graph lock block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked scsi-disk: Use positive return value for status

[PULL 02/13] block-copy: Fix missing graph lock

2024-08-05 Thread Kevin Wolf
which allows calling functions that require the lock), but we never deal with the unlocking (so even after the scope of the guard, the compiler assumes that the lock is still held). This is why the compiler didn't catch this locking error. Signed-off-by: Kevin Wolf Message-ID: <2024062718

[PULL 05/13] scsi-block: Don't skip callback for sgio error status/driver_status

2024-08-05 Thread Kevin Wolf
: inline sg_io_sense_from_errno() into the callers.") Buglink: https://issues.redhat.com/browse/RHEL-5 Signed-off-by: Kevin Wolf Acked-by: Paolo Bonzini Message-ID: <20240731123207.27636-3-kw...@redhat.com> Signed-off-by: Kevin Wolf --- hw/scsi/scsi-disk.c | 10 -- 1 file changed, 10 deletions(

[PULL 04/13] scsi-disk: Use positive return value for status in dma_readv/writev

2024-08-05 Thread Kevin Wolf
callbacks that represent the status code that should be used to complete the request. scsi_handle_rw_error() already handles positive values for its ret parameter because scsi_block_sgio_complete() calls directly into it. Signed-off-by: Kevin Wolf Acked-by: Paolo Bonzini Message-ID

[PULL 03/13] block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked

2024-08-05 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Message-ID: <20240627181245.281403-3-kw...@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Manos Pitsidianakis Signed-off-by: Kevin Wolf --- include/block/graph-lock.h | 21 ++--- meson.build| 14 +- 2 files changed

[PULL 09/13] vvfat: Fix usage of `info.file.offset`

2024-08-05 Thread Kevin Wolf
From: Amjad Alsharafi The field is marked as "the offset in the file (in clusters)", but it was being used like this `cluster_size*(nums)+mapping->info.file.offset`, which is incorrect. Signed-off-by: Amjad Alsharafi Reviewed-by: Kevin Wol

[PULL 07/13] scsi-disk: Always report RESERVATION_CONFLICT to guest

2024-08-05 Thread Kevin Wolf
n the guest is running the validation tests in Windows 2019's Failover Cluster Manager, which intentionally tries to execute invalid requests to see if they are properly rejected. Buglink: https://issues.redhat.com/browse/RHEL-5 Signed-off-by: Kevin Wolf Acked-by: Paolo Bonzini

[PULL 13/13] iotests/024: exclude 'backing file format' field from the output

2024-08-05 Thread Kevin Wolf
out and exclude it from the output. This is a fixup for the commit f93e65ee51 ("iotests/{024, 271}: add testcases for qemu-img rebase"). Reported-by: Thomas Huth Signed-off-by: Andrey Drobyshev Message-ID: <20240730094701.790624-1-andrey.drobys...@virtuozzo.com> Reviewed-by: Er

[PULL 11/13] vvfat: Fix reading files with non-continuous clusters

2024-08-05 Thread Kevin Wolf
f-by: Amjad Alsharafi Message-ID: <1f3ea115779abab62ba32c788073cdc99f9ad5dd.1721470238.git.amjadsharaf...@gmail.com> [kwolf: Simplified the patch based on Amjad's analysis and input] Signed-off-by: Kevin Wolf --- block/vvfat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PULL 10/13] vvfat: Fix wrong checks for cluster mappings invariant

2024-08-05 Thread Kevin Wolf
ed-off-by: Amjad Alsharafi Reviewed-by: Kevin Wolf Message-ID: Signed-off-by: Kevin Wolf --- block/vvfat.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index cfde468c2e..e3a83fbc88 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @

  1   2   3   4   5   6   7   8   9   10   >