From 8610701ae6eae4b586b3cd80153dcd27ad2cc93d Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 22 Dec 2011 13:10:27 +0100 Subject: [PATCH] add ha flag to status info --- PVE/API2/Qemu.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 15c4ea3..ad8713f 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -812,8 +812,16 @@ __PACKAGE__->register_method({ my $conf = PVE::QemuServer::load_config($param->{vmid}); my $vmstatus = PVE::QemuServer::vmstatus($param->{vmid}); + my $status = $vmstatus->{$param->{vmid}}; - return $vmstatus->{$param->{vmid}}; + my $cc = PVE::Cluster::cfs_read_file('cluster.conf'); + if (PVE::Cluster::cluster_conf_lookup_pvevm($cc, 0, $param->{vmid}, 1)) { + $status->{ha} = 1; + } else { + $status->{ha} = 0; + } + + return $status; }}); __PACKAGE__->register_method({ -- 2.39.2