Re: [PATCH v2] block/file-posix: fix wps checking in raw_co_prw

2023-06-07 Thread Sam Li
Damien Le Moal 于2023年6月8日周四 09:29写道: > > On 6/8/23 03:57, Sam Li wrote: > > If the write operation fails and the wps is NULL, then accessing it will > > lead to data corruption. > > > > Solving the issue by adding a nullptr checking in get_zones_wp() where > > the wps is used. > > > > This issue

Re: [PATCH v2] block/file-posix: fix wps checking in raw_co_prw

2023-06-07 Thread Damien Le Moal
On 6/8/23 03:57, Sam Li wrote: > If the write operation fails and the wps is NULL, then accessing it will > lead to data corruption. > > Solving the issue by adding a nullptr checking in get_zones_wp() where > the wps is used. > > This issue is found by Peter Maydell using the Coverity Tool (CID

[PATCH v2] block/file-posix: fix wps checking in raw_co_prw

2023-06-07 Thread Sam Li
If the write operation fails and the wps is NULL, then accessing it will lead to data corruption. Solving the issue by adding a nullptr checking in get_zones_wp() where the wps is used. This issue is found by Peter Maydell using the Coverity Tool (CID 1512459). Signed-off-by: Sam Li ---

Re: [PATCH] iotests: fix 194: filter out racy postcopy-active event

2023-06-07 Thread Richard Henderson
On 6/7/23 07:36, Vladimir Sementsov-Ogievskiy wrote: The event is racy: it will not appear in the output if bitmap is migrated during downtime period of migration and postcopy phase is not started. Fixes: ae00aa239847 "iotests: 194: test also migration of dirty bitmap" Reported-by: Richard

Re: [PATCH v3 10/14] nbd/client: Initial support for extended headers

2023-06-07 Thread Eric Blake
The subject lines are confusing: 9/14 enables extended headers in the server, while this one does not yet enable the headers but is merely a preliminary step. I'll probably retitle one or the other in v4. On Wed, May 31, 2023 at 06:26:17PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 15.05.23

Re: [PATCH] iotests: fix 194: filter out racy postcopy-active event

2023-06-07 Thread Stefan Hajnoczi
On Wed, Jun 07, 2023 at 05:36:06PM +0300, Vladimir Sementsov-Ogievskiy wrote: > The event is racy: it will not appear in the output if bitmap is > migrated during downtime period of migration and postcopy phase is not > started. > > Fixes: ae00aa239847 "iotests: 194: test also migration of dirty

Re: [PATCH 2/2] block/file-posix: fix wps checking in raw_co_prw

2023-06-07 Thread Stefan Hajnoczi
On Sun, Jun 04, 2023 at 02:16:58PM +0800, Sam Li wrote: > If the write operation fails and the wps is NULL, then accessing it will > lead to data corruption. > > Solving the issue by adding a nullptr checking in get_zones_wp() where > the wps is used. > > This issue is found by Peter Maydell

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-06-07 Thread Stefan Hajnoczi
On Sun, Jun 04, 2023 at 02:16:57PM +0800, Sam Li wrote: > The g_file_get_contents() function returns a g_boolean. If it fails, the > returned value will be 0 instead of -1. Solve the issue by skipping > assigning ret value. > > This issue was found by Matthew Rosato using virtio-blk-{pci,ccw}

Re: [PATCH v2 00/11] block: Re-enable the graph lock

2023-06-07 Thread Stefan Hajnoczi
On Mon, Jun 05, 2023 at 10:57:00AM +0200, Kevin Wolf wrote: > This series fixes the deadlock that was observed before commit ad128dff > ('graph-lock: Disable locking for now'), which just disabled the graph > lock completely as a workaround to get 8.0.1 stable. > > In theory the problem is

Re: [PATCH v2 5/8] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set

2023-06-07 Thread Niklas Cassel
On Wed, Jun 07, 2023 at 06:01:17PM +0200, Niklas Cassel wrote: > On Mon, Jun 05, 2023 at 08:19:43PM -0400, John Snow wrote: > > On Thu, Jun 1, 2023 at 9:46 AM Niklas Cassel wrote: > > > > > > From: Niklas Cassel > > > > > > For NCQ, PxCI is cleared on command queued successfully. > > > For

Re: [PATCH v2 5/8] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set

2023-06-07 Thread Niklas Cassel
On Mon, Jun 05, 2023 at 08:19:43PM -0400, John Snow wrote: > On Thu, Jun 1, 2023 at 9:46 AM Niklas Cassel wrote: > > > > From: Niklas Cassel > > > > For NCQ, PxCI is cleared on command queued successfully. > > For non-NCQ, PxCI is cleared on command completed successfully. > > Successfully means

[PATCH 1/3] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()

2023-06-07 Thread Andrey Drobyshev via
Functions qcow2_get_host_offset(), get_cluster_offset() explicitly report compressed cluster types when data is compressed. However, this information is never passed further. Let's make use of it by adding new BDRV_BLOCK_COMPRESSED flag for bdrv_block_status(), so that caller may know that the

[PATCH 3/3] qemu-iotests: update expected tests output to contain "compressed" field

2023-06-07 Thread Andrey Drobyshev via
The previous commit adds "compressed" boolean field to JSON output of "qemu-img map" command. Let's tweak expected tests output accordingly. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/122.out| 84 tests/qemu-iotests/154.out| 194

[PATCH 0/3] qemu-img: map: implement support for compressed clusters

2023-06-07 Thread Andrey Drobyshev via
This series adds "compressed" field to the output of "qemu-img map" command, specifying whether or not data block is compressed. Only JSON output mode is affected. With this applied, output looks like so: # qemu-img create -f qcow2 img.qcow2 192K # qemu-io -c "write -c -P 0xaa 0 64K" img.qcow2

[PATCH 2/3] qemu-img: map: report compressed data blocks

2023-06-07 Thread Andrey Drobyshev via
Right now "qemu-img map" reports compressed blocks as containing data but having no host offset. This is not very informative. Instead, let's add another boolean field named "compressed" in case JSON output mode is specified. This is achieved by utilizing new allocation status flag

Re: [PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-07 Thread Hanna Czenczek
On 07.06.23 08:51, Michael Tokarev wrote: 05.06.2023 18:45, Hanna Czenczek wrote: From: Alexander Ivanov data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or

Release of RSD (Rust QSD) 0.1

2023-06-07 Thread Hanna Czenczek
Hi everyone! I’ve just released the first version (0.1) of RSD, which is a proof-of-concept to rewrite the qemu-storage-daemon (QSD) and thus the qemu block layer in Rust: https://gitlab.com/hreitz/rsd https://gitlab.com/hreitz/rsd/-/releases/v0.1 We’ve been talking for quite a long time

Re: [Libguestfs] [libnbd PATCH v3 05/22] states: Prepare to receive 64-bit replies

2023-06-07 Thread Richard W.M. Jones
On Thu, Jun 01, 2023 at 11:04:05AM +0200, Laszlo Ersek wrote: > On 5/25/23 15:00, Eric Blake wrote: > > @@ -69,11 +75,18 @@ REPLY.STRUCTURED_REPLY.RECV_REMAINING: > > REPLY.STRUCTURED_REPLY.CHECK: > >struct command *cmd = h->reply_cmd; > >uint16_t flags, type; > > - uint32_t length; >

[PATCH] iotests: fix 194: filter out racy postcopy-active event

2023-06-07 Thread Vladimir Sementsov-Ogievskiy
The event is racy: it will not appear in the output if bitmap is migrated during downtime period of migration and postcopy phase is not started. Fixes: ae00aa239847 "iotests: 194: test also migration of dirty bitmap" Reported-by: Richard Henderson Signed-off-by: Vladimir Sementsov-Ogievskiy ---

Re: [PATCH] gitlab: Disable io-raw-194 for build-tcg-disabled

2023-06-07 Thread Vladimir Sementsov-Ogievskiy
On 07.06.23 15:44, Stefan Hajnoczi wrote: The line of output that has changed was originally added by the following commit: commit ae00aa2398476824f0eca80461da215e7cdc1c3b Author: Vladimir Sementsov-Ogievskiy Date: Fri May 22 01:06:46 2020 +0300 iotests: 194: test also migration of

Re: [Libguestfs] [libnbd PATCH v3 07/22] generator: Add struct nbd_extent in prep for 64-bit extents

2023-06-07 Thread Laszlo Ersek
On 5/25/23 15:00, Eric Blake wrote: > The existing nbd_block_status() callback is permanently stuck with an > array of uint32_t pairs (len/2 extents), which is both constrained on ( so the terminology is: - we have "len" uint32_t elements in the array, - one extent is one uint32_t pair, -

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-06-07 Thread Matthew Rosato
On 6/4/23 2:16 AM, Sam Li wrote: > The g_file_get_contents() function returns a g_boolean. If it fails, the > returned value will be 0 instead of -1. Solve the issue by skipping > assigning ret value. > > This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} backed > by an NVMe

Re: [PATCH] gitlab: Disable io-raw-194 for build-tcg-disabled

2023-06-07 Thread Stefan Hajnoczi
The line of output that has changed was originally added by the following commit: commit ae00aa2398476824f0eca80461da215e7cdc1c3b Author: Vladimir Sementsov-Ogievskiy Date: Fri May 22 01:06:46 2020 +0300 iotests: 194: test also migration of dirty bitmap Vladimir: Any idea why the

Re: [PATCH v3 09/14] nbd/server: Initial support for extended headers

2023-06-07 Thread Eric Blake
On Wed, May 31, 2023 at 05:46:55PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 15.05.23 22:53, Eric Blake wrote: > > Time to support clients that request extended headers. Now we can > > finally reach the code added across several previous patches. > > > > Even though the NBD spec has been

Re: [libnbd PATCH v3 04/22] states: Prepare to send 64-bit requests

2023-06-07 Thread Richard W.M. Jones
On Thu, May 25, 2023 at 08:00:50AM -0500, Eric Blake wrote: > Support sending 64-bit requests if extended headers were negotiated. > This includes setting NBD_CMD_FLAG_PAYLOAD_LEN any time we send an > extended NBD_CMD_WRITE; this is such a fundamental part of the > protocol that for now it is

Re: [Libguestfs] [libnbd PATCH v3 03/22] protocol: Add definitions for extended headers

2023-06-07 Thread Richard W.M. Jones
On Tue, May 30, 2023 at 05:48:25PM +0200, Laszlo Ersek wrote: > BTW I'm foreseeing a problem: if the extended block descriptor can > provide an unsigned 64-bit length, we're going to have trouble exposing > that in OCaml, because OCaml only has signed 64-bit integers. So that's > going to

Re: [PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-07 Thread Michael Tokarev
07.06.2023 09:51, Michael Tokarev wrote: 05.06.2023 18:45, Hanna Czenczek wrote: From: Alexander Ivanov data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the

Re: [PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-07 Thread Michael Tokarev
05.06.2023 18:45, Hanna Czenczek wrote: From: Alexander Ivanov data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the image will be truncated to this offset on