2020-07-09 14:15:49 +03:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Stefan Reiter <s.reiter@proxmox.com>
|
|
|
|
Date: Wed, 8 Jul 2020 11:57:53 +0200
|
|
|
|
Subject: [PATCH] PVE: add query_proxmox_support QMP command
|
|
|
|
|
|
|
|
Generic interface for future use, currently used for PBS dirty-bitmap
|
|
|
|
backup support.
|
|
|
|
|
|
|
|
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
|
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
2020-11-24 18:41:20 +03:00
|
|
|
[PVE: query-proxmox-support: include library version]
|
|
|
|
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
|
2020-07-09 14:15:49 +03:00
|
|
|
---
|
2021-03-16 19:30:22 +03:00
|
|
|
pve-backup.c | 9 +++++++++
|
|
|
|
qapi/block-core.json | 29 +++++++++++++++++++++++++++++
|
|
|
|
2 files changed, 38 insertions(+)
|
2020-07-09 14:15:49 +03:00
|
|
|
|
|
|
|
diff --git a/pve-backup.c b/pve-backup.c
|
2022-12-14 17:16:32 +03:00
|
|
|
index e113ab61b9..9318ca4f0c 100644
|
2020-07-09 14:15:49 +03:00
|
|
|
--- a/pve-backup.c
|
|
|
|
+++ b/pve-backup.c
|
2022-12-14 17:16:32 +03:00
|
|
|
@@ -1072,3 +1072,12 @@ BackupStatus *qmp_query_backup(Error **errp)
|
2020-07-09 14:15:49 +03:00
|
|
|
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
|
|
|
|
+{
|
|
|
|
+ ProxmoxSupportStatus *ret = g_malloc0(sizeof(*ret));
|
2020-11-24 18:41:20 +03:00
|
|
|
+ ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
|
2020-07-09 14:15:49 +03:00
|
|
|
+ ret->pbs_dirty_bitmap = true;
|
2021-03-16 19:30:22 +03:00
|
|
|
+ ret->pbs_dirty_bitmap_savevm = true;
|
2020-07-09 14:15:49 +03:00
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
diff --git a/qapi/block-core.json b/qapi/block-core.json
|
2022-12-14 17:16:32 +03:00
|
|
|
index 45b63dfe26..8b0e0d92de 100644
|
2020-07-09 14:15:49 +03:00
|
|
|
--- a/qapi/block-core.json
|
|
|
|
+++ b/qapi/block-core.json
|
update submodule and patches to 7.1.0
Notable changes:
* The only big change is the switch to using a custom QIOChannel for
savevm-async, because the previously used QEMUFileOps was dropped.
Changes to the current implementation:
* Switch to vector based methods as required for an IO channel. For
short reads the passed-in IO vector is stuffed with zeroes at the
end, just to be sure.
* For reading: The documentation in include/io/channel.h states that
at least one byte should be read, so also error out when whe are
at the very end instead of returning 0.
* For reading: Fix off-by-one error when request goes beyond end.
The wrong code piece was:
if ((pos + size) > maxlen) {
size = maxlen - pos - 1;
}
Previously, the last byte would not be read. It's actually
possible to get a snapshot .raw file that has content all the way
up the final 512 byte (= BDRV_SECTOR_SIZE) boundary without any
trailing zero bytes (I wrote a script to do it).
Luckily, it didn't cause a real issue, because qemu_loadvm_state()
is not interested in the final (i.e. QEMU_VM_VMDESCRIPTION)
section. The buffer for reading it is simply freed up afterwards
and the function will assume that it read the whole section, even
if that's not the case.
* For writing: Make use of the generated blk_pwritev() wrapper
instead of manually wrapping the coroutine to simplify and save a
few lines.
* Adapt to changed interfaces for blk_{pread,pwrite}:
* a9262f551e ("block: Change blk_{pread,pwrite}() param order")
* 3b35d4542c ("block: Add a 'flags' param to blk_pread()")
* bf5b16fa40 ("block: Make blk_{pread,pwrite}() return 0 on success")
Those changes especially affected the qemu-img dd patches, because
the context also changed, but also some of our block drivers used
the functions.
* Drop qemu-common.h include: it got renamed after essentially
everything was moved to other headers. The only remaining user I
could find for things dropped from the header between 7.0 and 7.1
was qemu_get_vm_name() in the iscsi-initiatorname patch, but it
already includes the header to which the function was moved.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-10-14 15:07:13 +03:00
|
|
|
@@ -863,6 +863,35 @@
|
2020-07-09 14:15:49 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'backup-cancel' }
|
|
|
|
|
|
|
|
+##
|
|
|
|
+# @ProxmoxSupportStatus:
|
|
|
|
+#
|
|
|
|
+# Contains info about supported features added by Proxmox.
|
|
|
|
+#
|
|
|
|
+# @pbs-dirty-bitmap: True if dirty-bitmap-incremental backups to PBS are
|
|
|
|
+# supported.
|
|
|
|
+#
|
2021-03-16 19:30:22 +03:00
|
|
|
+# @pbs-dirty-bitmap-savevm: True if 'dirty-bitmaps' migration capability can
|
|
|
|
+# safely be set for savevm-async.
|
|
|
|
+#
|
2020-11-24 18:41:20 +03:00
|
|
|
+# @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
|
|
|
|
+#
|
2020-07-09 14:15:49 +03:00
|
|
|
+##
|
|
|
|
+{ 'struct': 'ProxmoxSupportStatus',
|
2020-11-24 18:41:20 +03:00
|
|
|
+ 'data': { 'pbs-dirty-bitmap': 'bool',
|
2021-03-16 19:30:22 +03:00
|
|
|
+ 'pbs-dirty-bitmap-savevm': 'bool',
|
2020-11-24 18:41:20 +03:00
|
|
|
+ 'pbs-library-version': 'str' } }
|
2020-07-09 14:15:49 +03:00
|
|
|
+
|
|
|
|
+##
|
|
|
|
+# @query-proxmox-support:
|
|
|
|
+#
|
|
|
|
+# Returns information about supported features added by Proxmox.
|
|
|
|
+#
|
|
|
|
+# Returns: @ProxmoxSupportStatus
|
|
|
|
+#
|
|
|
|
+##
|
|
|
|
+{ 'command': 'query-proxmox-support', 'returns': 'ProxmoxSupportStatus' }
|
|
|
|
+
|
|
|
|
##
|
|
|
|
# @BlockDeviceTimedStats:
|
|
|
|
#
|