qemu-e2k/include
Max Reitz 7b1d9c4df0 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>
2020-01-06 13:43:06 +01:00
..
authz
block block: Add bdrv_qapi_perm_to_blk_perm() 2020-01-06 13:43:06 +01:00
chardev
crypto crypto: Fix typo in QCryptoTLSSession's <example> comment 2019-12-18 08:36:15 +01:00
disas plugin: add qemu_plugin_insn_disas helper 2019-10-28 15:12:38 +00:00
exec Various testing and logging updates 2019-12-20 14:00:49 +00:00
fpu
hw hw/pci: Remove the "command_serr_enable" property 2019-12-18 02:34:12 +01:00
io io: Fix Error usage in a comment <example> 2019-12-18 08:36:15 +01:00
libdecnumber
migration migration: add new migration state wait-unplug 2019-10-29 18:55:26 -04:00
monitor hmp: drop Error pointer indirection in hmp_handle_error 2019-12-18 08:36:16 +01:00
net
qapi error: make Error **errp const where it is appropriate 2019-12-18 08:36:16 +01:00
qemu Various testing and logging updates 2019-12-20 14:00:49 +00:00
qom * More uses of RCU_READ_LOCK_GUARD (Dave, myself) 2019-12-20 11:20:25 +00:00
scsi
standard-headers linux-headers: Update 2019-12-17 10:39:48 +11:00
sysemu hw/i386: De-duplicate gsi_handler() to remove kvm_pc_gsi_handler() 2019-12-17 19:33:51 +01:00
ui
user *-user: plugin syscalls 2019-10-28 15:12:38 +00:00
elf.h
glib-compat.h
qemu-common.h
qemu-io.h
trace-tcg.h