[PATCH v1] block/raw-format: implement .bdrv_get_specific_info handler

2021-07-06 Thread Or Ozeri
When using the raw format, allow exposing specific info by the underlying storage. In particular, this will enable RBD images using the raw format to indicate a LUKS2 encrypted image in the output of qemu-img info. Signed-off-by: Or Ozeri --- block/raw-format.c | 7 +++ 1 file changed, 7 in

Re: [RFC PATCH v2 1/7] hw/misc: Add device to help managing aliased memory regions

2021-07-06 Thread Philippe Mathieu-Daudé
On 4/22/21 3:33 AM, Richard Henderson wrote: > On 4/19/21 2:43 AM, Philippe Mathieu-Daudé wrote: >> Not really RFC, simply that I'v to add the technical description, >> but I'd like to know if there could be a possibility to not accept >> this device (because I missed something) before keeping work

Re: [PATCH] hw/sd: sdhci: Enable 64-bit system bus capability in the default SD/MMC host controller

2021-07-06 Thread Joanne Koong
Awesome! Thank you, Philippe and Bin! On Mon, Jul 5, 2021 at 2:54 AM Philippe Mathieu-Daudé wrote: > On 6/23/21 8:59 PM, Joanne Koong wrote: > > The default SD/MMC host controller uses SD spec v2.00. 64-bit system bus > capability > > was added in v2. > > > > In this change, we arrive at 0x15783

[PATCH] block/file-posix: Use O_RDWR for locking on macOS

2021-07-06 Thread Akihiko Odaki
qemu_lock_fd_test always returns 0 when fd is not open for writing and exclusive is true on macOS 11.3.1. Signed-off-by: Akihiko Odaki --- block/file-posix.c | 17 + 1 file changed, 17 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index b3fbb9bd63a..017fbc6b

Re: [PATCH v2 0/6] block: block-status cache for data regions

2021-07-06 Thread Kevin Wolf
Am 23.06.2021 um 17:01 hat Max Reitz geschrieben: > Hi, > > See the cover letter from v1 for the general idea: > > https://lists.nongnu.org/archive/html/qemu-block/2021-06/msg00843.html > > > The biggest change here in v2 is that instead of having a common CoMutex > protect the block-status cac

Re: [PATCH v4 01/34] modules: add modinfo macros

2021-07-06 Thread Paolo Bonzini
On 24/06/21 22:37, Eduardo Habkost wrote: On Thu, Jun 24, 2021 at 12:38:03PM +0200, Gerd Hoffmann wrote: Add macros for module info annotations. Instead of having that module meta-data stored in lists in util/module.c place directly in the module source code. [...] +/* module implements QOM

Re: [PATCH v2 2/6] block: block-status cache for data regions

2021-07-06 Thread Kevin Wolf
Am 23.06.2021 um 17:01 hat Max Reitz geschrieben: > As we have attempted before > (https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg06451.html, > "file-posix: Cache lseek result for data regions"; > https://lists.nongnu.org/archive/html/qemu-block/2021-02/msg00934.html, > "file-posix: Cache

[PATCH] block/replication.c: Properly attach children

2021-07-06 Thread Lukas Straub
The replication driver needs access to the children block-nodes of it's child so it can issue bdrv_make_empty to manage the replication. However, it does this by directly copying the BdrvChilds, which is wrong. Fix this by properly attaching the block-nodes with bdrv_attach_child(). Also, remove

Re: [PATCH v5 6/6] block: Make blockdev-reopen stable API

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2021 14:23, Kevin Wolf wrote: From: Alberto Garcia This patch drops the 'x-' prefix from x-blockdev-reopen. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v5 5/6] iotests: Test reopening multiple devices at the same time

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2021 14:23, Kevin Wolf wrote: From: Alberto Garcia This test swaps the images used by two active block devices. This is now possible thanks to the new ability to run x-blockdev-reopen on multiple devices at the same time. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf Review

Re: [PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-07-06 Thread Peter Lieven
> Am 06.07.2021 um 17:25 schrieb Kevin Wolf : > > Am 06.07.2021 um 16:55 hat Peter Lieven geschrieben: Am 06.07.2021 um 15:19 schrieb Kevin Wolf : >>> >>> Am 02.07.2021 um 19:23 hat Ilya Dryomov geschrieben: This series migrates the qemu rbd driver from the old aio emulation t

Re: [PATCH v5 4/6] block: Support multiple reopening with x-blockdev-reopen

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2021 14:23, Kevin Wolf wrote: From: Alberto Garcia [ kwolf: Fixed AioContext locking ] Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 18 +++-- blockdev.c

Re: [ovirt-users] Re: Any way to terminate stuck export task

2021-07-06 Thread Nir Soffer
On Tue, Jul 6, 2021 at 5:55 PM Gianluca Cecchi wrote: > > On Tue, Jul 6, 2021 at 2:52 PM Nir Soffer wrote: > >> >> >> Too bad. >> >> You can evaluate how ovirt 4.4. will work with this appliance using >> this dd command: >> >> dd if=/dev/zero bs=8M count=38400 of=/path/to/new/disk >> oflag=di

Re: [PATCH v5 3/6] block: Acquire AioContexts during bdrv_reopen_multiple()

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2021 14:23, Kevin Wolf wrote: As the BlockReopenQueue can contain nodes in multiple AioContexts, only one of which may be locked when AIO_WAIT_WHILE() can be called, we can't let the caller lock the right contexts. Instead, individually lock the AioContext of a single node when iterating th

Re: [PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-07-06 Thread Kevin Wolf
Am 06.07.2021 um 16:55 hat Peter Lieven geschrieben: > > Am 06.07.2021 um 15:19 schrieb Kevin Wolf : > > > > Am 02.07.2021 um 19:23 hat Ilya Dryomov geschrieben: > >> This series migrates the qemu rbd driver from the old aio emulation > >> to native coroutines and adds write zeroes support which

Re: [PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-07-06 Thread Peter Lieven
> Am 06.07.2021 um 15:19 schrieb Kevin Wolf : > > Am 02.07.2021 um 19:23 hat Ilya Dryomov geschrieben: >> This series migrates the qemu rbd driver from the old aio emulation >> to native coroutines and adds write zeroes support which is important >> for block operations. >> >> To achieve this

Re: [ovirt-users] Re: Any way to terminate stuck export task

2021-07-06 Thread Gianluca Cecchi
On Tue, Jul 6, 2021 at 2:52 PM Nir Soffer wrote: > > Too bad. > > You can evaluate how ovirt 4.4. will work with this appliance using > this dd command: > > dd if=/dev/zero bs=8M count=38400 of=/path/to/new/disk > oflag=direct conv=fsync > > We don't use dd for this, but the operation is the

Re: [PATCH v5 1/6] qcow2: Fix dangling pointer after reopen for 'file'

2021-07-06 Thread Kevin Wolf
Am 06.07.2021 um 15:12 hat Vladimir Sementsov-Ogievskiy geschrieben: > 06.07.2021 14:23, Kevin Wolf wrote: > > Without an external data file, s->data_file is a second pointer with the > > same value as bs->file. When changing bs->file to a different BdrvChild > > and freeing the old BdrvChild, s->d

Re: [PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-07-06 Thread Kevin Wolf
Am 02.07.2021 um 19:23 hat Ilya Dryomov geschrieben: > This series migrates the qemu rbd driver from the old aio emulation > to native coroutines and adds write zeroes support which is important > for block operations. > > To achieve this we first bump the librbd requirement to the already > outda

Re: [PATCH v5 1/3] block/file-posix: Optimize for macOS

2021-07-06 Thread Stefan Hajnoczi
On Mon, Jul 05, 2021 at 10:04:56PM +0900, Akihiko Odaki wrote: > This commit introduces "punch hole" operation and optimizes transfer > block size for macOS. > > Thanks to Konstantin Nazarov for detailed analysis of a flaw in an > old version of this change: > https://gist.github.com/akihikodaki/8

Re: [PATCH v5 2/6] block: Add bdrv_reopen_queue_free()

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2021 14:23, Kevin Wolf wrote: From: Alberto Garcia Move the code to free a BlockReopenQueue to a separate function. It will be used in a subsequent patch. [ kwolf: Also free explicit_options and options, and explicitly qobject_ref() the value when it continues to be used. This avoids

Re: [PATCH v5 1/6] qcow2: Fix dangling pointer after reopen for 'file'

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2021 14:23, Kevin Wolf wrote: Without an external data file, s->data_file is a second pointer with the same value as bs->file. When changing bs->file to a different BdrvChild and freeing the old BdrvChild, s->data_file must also be updated, otherwise it points to freed memory and causes cra

Re: [ovirt-users] Re: Any way to terminate stuck export task

2021-07-06 Thread Nir Soffer
On Tue, Jul 6, 2021 at 10:21 AM Gianluca Cecchi wrote: > > On Mon, Jul 5, 2021 at 5:06 PM Nir Soffer wrote: > >> >> >> qemu-img is busy in posix_fallocate(), wiring one byte to every 4k block. >> >> If you add -tt -T (as I suggested), we can see how much time each write >> takes, >> which may ex

Re: [PATCH]: /hw/nvme/ctrl error handling if descriptors are greater than 1024

2021-07-06 Thread Klaus Jensen
Hi Padmakar, Patch looks good, but it got messed up by your MUA. You've previously contributed correctly formatted patches, so please revert to that method when sending patches in the future ;) Reviewed-by: Klaus Jensen On Jul 6 16:13, Padmakar Kalghatgi wrote: From: padmakar if the nu

[PATCH v5 6/6] block: Make blockdev-reopen stable API

2021-07-06 Thread Kevin Wolf
From: Alberto Garcia This patch drops the 'x-' prefix from x-blockdev-reopen. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- qapi/block-core.json| 6 +++--- blockdev.c | 2 +- tests/qemu-iotests/155

[PATCH v5 1/6] qcow2: Fix dangling pointer after reopen for 'file'

2021-07-06 Thread Kevin Wolf
Without an external data file, s->data_file is a second pointer with the same value as bs->file. When changing bs->file to a different BdrvChild and freeing the old BdrvChild, s->data_file must also be updated, otherwise it points to freed memory and causes crashes. This problem was caught by iote

[PATCH v5 2/6] block: Add bdrv_reopen_queue_free()

2021-07-06 Thread Kevin Wolf
From: Alberto Garcia Move the code to free a BlockReopenQueue to a separate function. It will be used in a subsequent patch. [ kwolf: Also free explicit_options and options, and explicitly qobject_ref() the value when it continues to be used. This avoids memory leaks as we saw them in two re

[PATCH v5 0/6] Make blockdev-reopen stable

2021-07-06 Thread Kevin Wolf
This series picks up the remaining patches from Berto's series "[PATCH v4 0/6] Allow changing bs->file on reopen", which are not merged into master yet. Apart from renaming 'x-blockdev-reopen' into 'blockdev-reopen', the remaining functional change in this series is taking a list of nodes to reope

[PATCH v5 4/6] block: Support multiple reopening with x-blockdev-reopen

2021-07-06 Thread Kevin Wolf
From: Alberto Garcia [ kwolf: Fixed AioContext locking ] Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- qapi/block-core.json | 18 +++-- blockdev.c| 81 ++- tests/qemu-iotests/155

[PATCH v5 3/6] block: Acquire AioContexts during bdrv_reopen_multiple()

2021-07-06 Thread Kevin Wolf
As the BlockReopenQueue can contain nodes in multiple AioContexts, only one of which may be locked when AIO_WAIT_WHILE() can be called, we can't let the caller lock the right contexts. Instead, individually lock the AioContext of a single node when iterating the queue. Reintroduce bdrv_reopen() as

[PATCH v5 5/6] iotests: Test reopening multiple devices at the same time

2021-07-06 Thread Kevin Wolf
From: Alberto Garcia This test swaps the images used by two active block devices. This is now possible thanks to the new ability to run x-blockdev-reopen on multiple devices at the same time. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- tests/qemu-iotests/245 | 47

[PATCH]: /hw/nvme/ctrl error handling if descriptors are greater than 1024

2021-07-06 Thread Padmakar Kalghatgi
From: padmakar if the number of descriptors or pages is more than 1024, dma writes or reads will result in failure. Hence, we check if the number of descriptors or pages is more than 1024 in the nvme module and return Internal Device error. Signed-off-by: Padmakar Kalghatgi --- hw/nvme

Re: [PATCH 07/10] iotests/297: return error code from run_linters()

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
25.06.2021 21:20, John Snow wrote: This turns run_linters() into a bit of a hybrid test; returning non-zero on failed execution while also printing diffable information. This is done for the benefit of the avocado simple test runner, which will soon be attempting to execute this test from a diffe

Re: [PATCH 06/10] iotests/297: Add 'directory' argument to run_linters

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
25.06.2021 21:20, John Snow wrote: Allow run_linters to work well if it's executed from a different directory. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH 05/10] iotests/297: Separate environment setup from test execution

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
25.06.2021 21:20, John Snow wrote: Move environment setup into main(), leaving pure test execution behind in run_linters(). Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

[PATCH 0/4] hw/nvme: fix controller hotplugging

2021-07-06 Thread Klaus Jensen
From: Klaus Jensen Back in May, Hannes posted a fix[1] to re-enable NVMe PCI hotplug. We discussed a bit back and fourth and I mentioned that the core issue was an artifact of the parent/child relationship stemming from the qdev setup we have with namespaces attaching to controller through a qdev

[PATCH 2/4] hw/nvme: mark nvme-subsys non-hotpluggable

2021-07-06 Thread Klaus Jensen
From: Klaus Jensen We currently lack the infrastructure to handle subsystem hotplugging, so disable it. Signed-off-by: Klaus Jensen --- hw/nvme/subsys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nvme/subsys.c b/hw/nvme/subsys.c index 192223d17ca1..dc7a96862f37 100644 --- a/hw/nvme

[PATCH 3/4] hw/nvme: unregister controller with subsystem at exit

2021-07-06 Thread Klaus Jensen
From: Klaus Jensen Make sure the controller is unregistered from the subsystem when device is removed. Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h | 1 + hw/nvme/ctrl.c | 4 hw/nvme/subsys.c | 5 + 3 files changed, 10 insertions(+) diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h

[PATCH 1/4] hw/nvme: remove NvmeCtrl parameter from ns setup/check functions

2021-07-06 Thread Klaus Jensen
From: Klaus Jensen The nvme_ns_setup and nvme_ns_check_constraints should not depend on the controller state. Refactor and remove it. Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h | 2 +- hw/nvme/ctrl.c | 2 +- hw/nvme/ns.c | 37 ++--- 3 files changed, 20 i

Re: [PATCH 04/10] iotests/297: Create main() function

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
25.06.2021 21:20, John Snow wrote: Instead of running "run_linters" directly, create a main() function that will be responsible for environment setup, leaving run_linters() responsible only for execution of the linters. (That environment setup will be moved over in forthcoming commits.) Signed-

[PATCH 4/4] hw/nvme: fix controller hot unplugging

2021-07-06 Thread Klaus Jensen
From: Klaus Jensen Prior to this patch the nvme-ns devices are always children of the NvmeBus owned by the NvmeCtrl. This causes the namespaces to be unrealized when the parent device is removed. However, when subsystems are involved, this is not what we want since the namespaces may be attached

Re: [PATCH 03/10] iotests/297: Don't rely on distro-specific linter binaries

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
25.06.2021 21:20, John Snow wrote: 'pylint-3' is another Fedora-ism. Use "python3 -m pylint" or "python3 -m mypy" to access these scripts instead. This style of invocation will prefer the "correct" tool when run in a virtual environment. Note that we still check for "pylint-3" before the test be

Re: [PATCH 02/10] iotests/297: Add get_files() function

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
25.06.2021 21:20, John Snow wrote: Split out file discovery into its own method to begin separating out the "environment setup" and "test execution" phases. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/297 | 11 +-- 1 file changed, 9

Re: [PATCH 01/10] iotests/297: modify is_python_file to work from any CWD

2021-07-06 Thread Vladimir Sementsov-Ogievskiy
25.06.2021 21:20, John Snow wrote: Add a directory argument to is_python_file to allow it to work correctly no matter what CWD we happen to run it from. This is done in anticipation of running the iotests from another directory (./python/). Signed-off-by: John Snow Reviewed-by: Vladimir Sement

Re: [PATCH] hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine

2021-07-06 Thread Philippe Mathieu-Daudé
On 7/6/21 10:24 AM, Thomas Huth wrote: > On 16/04/2021 14.52, Thomas Huth wrote: >> QEMU currently crashes when the user tries to do something like: >> >>   qemu-system-x86_64 -M x-remote -device piix3-ide > > It's now several months later already, and this crash has still not been > fixed yet. Th

Re: [PATCH] hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine

2021-07-06 Thread Thomas Huth
On 16/04/2021 14.52, Thomas Huth wrote: QEMU currently crashes when the user tries to do something like: qemu-system-x86_64 -M x-remote -device piix3-ide It's now several months later already, and this crash has still not been fixed yet. The next softfreeze is around the corner and the "de

Re: [ovirt-users] Re: Any way to terminate stuck export task

2021-07-06 Thread Gianluca Cecchi
On Mon, Jul 5, 2021 at 5:06 PM Nir Soffer wrote: > > qemu-img is busy in posix_fallocate(), wiring one byte to every 4k block. > > If you add -tt -T (as I suggested), we can see how much time each write > takes, > which may explain why this takes so much time. > > strace -f -p 14342 --tt -T