@@ -42,6 +42,9 @@ struct QCryptoBlock {
size_t niv;
uint64_t payload_offset; /* In bytes */
uint64_t sector_size; /* In bytes */
+
+ bool detached_header; /* True if disk has a detached LUKS header */
+ uint64_t detached_header_size; /* LUKS header size plus key slot size */
};
struct QCryptoBlockDriver {
@@ -4948,6 +4948,8 @@
# @file: Node to create the image format on, mandatory except when
# 'preallocation' is not requested
#
+# @header: Detached LUKS header node to format. (since 9.0)
+#
# @size: Size of the virtual disk in bytes
#
# @preallocation: Preallocation mode for the new image (since: 4.2)
@@ -4958,6 +4960,7 @@
{ 'struct': 'BlockdevCreateOptionsLUKS',
'base': 'QCryptoBlockCreateOptionsLUKS',
'data': { '*file': 'BlockdevRef',
+ '*header': 'BlockdevRef',
'size': 'size',
'*preallocation': 'PreallocMode' } }
@@ -195,10 +195,13 @@
# decryption key. Mandatory except when probing image for
# metadata only.
#
+# @detached-header: if true, disk has detached LUKS header.
+#
# Since: 2.6
##
{ 'struct': 'QCryptoBlockOptionsLUKS',
- 'data': { '*key-secret': 'str' }}
+ 'data': { '*key-secret': 'str',
+ '*detached-header': 'bool' }}
##
# @QCryptoBlockCreateOptionsLUKS:
Introduce 'header' field in BlockdevCreateOptionsLUKS to support detached LUKS header creation. Meanwhile, introduce header-related field in QCryptoBlock. Signed-off-by: Hyman Huang <yong.huang@smartx.com> --- crypto/blockpriv.h | 3 +++ qapi/block-core.json | 3 +++ qapi/crypto.json | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-)