Re: [PATCH v3] hw/block/nvme: align with existing style

2021-04-15 Thread Klaus Jensen
On Apr 16 09:22, Gollu Appalanaidu wrote: Use lower case hexadecimal format for the constants and in comments use the same format as used in Spec. ("h") Signed-off-by: Gollu Appalanaidu --- -v3: Add Suggestions (Philippe) Describe the NVMe subsystem style in nvme.c header -v2: Address

[PATCH] block/file-posix: Fix problem with fallocate(PUNCH_HOLE) on GPFS

2021-04-15 Thread Thomas Huth
A customer reported that running qemu-img convert -t none -O qcow2 -f qcow2 input.qcow2 output.qcow2 fails for them with the following error message when the images are stored on a GPFS file system: qemu-img: error while writing sector 0: Invalid argument After analyzing the strace output, it

[PATCH v3] hw/block/nvme: align with existing style

2021-04-15 Thread Gollu Appalanaidu
Use lower case hexadecimal format for the constants and in comments use the same format as used in Spec. ("h") Signed-off-by: Gollu Appalanaidu --- -v3: Add Suggestions (Philippe) Describe the NVMe subsystem style in nvme.c header -v2: Address review comments (Klaus) use lower case hex

Re: [PATCH v2] hw/block/nvme: align with existing style

2021-04-15 Thread Gollu Appalanaidu
On Thu, Apr 15, 2021 at 07:18:50PM +0200, Klaus Jensen wrote: On Apr 15 15:13, Philippe Mathieu-Daudé wrote: On 4/15/21 2:00 PM, Gollu Appalanaidu wrote: Make uniform hexadecimal numbers format. Signed-off-by: Gollu Appalanaidu --- -v2: Address review comments (Klaus) use lower case hexa form

Re: [PATCH 0/5] block, migration: improve debugging of migration bdrv_flush failure

2021-04-15 Thread Connor Kuehl
On 4/15/21 8:58 AM, Daniel P. Berrangé wrote: I spent a while debugging a tricky migration failure today which was ultimately caused by fdatasync() getting EACCESS. The existing probes were not sufficient to diagnose this, so I had to resort to GDB. This improves probes and block error reporting

about mirror cancel

2021-04-15 Thread Vladimir Sementsov-Ogievskiy
Hi all! Recently I've implemented fast-cancelling of mirror job: do bdrv_cancel_in_flight() in mirror_cancel(). Now I'm in doubt: is it a correct thing? I heard, that mirror-cancel is a kind of valid mirror completion.. Looking at documentation: # Note that if you issue 'block-job-cancel' af

Re: [PATCH v2] hw/block/nvme: align with existing style

2021-04-15 Thread Klaus Jensen
On Apr 15 15:13, Philippe Mathieu-Daudé wrote: On 4/15/21 2:00 PM, Gollu Appalanaidu wrote: Make uniform hexadecimal numbers format. Signed-off-by: Gollu Appalanaidu --- -v2: Address review comments (Klaus) use lower case hexa format for the code and in comments use the same format as used in

Re: [PATCH 4/5] block: add trace point when fdatasync fails

2021-04-15 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > A flush failure is a critical failure scenario for some operations. > For example, it will prevent migration from completing, as it will > make vm_stop() report an error. Thus it is important to have a > trace point present for debugging. > > Sig

Re: [PATCH 5/5] block: remove duplicate trace.h include

2021-04-15 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > Signed-off-by: Daniel P. Berrangé Reviewed-by: Dr. David Alan Gilbert > --- > block/file-posix.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/block/file-posix.c b/block/file-posix.c > index 6aafeda44f..2538e43299 100644 > --- a/

Re: [PATCH 1/5] migration: add trace point when vm_stop_force_state fails

2021-04-15 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > This is a critical failure scenario for migration that is hard to > diagnose from existing probes. Most likely it is caused by an error > from bdrv_flush(), but we're not logging the errno anywhere, hence > this new probe. > > Signed-off-by: Dani

Re: [PATCH 2/5] softmmu: add trace point when bdrv_flush_all fails

2021-04-15 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > The VM stop process has to flush outstanding I/O and this is a critical > failure scenario that is hard to diagnose. Add a probe point that > records the flush return code. > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Dr. David Alan Gilbe

[RFC PATCH 2/2] qemu-img convert: Fix sparseness detection

2021-04-15 Thread Kevin Wolf
In order to avoid RMW cycles, is_allocated_sectors() treats zeroed areas like non-zero data if the end of the checked area isn't aligned. This can improve the efficiency of the conversion and was introduced in commit 8dcd3c9b91a. However, it comes with a correctness problem: qemu-img convert is su

[RFC PATCH 1/2] iotests: Test qemu-img convert of zeroed data cluster

2021-04-15 Thread Kevin Wolf
This demonstrates what happens when the block status changes in sub-min_sparse granularity, but all of the parts are zeroed out. The alignment logic in is_allocated_sectors() prevents that the target image remains fully sparse as expected, but turns it into a data cluster of explicit zeros. Signed

[RFC PATCH 0/2] qemu-img convert: Fix sparseness detection

2021-04-15 Thread Kevin Wolf
Peter, three years ago you changed 'qemu-img convert' to sacrifice some sparsification in order to get aligned requests on the target image. At the time, I thought the impact would be small, but it turns out that this can end up wasting gigabytes of storagee (like converting a fully zeroed 10 GB im

[PATCH 5/5] block: remove duplicate trace.h include

2021-04-15 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- block/file-posix.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 6aafeda44f..2538e43299 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -106,8 +106,6 @@ #include #endif -#include "trace.h"

[PATCH 4/5] block: add trace point when fdatasync fails

2021-04-15 Thread Daniel P . Berrangé
A flush failure is a critical failure scenario for some operations. For example, it will prevent migration from completing, as it will make vm_stop() report an error. Thus it is important to have a trace point present for debugging. Signed-off-by: Daniel P. Berrangé --- block/file-posix.c | 2 ++

[PATCH 3/5] block: preserve errno from fdatasync failures

2021-04-15 Thread Daniel P . Berrangé
When fdatasync() fails on a file backend we set a flag that short-circuits any future attempts to call fdatasync(). The first failure returns the true errno, but the later short- circuited calls return a generic EIO. The latter is unhelpful because fdatasync() can return a variety of errnos, includ

[PATCH 2/5] softmmu: add trace point when bdrv_flush_all fails

2021-04-15 Thread Daniel P . Berrangé
The VM stop process has to flush outstanding I/O and this is a critical failure scenario that is hard to diagnose. Add a probe point that records the flush return code. Signed-off-by: Daniel P. Berrangé --- softmmu/cpus.c | 7 ++- softmmu/trace-events | 3 +++ 2 files changed, 9 insert

[PATCH 1/5] migration: add trace point when vm_stop_force_state fails

2021-04-15 Thread Daniel P . Berrangé
This is a critical failure scenario for migration that is hard to diagnose from existing probes. Most likely it is caused by an error from bdrv_flush(), but we're not logging the errno anywhere, hence this new probe. Signed-off-by: Daniel P. Berrangé --- migration/migration.c | 1 + migration/t

[PATCH 0/5] block, migration: improve debugging of migration bdrv_flush failure

2021-04-15 Thread Daniel P . Berrangé
I spent a while debugging a tricky migration failure today which was ultimately caused by fdatasync() getting EACCESS. The existing probes were not sufficient to diagnose this, so I had to resort to GDB. This improves probes and block error reporting to make future diagnosis possible without GDB.

Re: [PATCH v2] hw/block/nvme: align with existing style

2021-04-15 Thread Philippe Mathieu-Daudé
On 4/15/21 2:00 PM, Gollu Appalanaidu wrote: > Make uniform hexadecimal numbers format. > > Signed-off-by: Gollu Appalanaidu > --- > -v2: Address review comments (Klaus) > use lower case hexa format for the code and in comments > use the same format as used in Spec. ("h") ^ This comment

[PATCH v2] hw/block/nvme: align with existing style

2021-04-15 Thread Gollu Appalanaidu
Make uniform hexadecimal numbers format. Signed-off-by: Gollu Appalanaidu --- -v2: Address review comments (Klaus) use lower case hexa format for the code and in comments use the same format as used in Spec. ("h") hw/block/nvme-ns.c | 2 +- hw/block/nvme.c | 40 +++

Re: [PATCH 0/3] file-posix: fix refresh_limits for SCSI devices

2021-04-15 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210415124307.428203-1-pbonz...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210415124307.428203-1-pbonz...@redhat.com Subject: [PATCH 0/3] file-posix: fix refresh

[PATCH 1/3] scsi-generic: pass max_segments via max_iov field in BlockLimits

2021-04-15 Thread Paolo Bonzini
I/O to a disk via read/write is not limited by the number of segments allowed by the host adapter; the kernel can split requests if needed, and the limit imposed by the host adapter can be very low (256k or so) to avoid that SG_IO returns EINVAL if memory is heavily fragmented. Since this value is

[PATCH 0/3] file-posix: fix refresh_limits for SCSI devices

2021-04-15 Thread Paolo Bonzini
refresh_limits is not doing anything for block devices, and is retrieving the maximum number of s/g list entries incorrectly for character devices. Patches 2-3 fix these problems, while patch 1 is a small improvement to avoid making the BlockLimits unnecessarily restrictive when SG_IO is not in us

[PATCH 2/3] file-posix: try BLKSECTGET on block devices too, do not round to power of 2

2021-04-15 Thread Paolo Bonzini
bs->sg is only true for character devices, but block devices can also be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET returns bytes for /dev/sgN devices and sectors for block devices, so account for that in the code. The maximum transfer also need not be a power of 2 (for examp

[PATCH 3/3] file-posix: fix max_iov for /dev/sg devices

2021-04-15 Thread Paolo Bonzini
Even though it was only called for devices that have bs->sg set (which must be character devices), sg_get_max_segments looked at /sys/dev/block which only works for block devices. On Linux the sg driver has its own way to provide the maximum number of iovecs in a scatter/gather list. --- block/fi

[PATCH 3/4] hw/block/fdc: Extract ISA floppy controllers to fdc-isa.c

2021-04-15 Thread Philippe Mathieu-Daudé
Some machines use floppy controllers via the SysBus interface, and don't need to pull in all the ISA code. Extract the ISA specific code to a new unit: fdc-isa.c, and add a new Kconfig symbol: "FDC_ISA". Signed-off-by: Philippe Mathieu-Daudé --- hw/block/fdc-isa.c | 313 +++

[PATCH 2/4] hw/block/fdc: Declare shared prototypes in fdc-internal.h

2021-04-15 Thread Philippe Mathieu-Daudé
We want to extract ISA/SysBus code from the generic fdc.c file. First, declare the prototypes we will access from the new units into a new local header: "fdc-internal.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/block/fdc-internal.h | 155 hw/block/fd

[PATCH 4/4] hw/block/fdc: Extract SysBus floppy controllers to fdc-sysbus.c

2021-04-15 Thread Philippe Mathieu-Daudé
Some machines use floppy controllers via the SysBus interface, and don't need to pull in all the SysBus code. Extract the SysBus specific code to a new unit: fdc-sysbus.c, and add a new Kconfig symbol: "FDC_SYSBUS". Signed-off-by: Philippe Mathieu-Daudé --- hw/block/fdc-sysbus.c | 252 ++

[PATCH 0/4] hw/block/fdc: Allow Kconfig-selecting ISA bus/SysBus floppy controllers

2021-04-15 Thread Philippe Mathieu-Daudé
Hi, The floppy disc controllers pulls in irrelevant devices (sysbus in an ISA-only machine, ISA bus + isa devices on a sysbus-only machine). This series clean that by extracting each device in its own file, adding the corresponding Kconfig symbols: FDC_ISA and FDC_SYSBUS. Regards, Phil. Philip

[PATCH 1/4] hw/block/fdc: Replace disabled fprintf() by trace event

2021-04-15 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/block/fdc.c| 7 +-- hw/block/trace-events | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index a825c2acbae..1d3a0473678 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -1242,12 +124

Re: [PATCH 1/2] util/async: add a human-readable name to BHs for debugging

2021-04-15 Thread Philippe Mathieu-Daudé
On 4/14/21 10:02 PM, Stefan Hajnoczi wrote: > It can be difficult to debug issues with BHs in production environments. > Although BHs can usually be identified by looking up their ->cb() > function pointer, this requires debug information for the program. It is > also not possible to print human-re

Re: [PATCH 0/2] util/async: print leaked BH name when AioContext finalizes

2021-04-15 Thread Fam Zheng
On 2021-04-14 21:02, Stefan Hajnoczi wrote: > Eric Ernst and I debugged a BH leak and it was more involved than it should > be. > The problem is that BHs don't have a human-readable identifier, so low-level > debugging techniques and inferences about the code are required to figure out > which BH