* [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output
@ 2020-11-24 15:41 Stefan Reiter
2020-11-24 15:41 ` [pve-devel] [PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library version' Stefan Reiter
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Stefan Reiter @ 2020-11-24 15:41 UTC (permalink / raw)
To: pve-devel
v3:
* use function, as header macro was compiled into QEMU, not the library
pve-qemu: Stefan Reiter (1):
update patches with squashed in 'include library version'
...dd-query_proxmox_support-QMP-command.patch | 22 ++++++++++------
...issing-crypt-and-compress-parameters.patch | 2 +-
...rite-callback-with-big-blocks-correc.patch | 2 +-
...-block-handling-to-PBS-dump-callback.patch | 2 +-
...E-add-query-pbs-bitmap-info-QMP-call.patch | 23 +++++++++--------
...-transaction-to-synchronize-job-stat.patch | 2 +-
...ore-coroutines-and-don-t-block-on-fi.patch | 4 +--
...n-up-error-handling-for-create_backu.patch | 2 +-
...igrate-dirty-bitmap-state-via-savevm.patch | 25 ++++++++++---------
9 files changed, 47 insertions(+), 37 deletions(-)
proxmox-backup-qemu: Stefan Reiter (1):
return version via rust fn instead of header define
Makefile | 2 +-
build.rs | 6 +++---
current-api.h | 7 +++++--
src/lib.rs | 13 +++++++++++++
4 files changed, 22 insertions(+), 6 deletions(-)
qemu-server: Stefan Reiter (1):
print query-proxmox-support result in 'full' status
PVE/CLI/qm.pm | 2 +-
PVE/QemuServer.pm | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
--
2.20.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] [PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library version'
2020-11-24 15:41 [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Stefan Reiter
@ 2020-11-24 15:41 ` Stefan Reiter
2020-11-25 10:59 ` [pve-devel] applied: " Fabian Grünbichler
2020-11-24 15:41 ` [pve-devel] [PATCH v3 proxmox-backup-qemu 2/3] return version via rust fn instead of header define Stefan Reiter
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Stefan Reiter @ 2020-11-24 15:41 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
v3: use function instead of macro from lib
Requires a depends on bumped library to find function.
...dd-query_proxmox_support-QMP-command.patch | 22 ++++++++++------
...issing-crypt-and-compress-parameters.patch | 2 +-
...rite-callback-with-big-blocks-correc.patch | 2 +-
...-block-handling-to-PBS-dump-callback.patch | 2 +-
...E-add-query-pbs-bitmap-info-QMP-call.patch | 23 +++++++++--------
...-transaction-to-synchronize-job-stat.patch | 2 +-
...ore-coroutines-and-don-t-block-on-fi.patch | 4 +--
...n-up-error-handling-for-create_backu.patch | 2 +-
...igrate-dirty-bitmap-state-via-savevm.patch | 25 ++++++++++---------
9 files changed, 47 insertions(+), 37 deletions(-)
diff --git a/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch b/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch
index 1549af3..e2dc20f 100644
--- a/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch
+++ b/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch
@@ -8,16 +8,18 @@ backup support.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
+[PVE: query-proxmox-support: include library version]
+Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
- pve-backup.c | 7 +++++++
- qapi/block-core.json | 22 ++++++++++++++++++++++
- 2 files changed, 29 insertions(+)
+ pve-backup.c | 8 ++++++++
+ qapi/block-core.json | 25 +++++++++++++++++++++++++
+ 2 files changed, 33 insertions(+)
diff --git a/pve-backup.c b/pve-backup.c
-index bfb648d6b5..2539ae1520 100644
+index bfb648d6b5..6bf138cfc6 100644
--- a/pve-backup.c
+++ b/pve-backup.c
-@@ -1051,3 +1051,10 @@ BackupStatus *qmp_query_backup(Error **errp)
+@@ -1051,3 +1051,11 @@ BackupStatus *qmp_query_backup(Error **errp)
return info;
}
@@ -25,14 +27,15 @@ index bfb648d6b5..2539ae1520 100644
+ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
+{
+ ProxmoxSupportStatus *ret = g_malloc0(sizeof(*ret));
++ ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
+ ret->pbs_dirty_bitmap = true;
+ return ret;
+}
diff --git a/qapi/block-core.json b/qapi/block-core.json
-index f782c2cf96..6dd5e35473 100644
+index f782c2cf96..1ed5987c88 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
-@@ -877,6 +877,28 @@
+@@ -877,6 +877,31 @@
##
{ 'command': 'backup-cancel' }
@@ -44,9 +47,12 @@ index f782c2cf96..6dd5e35473 100644
+# @pbs-dirty-bitmap: True if dirty-bitmap-incremental backups to PBS are
+# supported.
+#
++# @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
++#
+##
+{ 'struct': 'ProxmoxSupportStatus',
-+ 'data': { 'pbs-dirty-bitmap': 'bool' } }
++ 'data': { 'pbs-dirty-bitmap': 'bool',
++ 'pbs-library-version': 'str' } }
+
+##
+# @query-proxmox-support:
diff --git a/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch b/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch
index f0ff58a..34b0f51 100644
--- a/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch
+++ b/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch
@@ -9,7 +9,7 @@ Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
-index 2539ae1520..0e293a4f5e 100644
+index 6bf138cfc6..cd3a132d8b 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -958,6 +958,8 @@ UuidInfo *qmp_backup(
diff --git a/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch b/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch
index 5f73a01..d45a455 100644
--- a/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch
+++ b/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch
@@ -17,7 +17,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
-index 0e293a4f5e..8999692418 100644
+index cd3a132d8b..f14273645a 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -67,6 +67,7 @@ opts_init(pvebackup_init);
diff --git a/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch b/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch
index d09b817..930ec8f 100644
--- a/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch
+++ b/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch
@@ -20,7 +20,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
-index 8999692418..562fcc20f7 100644
+index f14273645a..bd802c6205 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -8,6 +8,7 @@
diff --git a/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch b/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch
index c8581c8..54f1dfa 100644
--- a/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch
+++ b/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch
@@ -10,8 +10,8 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
monitor/hmp-cmds.c | 28 ++++++-----
pve-backup.c | 117 ++++++++++++++++++++++++++++++++-----------
- qapi/block-core.json | 57 ++++++++++++++++++++-
- 3 files changed, 159 insertions(+), 43 deletions(-)
+ qapi/block-core.json | 56 +++++++++++++++++++++
+ 3 files changed, 159 insertions(+), 42 deletions(-)
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 3ff014d32a..c3227a1498 100644
@@ -68,7 +68,7 @@ index 3ff014d32a..c3227a1498 100644
info->zero_bytes, zero_per);
diff --git a/pve-backup.c b/pve-backup.c
-index 562fcc20f7..04c21c80aa 100644
+index bd802c6205..2db4a62580 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -46,6 +46,7 @@ static struct PVEBackupState {
@@ -314,7 +314,7 @@ index 562fcc20f7..04c21c80aa 100644
err:
l = di_list;
-@@ -1074,9 +1100,40 @@ BackupStatus *qmp_query_backup(Error **errp)
+@@ -1074,10 +1100,41 @@ BackupStatus *qmp_query_backup(Error **errp)
return info;
}
@@ -351,28 +351,31 @@ index 562fcc20f7..04c21c80aa 100644
ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
{
ProxmoxSupportStatus *ret = g_malloc0(sizeof(*ret));
+ ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
ret->pbs_dirty_bitmap = true;
+ ret->query_bitmap_info = true;
return ret;
}
diff --git a/qapi/block-core.json b/qapi/block-core.json
-index 6dd5e35473..5fc42e87f3 100644
+index 1ed5987c88..03fc0af99b 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
-@@ -885,9 +885,11 @@
+@@ -885,11 +885,14 @@
# @pbs-dirty-bitmap: True if dirty-bitmap-incremental backups to PBS are
# supported.
#
+# @query-bitmap-info: True if the 'query-pbs-bitmap-info' QMP call is supported.
+#
+ # @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
+ #
##
{ 'struct': 'ProxmoxSupportStatus',
-- 'data': { 'pbs-dirty-bitmap': 'bool' } }
-+ 'data': { 'pbs-dirty-bitmap': 'bool', 'query-bitmap-info': 'bool' } }
+ 'data': { 'pbs-dirty-bitmap': 'bool',
++ 'query-bitmap-info': 'bool',
+ 'pbs-library-version': 'str' } }
##
- # @query-proxmox-support:
-@@ -899,6 +901,59 @@
+@@ -902,6 +905,59 @@
##
{ 'command': 'query-proxmox-support', 'returns': 'ProxmoxSupportStatus' }
diff --git a/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch b/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch
index a9489a8..daa2498 100644
--- a/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch
+++ b/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch
@@ -16,7 +16,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
1 file changed, 49 insertions(+), 118 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
-index 04c21c80aa..9562e9c98d 100644
+index 2db4a62580..b52f4a9364 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -52,6 +52,7 @@ static struct PVEBackupState {
diff --git a/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch b/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch
index 695c0fd..49213d9 100644
--- a/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch
+++ b/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch
@@ -38,7 +38,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 files changed, 95 insertions(+), 58 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
-index 9562e9c98d..0466145bec 100644
+index b52f4a9364..4402c0cb17 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -33,7 +33,9 @@ const char *PBS_BITMAP_NAME = "pbs-incremental-dirty-bitmap";
@@ -359,7 +359,7 @@ index 9562e9c98d..0466145bec 100644
qemu_mutex_unlock(&backup_state.stat.lock);
diff --git a/qapi/block-core.json b/qapi/block-core.json
-index 5fc42e87f3..b31ad8d989 100644
+index 03fc0af99b..29650896e2 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -784,12 +784,15 @@
diff --git a/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch b/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch
index 45dabc4..873fd37 100644
--- a/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch
+++ b/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch
@@ -22,7 +22,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
1 file changed, 54 insertions(+), 25 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
-index 0466145bec..1a2647e7a5 100644
+index 4402c0cb17..c7cde0fb0e 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -50,6 +50,7 @@ static struct PVEBackupState {
diff --git a/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch b/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
index b1eca48..83e5874 100644
--- a/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
+++ b/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
@@ -17,9 +17,9 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
migration/Makefile.objs | 1 +
migration/pbs-state.c | 97 ++++++++++++++++++++++++++++++++++++++++
pve-backup.c | 1 +
- qapi/block-core.json | 9 +++-
+ qapi/block-core.json | 6 +++
softmmu/vl.c | 1 +
- 6 files changed, 111 insertions(+), 1 deletion(-)
+ 6 files changed, 109 insertions(+)
create mode 100644 migration/pbs-state.c
diff --git a/include/migration/misc.h b/include/migration/misc.h
@@ -150,21 +150,21 @@ index 0000000000..c711498c3e
+ &pbs_state);
+}
diff --git a/pve-backup.c b/pve-backup.c
-index 1a2647e7a5..c12ff8bb61 100644
+index c7cde0fb0e..f65f1dda26 100644
--- a/pve-backup.c
+++ b/pve-backup.c
-@@ -1129,5 +1129,6 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
- ProxmoxSupportStatus *ret = g_malloc0(sizeof(*ret));
+@@ -1130,5 +1130,6 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
+ ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
ret->pbs_dirty_bitmap = true;
ret->query_bitmap_info = true;
+ ret->pbs_dirty_bitmap_migration = true;
return ret;
}
diff --git a/qapi/block-core.json b/qapi/block-core.json
-index b31ad8d989..00c9e12fcc 100644
+index 29650896e2..0da4b35028 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
-@@ -890,9 +890,16 @@
+@@ -890,12 +890,18 @@
#
# @query-bitmap-info: True if the 'query-pbs-bitmap-info' QMP call is supported.
#
@@ -173,15 +173,16 @@ index b31ad8d989..00c9e12fcc 100644
+# migration cap if this is false/unset may lead
+# to crashes on migration!
+#
+ # @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
+ #
##
{ 'struct': 'ProxmoxSupportStatus',
-- 'data': { 'pbs-dirty-bitmap': 'bool', 'query-bitmap-info': 'bool' } }
-+ 'data': { 'pbs-dirty-bitmap': 'bool',
-+ 'query-bitmap-info': 'bool',
-+ 'pbs-dirty-bitmap-migration': 'bool' } }
+ 'data': { 'pbs-dirty-bitmap': 'bool',
+ 'query-bitmap-info': 'bool',
++ 'pbs-dirty-bitmap-migration': 'bool',
+ 'pbs-library-version': 'str' } }
##
- # @query-proxmox-support:
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 16aa2186b0..88b13871fd 100644
--- a/softmmu/vl.c
--
2.20.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] [PATCH v3 proxmox-backup-qemu 2/3] return version via rust fn instead of header define
2020-11-24 15:41 [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Stefan Reiter
2020-11-24 15:41 ` [pve-devel] [PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library version' Stefan Reiter
@ 2020-11-24 15:41 ` Stefan Reiter
2020-11-25 7:36 ` [pve-devel] applied: " Dietmar Maurer
2020-11-24 15:41 ` [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status Stefan Reiter
2020-11-24 16:29 ` [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Fabian Grünbichler
3 siblings, 1 reply; 11+ messages in thread
From: Stefan Reiter @ 2020-11-24 15:41 UTC (permalink / raw)
To: pve-devel
Otherwise the string gets included in the QEMU binary, not the library.
Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
v3: added, applies as followup on top of already applied one
Makefile | 2 +-
build.rs | 6 +++---
current-api.h | 7 +++++--
src/lib.rs | 13 +++++++++++++
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index f799124..e3a3420 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ endif
all:
ifneq ($(BUILD_MODE), skip)
cargo build $(CARGO_BUILD_ARGS)
- diff -I 'PROXMOX_BACKUP_QEMU_VERSION' -up current-api.h proxmox-backup-qemu.h
+ diff -up current-api.h proxmox-backup-qemu.h
endif
# always re-create this dir
diff --git a/build.rs b/build.rs
index 274e935..6940d3f 100644
--- a/build.rs
+++ b/build.rs
@@ -12,8 +12,8 @@ fn main() {
Some(ver) if !ver.is_empty() => ver,
_ => "UNKNOWN",
};
- let version_define = format!(
- "\n#define PROXMOX_BACKUP_QEMU_VERSION \"{} ({})\"",
+ let version_string = format!(
+ "{} ({})",
crate_ver,
git_ver,
);
@@ -23,10 +23,10 @@ fn main() {
.with_crate(&crate_dir)
.with_header(header)
.with_include_guard("PROXMOX_BACKUP_QEMU_H")
- .with_after_include(version_define)
.generate()
.unwrap()
.write_to_file("proxmox-backup-qemu.h");
println!("cargo:rustc-cdylib-link-arg=-Wl,-soname,libproxmox_backup_qemu.so.0");
+ println!("cargo:rustc-env=PBS_LIB_VERSION={}", version_string);
}
diff --git a/current-api.h b/current-api.h
index cc4d0c1..abe7e89 100644
--- a/current-api.h
+++ b/current-api.h
@@ -32,8 +32,6 @@
#include <stdint.h>
#include <stdlib.h>
-#define PROXMOX_BACKUP_QEMU_VERSION "0.7.1 (dbb900ce4f524af2b59c59727203633588f32804)"
-
#define PROXMOX_BACKUP_DEFAULT_CHUNK_SIZE ((1024 * 1024) * 4)
/**
@@ -183,6 +181,11 @@ ProxmoxBackupHandle *proxmox_backup_new(const char *repo,
const char *fingerprint,
char **error);
+/**
+ * Return a read-only pointer to a string containing the version of the library.
+ */
+const char *proxmox_backup_qemu_version(void);
+
/**
* Register a backup image (sync)
*/
diff --git a/src/lib.rs b/src/lib.rs
index 67c18fc..b755014 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -28,6 +28,19 @@ mod tools;
pub const PROXMOX_BACKUP_DEFAULT_CHUNK_SIZE: u64 = 1024*1024*4;
+use lazy_static::lazy_static;
+lazy_static!{
+ static ref VERSION_CSTR: CString = {
+ CString::new(env!("PBS_LIB_VERSION")).unwrap()
+ };
+}
+
+/// Return a read-only pointer to a string containing the version of the library.
+#[no_mangle]
+pub extern "C" fn proxmox_backup_qemu_version() -> *const c_char {
+ VERSION_CSTR.as_ptr()
+}
+
/// Free returned error messages
///
/// All calls can return error messages, but they are allocated using
--
2.20.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status
2020-11-24 15:41 [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Stefan Reiter
2020-11-24 15:41 ` [pve-devel] [PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library version' Stefan Reiter
2020-11-24 15:41 ` [pve-devel] [PATCH v3 proxmox-backup-qemu 2/3] return version via rust fn instead of header define Stefan Reiter
@ 2020-11-24 15:41 ` Stefan Reiter
2020-11-25 9:09 ` Fabian Grünbichler
2020-11-25 11:03 ` [pve-devel] applied: " Fabian Grünbichler
2020-11-24 16:29 ` [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Fabian Grünbichler
3 siblings, 2 replies; 11+ messages in thread
From: Stefan Reiter @ 2020-11-24 15:41 UTC (permalink / raw)
To: pve-devel
Extends print_recursive_hash for the CLI to handle JSON booleans so the
result will actually show up in 'qm status --verbose'.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
v3: unchanged
PVE/CLI/qm.pm | 2 +-
PVE/QemuServer.pm | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index b3b9251..b9b6051 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -110,7 +110,7 @@ sub print_recursive_hash {
foreach my $item (@$hash) {
print_recursive_hash("\t$prefix", $item);
}
- } elsif (!ref($hash) && defined($hash)) {
+ } elsif ((!ref($hash) && defined($hash)) || ref($hash) eq 'JSON::PP::Boolean') {
if (defined($key)) {
print "$prefix$key: $hash\n";
} else {
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 9704042..6966717 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2748,6 +2748,14 @@ sub vmstatus {
$qmpclient->queue_execute(undef, 2);
+ foreach my $vmid (keys %$list) {
+ next if $opt_vmid && ($vmid ne $opt_vmid);
+ # we can't use the $qmpclient since it might have already aborted on
+ # 'query-balloon', but this might also fail for older versions...
+ my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") };
+ $res->{$vmid}->{'proxmox-support'} = $qemu_support // {};
+ }
+
foreach my $vmid (keys %$list) {
next if $opt_vmid && ($vmid ne $opt_vmid);
$res->{$vmid}->{qmpstatus} = $res->{$vmid}->{status} if !$res->{$vmid}->{qmpstatus};
--
2.20.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output
2020-11-24 15:41 [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Stefan Reiter
` (2 preceding siblings ...)
2020-11-24 15:41 ` [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status Stefan Reiter
@ 2020-11-24 16:29 ` Fabian Grünbichler
2020-11-24 18:27 ` Dietmar Maurer
3 siblings, 1 reply; 11+ messages in thread
From: Fabian Grünbichler @ 2020-11-24 16:29 UTC (permalink / raw)
To: Proxmox VE development discussion
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
proxmox-backup-qemu is missing a not-pushed version bump commit, otherwise I'd have applied this.
On November 24, 2020 4:41 pm, Stefan Reiter wrote:
> v3:
> * use function, as header macro was compiled into QEMU, not the library
>
>
> pve-qemu: Stefan Reiter (1):
> update patches with squashed in 'include library version'
>
> ...dd-query_proxmox_support-QMP-command.patch | 22 ++++++++++------
> ...issing-crypt-and-compress-parameters.patch | 2 +-
> ...rite-callback-with-big-blocks-correc.patch | 2 +-
> ...-block-handling-to-PBS-dump-callback.patch | 2 +-
> ...E-add-query-pbs-bitmap-info-QMP-call.patch | 23 +++++++++--------
> ...-transaction-to-synchronize-job-stat.patch | 2 +-
> ...ore-coroutines-and-don-t-block-on-fi.patch | 4 +--
> ...n-up-error-handling-for-create_backu.patch | 2 +-
> ...igrate-dirty-bitmap-state-via-savevm.patch | 25 ++++++++++---------
> 9 files changed, 47 insertions(+), 37 deletions(-)
>
> proxmox-backup-qemu: Stefan Reiter (1):
> return version via rust fn instead of header define
>
> Makefile | 2 +-
> build.rs | 6 +++---
> current-api.h | 7 +++++--
> src/lib.rs | 13 +++++++++++++
> 4 files changed, 22 insertions(+), 6 deletions(-)
>
> qemu-server: Stefan Reiter (1):
> print query-proxmox-support result in 'full' status
>
> PVE/CLI/qm.pm | 2 +-
> PVE/QemuServer.pm | 8 ++++++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> --
> 2.20.1
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output
2020-11-24 16:29 ` [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Fabian Grünbichler
@ 2020-11-24 18:27 ` Dietmar Maurer
0 siblings, 0 replies; 11+ messages in thread
From: Dietmar Maurer @ 2020-11-24 18:27 UTC (permalink / raw)
To: Proxmox VE development discussion, Fabian Grünbichler
> proxmox-backup-qemu is missing a not-pushed version bump commit, otherwise I'd have applied this.
sorry, just pushed the missing commit.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] applied: [PATCH v3 proxmox-backup-qemu 2/3] return version via rust fn instead of header define
2020-11-24 15:41 ` [pve-devel] [PATCH v3 proxmox-backup-qemu 2/3] return version via rust fn instead of header define Stefan Reiter
@ 2020-11-25 7:36 ` Dietmar Maurer
0 siblings, 0 replies; 11+ messages in thread
From: Dietmar Maurer @ 2020-11-25 7:36 UTC (permalink / raw)
To: Proxmox VE development discussion, Stefan Reiter
applied (and built a new proxmox-backup-qemu package)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status
2020-11-24 15:41 ` [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status Stefan Reiter
@ 2020-11-25 9:09 ` Fabian Grünbichler
2020-11-25 9:36 ` Stefan Reiter
2020-11-25 11:03 ` [pve-devel] applied: " Fabian Grünbichler
1 sibling, 1 reply; 11+ messages in thread
From: Fabian Grünbichler @ 2020-11-25 9:09 UTC (permalink / raw)
To: Proxmox VE development discussion
this needs the following fix-up, else pvestatd spams the log for all not
runnning VMs:
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 6966717..0103386 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2750,6 +2750,8 @@ sub vmstatus {
foreach my $vmid (keys %$list) {
next if $opt_vmid && ($vmid ne $opt_vmid);
+ next if !$res->{$vmid}->{pid}; #not running
+
# we can't use the $qmpclient since it might have already aborted on
# 'query-balloon', but this might also fail for older versions...
my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") };
On November 24, 2020 4:41 pm, Stefan Reiter wrote:
> Extends print_recursive_hash for the CLI to handle JSON booleans so the
> result will actually show up in 'qm status --verbose'.
>
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>
> v3: unchanged
>
> PVE/CLI/qm.pm | 2 +-
> PVE/QemuServer.pm | 8 ++++++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
> index b3b9251..b9b6051 100755
> --- a/PVE/CLI/qm.pm
> +++ b/PVE/CLI/qm.pm
> @@ -110,7 +110,7 @@ sub print_recursive_hash {
> foreach my $item (@$hash) {
> print_recursive_hash("\t$prefix", $item);
> }
> - } elsif (!ref($hash) && defined($hash)) {
> + } elsif ((!ref($hash) && defined($hash)) || ref($hash) eq 'JSON::PP::Boolean') {
> if (defined($key)) {
> print "$prefix$key: $hash\n";
> } else {
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 9704042..6966717 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2748,6 +2748,14 @@ sub vmstatus {
>
> $qmpclient->queue_execute(undef, 2);
>
> + foreach my $vmid (keys %$list) {
> + next if $opt_vmid && ($vmid ne $opt_vmid);
> + # we can't use the $qmpclient since it might have already aborted on
> + # 'query-balloon', but this might also fail for older versions...
> + my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") };
> + $res->{$vmid}->{'proxmox-support'} = $qemu_support // {};
> + }
> +
> foreach my $vmid (keys %$list) {
> next if $opt_vmid && ($vmid ne $opt_vmid);
> $res->{$vmid}->{qmpstatus} = $res->{$vmid}->{status} if !$res->{$vmid}->{qmpstatus};
> --
> 2.20.1
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status
2020-11-25 9:09 ` Fabian Grünbichler
@ 2020-11-25 9:36 ` Stefan Reiter
0 siblings, 0 replies; 11+ messages in thread
From: Stefan Reiter @ 2020-11-25 9:36 UTC (permalink / raw)
To: pve-devel
On 25/11/2020 10:09, Fabian Grünbichler wrote:
> this needs the following fix-up, else pvestatd spams the log for all not
> runnning VMs:
>
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 6966717..0103386 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2750,6 +2750,8 @@ sub vmstatus {
>
> foreach my $vmid (keys %$list) {
> next if $opt_vmid && ($vmid ne $opt_vmid);
> + next if !$res->{$vmid}->{pid}; #not running
> +
> # we can't use the $qmpclient since it might have already aborted on
> # 'query-balloon', but this might also fail for older versions...
> my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") };
>
Ack, that makes sense.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] applied: [PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library version'
2020-11-24 15:41 ` [pve-devel] [PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library version' Stefan Reiter
@ 2020-11-25 10:59 ` Fabian Grünbichler
0 siblings, 0 replies; 11+ messages in thread
From: Fabian Grünbichler @ 2020-11-25 10:59 UTC (permalink / raw)
To: Proxmox VE development discussion
with fixup to bump versioned build-dep and add versioned dependency
On November 24, 2020 4:41 pm, Stefan Reiter wrote:
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>
> v3: use function instead of macro from lib
>
> Requires a depends on bumped library to find function.
>
> ...dd-query_proxmox_support-QMP-command.patch | 22 ++++++++++------
> ...issing-crypt-and-compress-parameters.patch | 2 +-
> ...rite-callback-with-big-blocks-correc.patch | 2 +-
> ...-block-handling-to-PBS-dump-callback.patch | 2 +-
> ...E-add-query-pbs-bitmap-info-QMP-call.patch | 23 +++++++++--------
> ...-transaction-to-synchronize-job-stat.patch | 2 +-
> ...ore-coroutines-and-don-t-block-on-fi.patch | 4 +--
> ...n-up-error-handling-for-create_backu.patch | 2 +-
> ...igrate-dirty-bitmap-state-via-savevm.patch | 25 ++++++++++---------
> 9 files changed, 47 insertions(+), 37 deletions(-)
>
> diff --git a/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch b/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch
> index 1549af3..e2dc20f 100644
> --- a/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch
> +++ b/debian/patches/pve/0044-PVE-add-query_proxmox_support-QMP-command.patch
> @@ -8,16 +8,18 @@ backup support.
>
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
> +[PVE: query-proxmox-support: include library version]
> +Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
> - pve-backup.c | 7 +++++++
> - qapi/block-core.json | 22 ++++++++++++++++++++++
> - 2 files changed, 29 insertions(+)
> + pve-backup.c | 8 ++++++++
> + qapi/block-core.json | 25 +++++++++++++++++++++++++
> + 2 files changed, 33 insertions(+)
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index bfb648d6b5..2539ae1520 100644
> +index bfb648d6b5..6bf138cfc6 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> -@@ -1051,3 +1051,10 @@ BackupStatus *qmp_query_backup(Error **errp)
> +@@ -1051,3 +1051,11 @@ BackupStatus *qmp_query_backup(Error **errp)
>
> return info;
> }
> @@ -25,14 +27,15 @@ index bfb648d6b5..2539ae1520 100644
> +ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
> +{
> + ProxmoxSupportStatus *ret = g_malloc0(sizeof(*ret));
> ++ ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
> + ret->pbs_dirty_bitmap = true;
> + return ret;
> +}
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> -index f782c2cf96..6dd5e35473 100644
> +index f782c2cf96..1ed5987c88 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> -@@ -877,6 +877,28 @@
> +@@ -877,6 +877,31 @@
> ##
> { 'command': 'backup-cancel' }
>
> @@ -44,9 +47,12 @@ index f782c2cf96..6dd5e35473 100644
> +# @pbs-dirty-bitmap: True if dirty-bitmap-incremental backups to PBS are
> +# supported.
> +#
> ++# @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
> ++#
> +##
> +{ 'struct': 'ProxmoxSupportStatus',
> -+ 'data': { 'pbs-dirty-bitmap': 'bool' } }
> ++ 'data': { 'pbs-dirty-bitmap': 'bool',
> ++ 'pbs-library-version': 'str' } }
> +
> +##
> +# @query-proxmox-support:
> diff --git a/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch b/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch
> index f0ff58a..34b0f51 100644
> --- a/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch
> +++ b/debian/patches/pve/0045-pbs-fix-missing-crypt-and-compress-parameters.patch
> @@ -9,7 +9,7 @@ Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index 2539ae1520..0e293a4f5e 100644
> +index 6bf138cfc6..cd3a132d8b 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> @@ -958,6 +958,8 @@ UuidInfo *qmp_backup(
> diff --git a/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch b/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch
> index 5f73a01..d45a455 100644
> --- a/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch
> +++ b/debian/patches/pve/0046-PVE-handle-PBS-write-callback-with-big-blocks-correc.patch
> @@ -17,7 +17,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> 1 file changed, 22 insertions(+), 8 deletions(-)
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index 0e293a4f5e..8999692418 100644
> +index cd3a132d8b..f14273645a 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> @@ -67,6 +67,7 @@ opts_init(pvebackup_init);
> diff --git a/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch b/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch
> index d09b817..930ec8f 100644
> --- a/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch
> +++ b/debian/patches/pve/0047-PVE-add-zero-block-handling-to-PBS-dump-callback.patch
> @@ -20,7 +20,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index 8999692418..562fcc20f7 100644
> +index f14273645a..bd802c6205 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> @@ -8,6 +8,7 @@
> diff --git a/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch b/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch
> index c8581c8..54f1dfa 100644
> --- a/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch
> +++ b/debian/patches/pve/0048-PVE-add-query-pbs-bitmap-info-QMP-call.patch
> @@ -10,8 +10,8 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
> monitor/hmp-cmds.c | 28 ++++++-----
> pve-backup.c | 117 ++++++++++++++++++++++++++++++++-----------
> - qapi/block-core.json | 57 ++++++++++++++++++++-
> - 3 files changed, 159 insertions(+), 43 deletions(-)
> + qapi/block-core.json | 56 +++++++++++++++++++++
> + 3 files changed, 159 insertions(+), 42 deletions(-)
>
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 3ff014d32a..c3227a1498 100644
> @@ -68,7 +68,7 @@ index 3ff014d32a..c3227a1498 100644
> info->zero_bytes, zero_per);
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index 562fcc20f7..04c21c80aa 100644
> +index bd802c6205..2db4a62580 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> @@ -46,6 +46,7 @@ static struct PVEBackupState {
> @@ -314,7 +314,7 @@ index 562fcc20f7..04c21c80aa 100644
> err:
>
> l = di_list;
> -@@ -1074,9 +1100,40 @@ BackupStatus *qmp_query_backup(Error **errp)
> +@@ -1074,10 +1100,41 @@ BackupStatus *qmp_query_backup(Error **errp)
> return info;
> }
>
> @@ -351,28 +351,31 @@ index 562fcc20f7..04c21c80aa 100644
> ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
> {
> ProxmoxSupportStatus *ret = g_malloc0(sizeof(*ret));
> + ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
> ret->pbs_dirty_bitmap = true;
> + ret->query_bitmap_info = true;
> return ret;
> }
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> -index 6dd5e35473..5fc42e87f3 100644
> +index 1ed5987c88..03fc0af99b 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> -@@ -885,9 +885,11 @@
> +@@ -885,11 +885,14 @@
> # @pbs-dirty-bitmap: True if dirty-bitmap-incremental backups to PBS are
> # supported.
> #
> +# @query-bitmap-info: True if the 'query-pbs-bitmap-info' QMP call is supported.
> +#
> + # @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
> + #
> ##
> { 'struct': 'ProxmoxSupportStatus',
> -- 'data': { 'pbs-dirty-bitmap': 'bool' } }
> -+ 'data': { 'pbs-dirty-bitmap': 'bool', 'query-bitmap-info': 'bool' } }
> + 'data': { 'pbs-dirty-bitmap': 'bool',
> ++ 'query-bitmap-info': 'bool',
> + 'pbs-library-version': 'str' } }
>
> ##
> - # @query-proxmox-support:
> -@@ -899,6 +901,59 @@
> +@@ -902,6 +905,59 @@
> ##
> { 'command': 'query-proxmox-support', 'returns': 'ProxmoxSupportStatus' }
>
> diff --git a/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch b/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch
> index a9489a8..daa2498 100644
> --- a/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch
> +++ b/debian/patches/pve/0051-PVE-Backup-Use-a-transaction-to-synchronize-job-stat.patch
> @@ -16,7 +16,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> 1 file changed, 49 insertions(+), 118 deletions(-)
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index 04c21c80aa..9562e9c98d 100644
> +index 2db4a62580..b52f4a9364 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> @@ -52,6 +52,7 @@ static struct PVEBackupState {
> diff --git a/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch b/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch
> index 695c0fd..49213d9 100644
> --- a/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch
> +++ b/debian/patches/pve/0052-PVE-Backup-Use-more-coroutines-and-don-t-block-on-fi.patch
> @@ -38,7 +38,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> 2 files changed, 95 insertions(+), 58 deletions(-)
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index 9562e9c98d..0466145bec 100644
> +index b52f4a9364..4402c0cb17 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> @@ -33,7 +33,9 @@ const char *PBS_BITMAP_NAME = "pbs-incremental-dirty-bitmap";
> @@ -359,7 +359,7 @@ index 9562e9c98d..0466145bec 100644
> qemu_mutex_unlock(&backup_state.stat.lock);
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> -index 5fc42e87f3..b31ad8d989 100644
> +index 03fc0af99b..29650896e2 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -784,12 +784,15 @@
> diff --git a/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch b/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch
> index 45dabc4..873fd37 100644
> --- a/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch
> +++ b/debian/patches/pve/0053-PVE-fix-and-clean-up-error-handling-for-create_backu.patch
> @@ -22,7 +22,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> 1 file changed, 54 insertions(+), 25 deletions(-)
>
> diff --git a/pve-backup.c b/pve-backup.c
> -index 0466145bec..1a2647e7a5 100644
> +index 4402c0cb17..c7cde0fb0e 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> @@ -50,6 +50,7 @@ static struct PVEBackupState {
> diff --git a/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch b/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
> index b1eca48..83e5874 100644
> --- a/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
> +++ b/debian/patches/pve/0055-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
> @@ -17,9 +17,9 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> migration/Makefile.objs | 1 +
> migration/pbs-state.c | 97 ++++++++++++++++++++++++++++++++++++++++
> pve-backup.c | 1 +
> - qapi/block-core.json | 9 +++-
> + qapi/block-core.json | 6 +++
> softmmu/vl.c | 1 +
> - 6 files changed, 111 insertions(+), 1 deletion(-)
> + 6 files changed, 109 insertions(+)
> create mode 100644 migration/pbs-state.c
>
> diff --git a/include/migration/misc.h b/include/migration/misc.h
> @@ -150,21 +150,21 @@ index 0000000000..c711498c3e
> + &pbs_state);
> +}
> diff --git a/pve-backup.c b/pve-backup.c
> -index 1a2647e7a5..c12ff8bb61 100644
> +index c7cde0fb0e..f65f1dda26 100644
> --- a/pve-backup.c
> +++ b/pve-backup.c
> -@@ -1129,5 +1129,6 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
> - ProxmoxSupportStatus *ret = g_malloc0(sizeof(*ret));
> +@@ -1130,5 +1130,6 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
> + ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
> ret->pbs_dirty_bitmap = true;
> ret->query_bitmap_info = true;
> + ret->pbs_dirty_bitmap_migration = true;
> return ret;
> }
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> -index b31ad8d989..00c9e12fcc 100644
> +index 29650896e2..0da4b35028 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> -@@ -890,9 +890,16 @@
> +@@ -890,12 +890,18 @@
> #
> # @query-bitmap-info: True if the 'query-pbs-bitmap-info' QMP call is supported.
> #
> @@ -173,15 +173,16 @@ index b31ad8d989..00c9e12fcc 100644
> +# migration cap if this is false/unset may lead
> +# to crashes on migration!
> +#
> + # @pbs-library-version: Running version of libproxmox-backup-qemu0 library.
> + #
> ##
> { 'struct': 'ProxmoxSupportStatus',
> -- 'data': { 'pbs-dirty-bitmap': 'bool', 'query-bitmap-info': 'bool' } }
> -+ 'data': { 'pbs-dirty-bitmap': 'bool',
> -+ 'query-bitmap-info': 'bool',
> -+ 'pbs-dirty-bitmap-migration': 'bool' } }
> + 'data': { 'pbs-dirty-bitmap': 'bool',
> + 'query-bitmap-info': 'bool',
> ++ 'pbs-dirty-bitmap-migration': 'bool',
> + 'pbs-library-version': 'str' } }
>
> ##
> - # @query-proxmox-support:
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 16aa2186b0..88b13871fd 100644
> --- a/softmmu/vl.c
> --
> 2.20.1
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [pve-devel] applied: [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status
2020-11-24 15:41 ` [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status Stefan Reiter
2020-11-25 9:09 ` Fabian Grünbichler
@ 2020-11-25 11:03 ` Fabian Grünbichler
1 sibling, 0 replies; 11+ messages in thread
From: Fabian Grünbichler @ 2020-11-25 11:03 UTC (permalink / raw)
To: Proxmox VE development discussion
with mentioned followup
On November 24, 2020 4:41 pm, Stefan Reiter wrote:
> Extends print_recursive_hash for the CLI to handle JSON booleans so the
> result will actually show up in 'qm status --verbose'.
>
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>
> v3: unchanged
>
> PVE/CLI/qm.pm | 2 +-
> PVE/QemuServer.pm | 8 ++++++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
> index b3b9251..b9b6051 100755
> --- a/PVE/CLI/qm.pm
> +++ b/PVE/CLI/qm.pm
> @@ -110,7 +110,7 @@ sub print_recursive_hash {
> foreach my $item (@$hash) {
> print_recursive_hash("\t$prefix", $item);
> }
> - } elsif (!ref($hash) && defined($hash)) {
> + } elsif ((!ref($hash) && defined($hash)) || ref($hash) eq 'JSON::PP::Boolean') {
> if (defined($key)) {
> print "$prefix$key: $hash\n";
> } else {
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 9704042..6966717 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2748,6 +2748,14 @@ sub vmstatus {
>
> $qmpclient->queue_execute(undef, 2);
>
> + foreach my $vmid (keys %$list) {
> + next if $opt_vmid && ($vmid ne $opt_vmid);
> + # we can't use the $qmpclient since it might have already aborted on
> + # 'query-balloon', but this might also fail for older versions...
> + my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") };
> + $res->{$vmid}->{'proxmox-support'} = $qemu_support // {};
> + }
> +
> foreach my $vmid (keys %$list) {
> next if $opt_vmid && ($vmid ne $opt_vmid);
> $res->{$vmid}->{qmpstatus} = $res->{$vmid}->{status} if !$res->{$vmid}->{qmpstatus};
> --
> 2.20.1
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-11-25 11:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 15:41 [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Stefan Reiter
2020-11-24 15:41 ` [pve-devel] [PATCH v3 pve-qemu 1/3] update patches with squashed in 'include library version' Stefan Reiter
2020-11-25 10:59 ` [pve-devel] applied: " Fabian Grünbichler
2020-11-24 15:41 ` [pve-devel] [PATCH v3 proxmox-backup-qemu 2/3] return version via rust fn instead of header define Stefan Reiter
2020-11-25 7:36 ` [pve-devel] applied: " Dietmar Maurer
2020-11-24 15:41 ` [pve-devel] [PATCH v3 qemu-server 3/3] print query-proxmox-support result in 'full' status Stefan Reiter
2020-11-25 9:09 ` Fabian Grünbichler
2020-11-25 9:36 ` Stefan Reiter
2020-11-25 11:03 ` [pve-devel] applied: " Fabian Grünbichler
2020-11-24 16:29 ` [pve-devel] [PATCH v3 0/3] Add proxmox-backup-qemu version to VM status output Fabian Grünbichler
2020-11-24 18:27 ` Dietmar Maurer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox