[pve-devel] [PATCH 1/3] add get_running_qemu_version

Alexandre Derumier aderumier at odiso.com
Mon Oct 17 12:20:43 CEST 2016


return current running qemu process version

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 46d0403..6376323 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5961,6 +5961,13 @@ sub get_current_qemu_machine {
     return $current || $default || 'pc';
 }
 
+sub get_running_qemu_version {
+    my ($vmid) = @_;
+    my $cmd = { execute => 'query-version', arguments => {} };
+    my $res = vm_qmp_command($vmid, $cmd);
+    return "$res->{qemu}->{major}.$res->{qemu}->{minor}";
+}
+
 sub qemu_machine_feature_enabled {
     my ($machine, $kvmver, $version_major, $version_minor) = @_;
 
-- 
2.1.4




More information about the pve-devel mailing list