qemu/qapi
Denis V. Lunev 59ecd8a1ac block/monitor: reject persistent bitmap add on a read-only node
qmp_block_dirty_bitmap_add() marks a new bitmap persistent without
checking write access to its node. bdrv_create_dirty_bitmap() always
creates bitmaps writable, so a persistent bitmap added to an
already read-only node stays writable in memory on a node that can
never store it, and the next global inactivation fails:

  Lost persistent bitmaps during inactivation of node '<node>': No write access
  migration_block_inactivate: bdrv_inactivate_all() failed: -22

Forcing it read-only instead does not help: it was never stored,
so it stays unpromotable on the next reopen to read-write and can
trip bdrv_set_dirty()'s readonly assert on the first write. Reject
the add instead, for both read-only and inactive nodes -- an
already-inactive node skips qcow2_inactivate() on close, so a
bitmap added during that window would never get stored either.
Wrapped in a transaction, this denies the whole transaction, since
qmp_transaction() is already all-or-none.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: John Snow <jsnow@redhat.com>
CC: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20260716112242.3000035-2-den@openvz.org>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
2026-08-17 18:32:44 +03:00
..
accelerator.json hw/core: Deprecate query-kvm 2026-05-05 12:34:11 +02:00
acpi-hest.json qapi: Clean up whitespace between definitions 2025-11-04 13:34:42 +01:00
acpi.json qapi: add cross-references to acpi.json 2025-07-14 12:52:46 +02:00
audio.json qapi/audio: Fix description markup of AudiodevDBusOptions @nsamples 2025-11-04 13:34:42 +01:00
authz.json qapi: add cross-references to authz.json 2025-07-14 12:52:46 +02:00
block-core.json block/monitor: reject persistent bitmap add on a read-only node 2026-08-17 18:32:44 +03:00
block-export.json qapi/block-export: Document FUSE's multi-threading 2026-03-10 12:12:04 +01:00
block.json qapi: add cross-references to block layer 2025-07-14 12:55:17 +02:00
char.json qapi: drop "must exist" from ID descriptions for consistency 2026-06-15 16:03:07 +02:00
common.json docs/sphinx: remove special parsing for freeform sections 2025-07-14 10:08:27 +02:00
compat.json docs/sphinx: remove special parsing for freeform sections 2025-07-14 10:08:27 +02:00
control.json qapi: add cross-references to misc modules 2025-07-14 12:58:13 +02:00
crypto.json crypto/cipher: Add GCM to QCryptoCipherMode 2026-08-11 18:25:58 +02:00
cryptodev.json qapi: remove trivial "Returns:" sections 2025-07-14 12:35:29 +02:00
cxl.json hw/cxl/events: Updates for rev3.2 memory module event record 2026-02-20 13:04:45 -05:00
dump.json qapi/dump: add allowed-by-guest feature to win-dmp 2026-08-04 23:21:40 +04:00
ebpf.json qapi: add cross-references to misc modules 2025-07-14 12:58:13 +02:00
error.json docs/sphinx: remove special parsing for freeform sections 2025-07-14 10:08:27 +02:00
introspect.json qapi: Refill doc comments to conform to conventions 2025-11-04 13:34:42 +01:00
job.json Fix several typos in documentation (found by codespell) 2026-03-23 19:55:24 +03:00
machine-common.json qapi: Fix misspelled section tags in doc comments 2026-07-14 10:53:03 +02:00
machine-s390x.json qapi: Refill doc comments to conform to conventions 2025-11-04 13:34:42 +01:00
machine.json hw/s390x/virtio-ccw: Always inject NMI to first CPU 2026-08-16 16:32:42 +02:00
meson.build qapi/acpi-hest: add an interface to do generic CPER error injection 2025-10-05 08:06:32 -04:00
migration.json spelling: happend 2026-07-23 17:57:09 +03:00
misc-arm.json qdev: Add an OasMode property type 2026-03-24 14:02:29 +00:00
misc-i386.json qapi: Clean up whitespace between definitions 2025-11-04 13:34:42 +01:00
misc.json qapi/iothread: introduce poll-weight parameter for aio-poll 2026-04-29 11:31:44 -04:00
net.json qapi/net: Drop unused type String 2026-05-21 13:11:05 +02:00
opts-visitor.c qapi: Inline and remove QERR_INVALID_PARAMETER definition 2024-04-24 09:50:58 +02:00
pci.json qapi: add cross-references to pci.json 2025-07-14 12:58:13 +02:00
pragma.json qdev: Add a SsidSizeMode property type 2026-03-24 14:02:29 +00:00
qapi-clone-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qapi-dealloc-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qapi-forward-visitor.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qapi-schema.json qapi/acpi-hest: add an interface to do generic CPER error injection 2025-10-05 08:06:32 -04:00
qapi-type-helpers.c qapi: New strv_from_str_list() 2024-03-04 07:12:40 +01:00
qapi-util.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qapi-visit-core.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qdev.json qapi: Refill doc comments to conform to conventions 2025-11-04 13:34:42 +01:00
qmp-dispatch.c qapi/qmp-dispatch: Include 'qemu/aio-wait.h' and 'monitor/monitor.h' 2026-08-16 16:32:42 +02:00
qmp-event.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qmp-registry.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qobject-input-visitor.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qobject-output-visitor.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qom.json qapi: Fix misspelled section tags in doc comments 2026-07-14 10:53:03 +02:00
replay.json qapi: add cross-references to replay.json 2025-07-14 12:58:13 +02:00
rocker.json qapi: remove trivial "Returns:" sections 2025-07-14 12:35:29 +02:00
run-state.json hw/s390x/virtio-ccw: Always inject NMI to first CPU 2026-08-16 16:32:42 +02:00
sockets.json qapi: Refill doc comments to conform to conventions 2025-11-04 13:34:42 +01:00
stats.json qapi: Refill doc comments to conform to conventions 2025-11-04 13:34:42 +01:00
string-input-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
string-output-visitor.c string-output-visitor: Fix (pseudo) struct handling 2024-01-26 11:16:58 +01:00
tpm.json qapi: remove trivial "Returns:" sections 2025-07-14 12:35:29 +02:00
trace-events qapi: Generalize struct member policy checking 2021-10-29 18:23:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
trace.json qapi: rephrase return docs to avoid type name 2025-07-14 12:35:39 +02:00
transaction.json qapi: add cross-references to block layer 2025-07-14 12:55:17 +02:00
uefi.json Fix several typos in documentation (found by codespell) 2026-03-23 19:55:24 +03:00
ui.json ui/gtk: Turn clipboard flag into runtime option 2026-04-28 18:53:59 +04:00
vfio.json vfio/migration: Send VFIO_MIGRATION event before PRE_COPY_P2P transition 2026-02-18 10:54:57 +01:00
virtio.json qapi: remove user addresses from x-query-virtio-vhost-queue-status 2026-06-03 08:36:12 -04:00
yank.json qapi: add cross-references to yank.json 2025-07-14 12:58:13 +02:00