Re: [PATCH V4] file-posix: allow -EBUSY error during ioctl(fd, BLKZEROOUT, range) on block

2021-03-24 Thread ChangLimin
>On Wed, Mar 24, 2021 at 4:52 PM Max Reitz wrote: >On 22.03.21 10:25, ChangLimin wrote: >> For Linux 5.10/5.11, qemu write zeros to a multipath device using >> ioctl(fd, BLKZEROOUT, range) with cache none or directsync return -EBUSY >> permanently. > >So as far as I can track back the discussion,

Re: [PATCH 0/6] hw/southbridge: QOM'ify vt82c686 as VT82C686B_SOUTHBRIDGE

2021-03-24 Thread BALATON Zoltan
On Wed, 24 Mar 2021, Philippe Mathieu-Daudé wrote: The motivation behind this series is to remove the isa_get_irq(NULL) call to simplify the ISA generic model. Could you please wait with this until after my pegasos2 series is merged? Otherwise I'll have to rewrite that again for which I don't

Re: [PATCH v4 00/11] 64bit block-layer: part II

2021-03-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210324205132.464899-1-vsement...@virtuozzo.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210324205132.464899-1-vsement...@virtuozzo.com Subject: [PATCH v4 00/11] 64bit bl

[PATCH v4 11/11] block/io: allow 64bit discard requests

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
Now, when all drivers are updated by previous commit, we can drop the last limiter on pdiscard path: INT_MAX in bdrv_co_pdiscard(). Now everything is prepared for implementing incredibly cool and fast big-discard requests in NBD and qcow2. And any other driver which wants it of course. Signed-off

[PATCH v4 10/11] block: use int64_t instead of int in driver discard handlers

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v4 05/11] block: use int64_t instead of uint64_t in copy_range driver handlers

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v4 06/11] block: make BlockLimits::max_pwrite_zeroes 64bit

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We are going to support 64 bit write-zeroes requests. Now update the limit variable. It's absolutely safe. The variable is set in some drivers, and used in bdrv_co_do_pwrite_zeroes(). Update also max_write_zeroes variable in bdrv_co_do_pwrite_zeroes(), so that bdrv_co_do_pwrite_zeroes() is now pre

[PATCH v4 08/11] block/io: allow 64bit write-zeroes requests

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
Now, when all drivers are updated by previous commit, we can drop two last limiters on write-zeroes path: INT_MAX in bdrv_co_do_pwrite_zeroes() and bdrv_check_request32() in bdrv_co_pwritev_part(). Now everything is prepared for implementing incredibly cool and fast big-write-zeroes in NBD and qco

[PATCH v4 04/11] block: use int64_t instead of uint64_t in driver write handlers

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v4 09/11] block: make BlockLimits::max_pdiscard 64bit

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We are going to support 64 bit discard requests. Now update the limit variable. It's absolutely safe. The variable is set in some drivers, and used in bdrv_co_pdiscard(). Update also max_pdiscard variable in bdrv_co_pdiscard(), so that bdrv_co_pdiscard() is now prepared to 64bit requests. The rema

[PATCH v4 03/11] block: use int64_t instead of uint64_t in driver read handlers

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We are going to convert .bdrv_co_preadv_part and .bdrv_co_pwritev_part to int64_t type for offset and bytes parameters (as it's already done for generic block/io.c layer). In qcow2 .bdrv_co_preadv_part is used in some places, so let's add corresponding checks and assertions. Signed-off-by: Vladim

[PATCH v4 07/11] block: use int64_t instead of int in driver write_zeroes handlers

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v4 02/11] qcow2: check request on vmstate save/load path

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
We modify the request by adding an offset to vmstate. Let's check the modified request. It will help us to safely move .bdrv_co_preadv_part and .bdrv_co_pwritev_part to int64_t type of offset and bytes. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 3 +++ block/io.

[PATCH v4 00/11] 64bit block-layer: part II

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is part II of 64bit block-layer, when part I already landed ([PATCH v4 00/16] 64bit block-layer: part I <20201211183934.169161-1-vsement...@virtuozzo.com>) This is called v4 too, because it follows old ([PATCH v3 00/17] 64bit block-layer <20200430111033.29980-1-vsement...@virtu

[PATCH v4 01/11] block/io: bring request check to bdrv_co_{read, write}v_vmstate

2021-03-24 Thread Vladimir Sementsov-Ogievskiy via
There are only two drivers supporting vmstate: qcow2 and sheepdog. Sheepdog is deprecated. In qcow2 these requests go through .bdrv_co_p{read,write}v_part handlers. So, let's do our basic check for the request on vmstate generic handlers. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io

Re: [PULL 0/2] Block patches

2021-03-24 Thread Peter Maydell
On Wed, 24 Mar 2021 at 20:18, Vladimir Sementsov-Ogievskiy wrote: > > 24.03.2021 21:05, Peter Maydell wrote: > > On Wed, 24 Mar 2021 at 14:52, Stefan Hajnoczi wrote: > >> > >> Vladimir Sementsov-Ogievskiy (2): > >>migration/block-dirty-bitmap: make incoming disabled bitmaps busy > >>migra

Re: [PULL 0/2] Block patches

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2021 21:05, Peter Maydell wrote: On Wed, 24 Mar 2021 at 14:52, Stefan Hajnoczi wrote: The following changes since commit 67c1115edd98f388ca89dd38322ea3fadf034523: Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210323-pull-request' into staging (2021-03-23 23:47:30 +) ar

[PATCH for-6.0 7/7] hw/block/nvme: fix handling of private namespaces

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Prior to this patch, if a private nvme-ns device (that is, a namespace that is not linked to a subsystem) is wired up to an nvme-subsys linked nvme controller device, the device fails to verify that the namespace id is unique within the subsystem. NVM Express v1.4b, Section 6.1

[PATCH for-6.0 5/7] hw/block/nvme: fix warning about legacy namespace configuration

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Remove the unused BlockConf from the controller structure and fix the constraint checking to actually check the right BlockConf and issue the warning. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 1 - hw/block/nvme.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(

[PATCH for-6.0 4/7] hw/block/nvme: fix controller namespaces array indexing

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen The controller namespaces array being 0-indexed requires 'nsid - 1' everywhere. Something that is easy to miss. Align the controller namespaces array with the subsystem namespaces array such that both are 1-indexed. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 8 ---

[PATCH for-6.0 6/7] hw/block/nvme: update dmsrl limit on namespace detachment

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen The Non-MDTS DMSRL limit must be recomputed when namespaces are detached. Fixes: 645ce1a70cb6 ("hw/block/nvme: support namespace attachment command") Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 17 + 1 file changed, 17 insertions(+) diff --git a/hw/blo

[PATCH for-6.0 0/7] hw/block/nvme: misc fixes

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Various fixes for 6.0. Klaus Jensen (7): hw/block/nvme: fix pi constraint check hw/block/nvme: fix missing string representation for ns attachment hw/block/nvme: fix the nsid 'invalid' value hw/block/nvme: fix controller namespaces array indexing hw/block/nvme: fix w

[PATCH for-6.0 2/7] hw/block/nvme: fix missing string representation for ns attachment

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Add the missing nvme_adm_opc_str entry for the Namespace Attachment command. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index 5b0031b11db2..9edc86d79e98 100644 --- a/hw/block/nvme.h ++

[PATCH for-6.0 3/7] hw/block/nvme: fix the nsid 'invalid' value

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen The `nvme_nsid()` function returns '-1' (h) when the given namespace is NULL. Since h is actually a valid namespace identifier (the "broadcast" value), change this to be '0' since that actually *is* the invalid value. Signed-off-by: Klaus Jensen --- hw/block/

[PATCH for-6.0 1/7] hw/block/nvme: fix pi constraint check

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Protection Information can only be enabled if there is at least 8 bytes of metadata. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index 7f8d139a8663..ca04ee1bacf

Re: [PATCH v2 0/2] hw/block/nvme: coverity fixes

2021-03-24 Thread Klaus Jensen
On Mar 22 13:09, Klaus Jensen wrote: > From: Klaus Jensen > > Fix two issues reported by coverity (CID 1451080 and 1451082). > > v2: > - replace [2/2] with a fix for the bad reference counting noticed by > Max > > Klaus Jensen (2): > hw/block/nvme: fix resource leak in nvme_dif_rw > h

Re: [PATCH v2 2/2] vhost-user-blk: perform immediate cleanup if disconnect on initialization

2021-03-24 Thread Raphael Norwitz
Looks good, just clean up the commit message to reflect the way you've now split the patches. Reviewed-by: Raphael Norwitz On Wed, Mar 24, 2021 at 12:38:29PM +0300, Denis Plotnikov wrote: > Commit 4bcad76f4c39 ("vhost-user-blk: delay vhost_user_blk_disconnect") > introduced postponing vhost_dev

Re: [RFC v5 1/6] qmp: add QMP command x-debug-query-virtio

2021-03-24 Thread Dr. David Alan Gilbert
* Jonah Palmer (jonah.pal...@oracle.com) wrote: > From: Laurent Vivier > > --- /dev/null > +++ b/qapi/virtio.json > @@ -0,0 +1,68 @@ > +## > +# = Virtio devices > +## > + > +## > +# @VirtioType: > +# > +# An enumeration of Virtio device types. > +# > +# Since: 6.0 > +## > +{ 'enum': 'VirtioTyp

Re: [PATCH v2 1/2] vhost-user-blk: use different event handlers on initialization

2021-03-24 Thread Raphael Norwitz
Couple commit message NITs but otherwise I'm happy with this. Reviewed-by: Raphael Norwitz On Wed, Mar 24, 2021 at 12:38:28PM +0300, Denis Plotnikov wrote: > It is useful to use different connect/disconnect event handlers > on device initialization and operation as seen from the further > commit

Re: [PULL 0/2] Block patches

2021-03-24 Thread Peter Maydell
On Wed, 24 Mar 2021 at 14:52, Stefan Hajnoczi wrote: > > The following changes since commit 67c1115edd98f388ca89dd38322ea3fadf034523: > > Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210323-pull-request' > into staging (2021-03-23 23:47:30 +) > > are available in the Git repositor

[PATCH 2/6] hw/isa/vt82c686: Simplify removing unuseful qemu_allocate_irqs() call

2021-03-24 Thread Philippe Mathieu-Daudé
Instead of creating an input IRQ with qemu_allocate_irqs() to pass it as output IRQ of the PIC, with its handler simply dispatching into the "intr" output IRQ, simplify by directly connecting the PIC to the "intr" named output. Fixes: 3dc31cb8490 ("vt82c686: Move creation of ISA devices to the ISA

[PATCH 6/6] hw/southbridge/vt82c686: Introduce VT82C686B_SOUTHBRIDGE

2021-03-24 Thread Philippe Mathieu-Daudé
The VT82C686B south bridge is a single chipset. Model it as a single sysbus device. Move the vt82c686b_southbridge_init as via_southbridge_realize, add the QOM state: ViaSouthBridgeState. This device needs 2 properties to be realized: the PCI bus and its slot number. 2 aliases are exposed: the ISA

[PATCH 5/6] hw/ide/via: Connect IDE function output IRQs to the ISA function input

2021-03-24 Thread Philippe Mathieu-Daudé
To avoid abusing isa_get_irq(NULL) using a hidden ISA bridge under the hood, let the IDE function expose 2 output IRQs, and connect them to the ISA function inputs when creating the south bridge chipset model in vt82c686b_southbridge_init. Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/via.c

[PATCH 4/6] hw/ide/via: Replace magic 2 value by ARRAY_SIZE / MAX_IDE_DEVS

2021-03-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/via.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index be09912b334..6c667a92130 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -90,7 +90,7 @@ static void bmdma_setup_bar(PCIIDEState

[PATCH 3/6] hw/isa/vt82c686: Let ISA function expose ISA IRQs

2021-03-24 Thread Philippe Mathieu-Daudé
The 2 cascaded 8259 PIC are managed by the PCI function #0 (ISA bridge). Expose the 16 IRQs on this function, so other functions from the same chipset can access them. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/vt82c686.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-)

[PATCH 1/6] hw/isa/vt82c686: Name output IRQ as 'intr'

2021-03-24 Thread Philippe Mathieu-Daudé
Named IRQs are easier to understand in the monitor. Name the single output interrupt as 'intr'. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/vt82c686.c | 2 +- hw/mips/fuloong2e.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c i

[PATCH 0/6] hw/southbridge: QOM'ify vt82c686 as VT82C686B_SOUTHBRIDGE

2021-03-24 Thread Philippe Mathieu-Daudé
The motivation behind this series is to remove the isa_get_irq(NULL) call to simplify the ISA generic model. Philippe Mathieu-Daudé (6): hw/isa/vt82c686: Name output IRQ as 'intr' hw/isa/vt82c686: Simplify removing unuseful qemu_allocate_irqs() call hw/isa/vt82c686: Let ISA function expose I

Re: [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes

2021-03-24 Thread Paolo Bonzini
On 24/03/21 17:23, Stefan Hajnoczi wrote: On Wed, Mar 17, 2021 at 07:00:07PM +0100, Paolo Bonzini wrote: This is a resubmit of David Edmondson's series at https://patchew.org/QEMU/20210309144015.557477-1-david.edmond...@oracle.com/. After closer analysis on IRC, the CoRwlock's attempt to ensure

Re: [PATCH 4/6] coroutine-lock: reimplement CoRwlock to fix downgrade bug

2021-03-24 Thread Paolo Bonzini
On 24/03/21 17:15, Stefan Hajnoczi wrote: On Wed, Mar 17, 2021 at 07:00:11PM +0100, Paolo Bonzini wrote: +static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock) +{ +CoRwTicket *tkt = QSIMPLEQ_FIRST(&lock->tickets); +Coroutine *co = NULL; + +/* + * Setting lock->owners here pre

Re: [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes

2021-03-24 Thread Stefan Hajnoczi
On Wed, Mar 17, 2021 at 07:00:07PM +0100, Paolo Bonzini wrote: > This is a resubmit of David Edmondson's series at > https://patchew.org/QEMU/20210309144015.557477-1-david.edmond...@oracle.com/. > After closer analysis on IRC, the CoRwlock's attempt to ensure > fairness turned out to be flawed. Th

Re: [PATCH 4/6] coroutine-lock: reimplement CoRwlock to fix downgrade bug

2021-03-24 Thread Stefan Hajnoczi
On Wed, Mar 17, 2021 at 07:00:11PM +0100, Paolo Bonzini wrote: > +static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock) > +{ > +CoRwTicket *tkt = QSIMPLEQ_FIRST(&lock->tickets); > +Coroutine *co = NULL; > + > +/* > + * Setting lock->owners here prevents rdlock and wrlock from >

Re: [PATCH v2 0/5] qemu-iotests: quality of life improvements

2021-03-24 Thread Emanuele Giuseppe Esposito
On 23/03/2021 19:19, Paolo Bonzini wrote: This series adds a few usability improvements to qemu-iotests, in particular: - arguments can be passed to Python unittests scripts, for example to run only a subset of the test cases (patches 1-2) - it is possible to do "./check -- ../../../tests

Re: [PATCH V4] file-posix: allow -EBUSY error during ioctl(fd, BLKZEROOUT, range) on block

2021-03-24 Thread Nir Soffer
On Wed, Mar 24, 2021 at 4:52 PM Max Reitz wrote: > On 22.03.21 10:25, ChangLimin wrote: > > For Linux 5.10/5.11, qemu write zeros to a multipath device using > > ioctl(fd, BLKZEROOUT, range) with cache none or directsync return -EBUSY > > permanently. > > So as far as I can track back the discuss

Re: [PATCH v4 2/6] block: Allow changing bs->file on reopen

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2021 15:25, Alberto Garcia wrote: On Thu 18 Mar 2021 03:25:07 PM CET, Vladimir Sementsov-Ogievskiy wrote: static int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue, - Transaction *set_backings_

[PULL 0/2] Block patches

2021-03-24 Thread Stefan Hajnoczi
The following changes since commit 67c1115edd98f388ca89dd38322ea3fadf034523: Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210323-pull-request' into staging (2021-03-23 23:47:30 +) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-requ

[PULL 21/22] iotests: iothreads need ioeventfd

2021-03-24 Thread Alex Bennée
From: Laurent Vivier And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw, use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw for the tests that use iothreads. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message

[PULL 2/2] migrate-bitmaps-postcopy-test: check that we can't remove in-flight bitmaps

2021-03-24 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Check that we can't remove bitmaps being migrated on destination vm. The new check proves that previous commit helps. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Stefan Hajnoczi Message-Id: <20210322094906.5079-3-vsement...@virtuozzo.com> ---

[PULL 1/2] migration/block-dirty-bitmap: make incoming disabled bitmaps busy

2021-03-24 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Incoming enabled bitmaps are busy, because we do bdrv_dirty_bitmap_create_successor() for them. But disabled bitmaps being migrated are not marked busy, and user can remove them during the incoming migration. Then we may crash in cancel_incoming_locked() when tr

Re: [PATCH V4] file-posix: allow -EBUSY error during ioctl(fd, BLKZEROOUT, range) on block

2021-03-24 Thread Max Reitz
On 22.03.21 10:25, ChangLimin wrote: For Linux 5.10/5.11, qemu write zeros to a multipath device using ioctl(fd, BLKZEROOUT, range) with cache none or directsync return -EBUSY permanently. So as far as I can track back the discussion, Kevin asked on v1 why we’d set has_write_zeroes to false, i

[PULL 19/22] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182"

2021-03-24 Thread Alex Bennée
From: Laurent Vivier Commit f1d5516ab583 introduces a test in some iotests to check if the machine is a s390-ccw-virtio and to select virtio-*-ccw rather than virtio-*-pci. We don't need that because QEMU already provides aliases to use the correct virtio interface according to the machine type.

[PULL 20/22] iotests: test m68k with the virt machine

2021-03-24 Thread Alex Bennée
From: Laurent Vivier This allows to cover the virtio tests with a 32bit big-endian virtio-mmio machine. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20210319202335.2397060-6-laur...@vivier.eu> Message-Id:

[PULL 18/22] blockdev: with -drive if=virtio, use generic virtio-blk

2021-03-24 Thread Alex Bennée
From: Laurent Vivier Rather than checking if the machine is an s390x to use virtio-blk-ccw instead of virtio-blk-pci, use the alias virtio-blk that is set to the expected target. This also enables the use of virtio-blk-device for targets without PCI or CCW. Signed-off-by: Laurent Vivier Signed

Re: [PATCH 2/6] block/vdi: Don't assume that blocks are larger than VdiHeader

2021-03-24 Thread Max Reitz
On 17.03.21 19:00, Paolo Bonzini wrote: From: David Edmondson Given that the block size is read from the header of the VDI file, a wide variety of sizes might be seen. Rather than re-using a block sized memory region when writing the VDI header, allocate an appropriately sized buffer. Signed-o

Re: [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes

2021-03-24 Thread Max Reitz
On 17.03.21 19:00, Paolo Bonzini wrote: This is a resubmit of David Edmondson's series at https://patchew.org/QEMU/20210309144015.557477-1-david.edmond...@oracle.com/. After closer analysis on IRC, the CoRwlock's attempt to ensure fairness turned out to be flawed. Therefore, this series reimplem

Re: [PATCH 1/6] block/vdi: When writing new bmap entry fails, don't leak the buffer

2021-03-24 Thread Max Reitz
On 17.03.21 19:00, Paolo Bonzini wrote: From: David Edmondson If a new bitmap entry is allocated, requiring the entire block to be written, avoiding leaking the buffer allocated for the block should the write fail. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Edmondson Message-Id

Re: [PATCH v4 2/6] block: Allow changing bs->file on reopen

2021-03-24 Thread Alberto Garcia
On Thu 18 Mar 2021 03:25:07 PM CET, Vladimir Sementsov-Ogievskiy wrote: >> static int bdrv_reopen_prepare(BDRVReopenState *reopen_state, >> BlockReopenQueue *queue, >> - Transaction *set_backings_tran, Error >> **errp); >> +

[PATCH v2 1/2] vhost-user-blk: use different event handlers on initialization

2021-03-24 Thread Denis Plotnikov
It is useful to use different connect/disconnect event handlers on device initialization and operation as seen from the further commit fixing a bug on device initialization. The patch refactor the code to make use of them: we don't rely any more on the VM state for choosing how to cleanup the devi

[PATCH v2 2/2] vhost-user-blk: perform immediate cleanup if disconnect on initialization

2021-03-24 Thread Denis Plotnikov
Commit 4bcad76f4c39 ("vhost-user-blk: delay vhost_user_blk_disconnect") introduced postponing vhost_dev cleanup aiming to eliminate qemu aborts because of connection problems with vhost-blk daemon. However, it introdues a new problem. Now, any communication errors during execution of vhost_dev_ini

[PATCH v2 0/2] vhost-user-blk: fix bug on device disconnection during initialization

2021-03-24 Thread Denis Plotnikov
v2: * split the initial patch into two (Raphael) * rename init to realized (Raphael) * remove unrelated comment (Raphael) When the vhost-user-blk device lose the connection to the daemon during the initialization phase it kills qemu because of the assert in the code. The series fixes the bug

[PATCH] iotests: Fix typo in iotest 051

2021-03-24 Thread Tao Xu
There is an typo in iotest 051, correct it. Signed-off-by: Tao Xu --- tests/qemu-iotests/051| 2 +- tests/qemu-iotests/051.pc.out | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index f92161d8ef..1595babe82 100755 -

Re: [PATCH v2 2/5] qemu-iotests: allow passing unittest.main arguments to the test scripts

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2021 00:22, Paolo Bonzini wrote: On 23/03/21 20:17, Vladimir Sementsov-Ogievskiy wrote: +    unittest.main(argv=argv, +  testRunner=ReproducibleTestRunner, +  verbosity=2 if debug else 1, +  warnings=None if sys.warnoptions else 'ignore')  

Re: [PATCH v2 4/5] qemu-iotests: let "check" spawn an arbitrary test command

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2021 00:20, Paolo Bonzini wrote: On 23/03/21 20:12, Vladimir Sementsov-Ogievskiy wrote: Move the trailing empty line to print_env(), since it always looks better and one caller was not adding it. Seems you've moved this fix from one unrelated commit to another.. And it touches two ext