qemu-patch-raspberry4/include
Max Reitz 0972fbf353 block: Add bdrv_qapi_perm_to_blk_perm()
We need some way to correlate QAPI BlockPermission values with
BLK_PERM_* flags.  We could:

(1) have the same order in the QAPI definition as the the BLK_PERM_*
    flags are in LSb-first order.  However, then there is no guarantee
    that they actually match (e.g. when someone modifies the QAPI schema
    without thinking of the BLK_PERM_* definitions).
    We could add static assertions, but these would break what’s good
    about this solution, namely its simplicity.

(2) define the BLK_PERM_* flags based on the BlockPermission values.
    But this way whenever someone were to modify the QAPI order
    (perfectly sensible in theory), the BLK_PERM_* values would change.
    Because these values are used for file locking, this might break
    file locking between different qemu versions.

Therefore, go the slightly more cumbersome way: Add a function to
translate from the QAPI constants to the BLK_PERM_* flags.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20191108123455.39445-2-mreitz@redhat.com
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 7b1d9c4df0)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2020-06-22 12:38:31 -05:00
..
authz Include generated QAPI headers less 2019-08-16 13:31:51 +02:00
block block: Add bdrv_qapi_perm_to_blk_perm() 2020-06-22 12:38:31 -05:00
chardev Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
crypto crypto: define cleanup functions for use with g_autoptr 2019-08-22 10:47:12 +01:00
disas plugin: add qemu_plugin_insn_disas helper 2019-10-28 15:12:38 +00:00
exec TCG Plugins initial implementation 2019-10-30 14:10:32 +00:00
fpu fpu: make softfloat-macros "self-contained" 2019-08-19 12:07:13 +01:00
hw virtio: add ability to delete vq through a pointer 2020-05-12 09:19:15 -05:00
io socket: Add num connections to qio_net_listener_open_sync() 2019-09-03 23:24:42 +02:00
libdecnumber include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
migration migration: add new migration state wait-unplug 2019-10-29 18:55:26 -04:00
monitor Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
net Include qemu/queue.h slightly less 2019-08-16 13:31:52 +02:00
qapi qapi: Make visit_next_list()'s comment less confusing 2019-09-24 11:03:44 +02:00
qemu job: refactor progress to separate object 2020-06-03 19:53:06 -05:00
qom vl: Split off user_creatable_print_help() 2019-10-14 17:12:48 +02:00
scsi scsi: explicitly list guest-recoverable sense codes 2019-07-15 11:20:42 +02:00
standard-headers linux headers: update against v5.4-rc1 2019-10-15 18:09:02 +01:00
sysemu kvm: Introduce KVM irqchip change notifier 2019-11-26 10:11:30 +11:00
ui ui/egl: fix framebuffer reads 2019-09-17 13:42:02 +02:00
user *-user: plugin syscalls 2019-10-28 15:12:38 +00:00
elf.h linux-user: elf: ELF_HWCAP for s390x 2019-06-07 14:53:26 +02:00
glib-compat.h glib: bump min required glib library version to 2.48 2019-08-22 10:46:34 +01:00
qemu-common.h exec: Split out variable page size support to exec-vary.c 2019-10-28 10:26:02 +01:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00