1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Stefan Reiter <s.reiter@proxmox.com>
3 Date: Wed, 10 Feb 2021 11:07:06 +0100
4 Subject: [PATCH] PBS: add master key support
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 this requires a new enough libproxmox-backup-qemu0, and allows querying
10 from the PVE side to avoid QMP calls with unsupported parameters.
12 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
13 Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
15 block/monitor/block-hmp-cmds.c | 1 +
17 qapi/block-core.json | 7 +++++++
18 3 files changed, 11 insertions(+)
20 diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
21 index 11c84d5508..0932deb28c 100644
22 --- a/block/monitor/block-hmp-cmds.c
23 +++ b/block/monitor/block-hmp-cmds.c
24 @@ -1036,6 +1036,7 @@ void coroutine_fn hmp_backup(Monitor *mon, const QDict *qdict)
25 false, NULL, // PBS password
26 false, NULL, // PBS keyfile
27 false, NULL, // PBS key_password
28 + false, NULL, // PBS master_keyfile
29 false, NULL, // PBS fingerprint
30 false, NULL, // PBS backup-id
31 false, 0, // PBS backup-time
32 diff --git a/pve-backup.c b/pve-backup.c
33 index f7597ae55c..0ecadf6ce6 100644
36 @@ -531,6 +531,7 @@ UuidInfo coroutine_fn *qmp_backup(
37 bool has_password, const char *password,
38 bool has_keyfile, const char *keyfile,
39 bool has_key_password, const char *key_password,
40 + bool has_master_keyfile, const char *master_keyfile,
41 bool has_fingerprint, const char *fingerprint,
42 bool has_backup_id, const char *backup_id,
43 bool has_backup_time, int64_t backup_time,
44 @@ -679,6 +680,7 @@ UuidInfo coroutine_fn *qmp_backup(
45 has_password ? password : NULL,
46 has_keyfile ? keyfile : NULL,
47 has_key_password ? key_password : NULL,
48 + has_master_keyfile ? master_keyfile : NULL,
49 has_compress ? compress : true,
50 has_encrypt ? encrypt : has_keyfile,
51 has_fingerprint ? fingerprint : NULL,
52 @@ -1041,5 +1043,6 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
53 ret->pbs_dirty_bitmap = true;
54 ret->query_bitmap_info = true;
55 ret->pbs_dirty_bitmap_migration = true;
56 + ret->pbs_masterkey = true;
59 diff --git a/qapi/block-core.json b/qapi/block-core.json
60 index 82133e2bee..be3d6a0d37 100644
61 --- a/qapi/block-core.json
62 +++ b/qapi/block-core.json
65 # @key-password: password for keyfile (optional for format 'pbs')
67 +# @master-keyfile: PEM-formatted master public keyfile (optional for format 'pbs')
69 # @fingerprint: server cert fingerprint (optional for format 'pbs')
71 # @backup-id: backup ID (required for format 'pbs')
75 '*key-password': 'str',
76 + '*master-keyfile': 'str',
77 '*fingerprint': 'str',
79 '*backup-time': 'int',
81 # migration cap if this is false/unset may lead
82 # to crashes on migration!
84 +# @pbs-masterkey: True if the QMP backup call supports the 'master_keyfile'
87 # @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
91 'data': { 'pbs-dirty-bitmap': 'bool',
92 'query-bitmap-info': 'bool',
93 'pbs-dirty-bitmap-migration': 'bool',
94 + 'pbs-masterkey': 'bool',
95 'pbs-library-version': 'str' } }