]> git.proxmox.com Git - qemu-server.git/commitdiff
add 'tags' option
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 31 Oct 2019 12:36:25 +0000 (13:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Nov 2019 19:24:49 +0000 (20:24 +0100)
this is useful as meta information for e.g., provisioning or config
management systems

adding the info also to the 'status' api call to make it easier to show
it in the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuServer.pm

index 74104dfb0150383f03a3c1556a7052cf3af7125e..4dd329ab959d111373ef374d996bfe853e8d106d 100644 (file)
@@ -283,6 +283,7 @@ my $generaloptions = {
     'startup' => 1,
     'tdf' => 1,
     'template' => 1,
+    'tags' => 1,
 };
 
 my $vmpoweroptions = {
index 6d8e942eba1cef182d19aca4327d4563fe7a8300..51ffc244673fc7c835e64a1109f46ef5c5f24756 100644 (file)
@@ -699,6 +699,11 @@ EODESCR
        description => "Configure additional enhancements for SPICE.",
        optional => 1
     },
+    tags => {
+       type => 'string', format => 'pve-tag-list',
+       description => 'Tags of the VM. This is only meta information.',
+       optional => 1,
+    },
 };
 
 my $cicustom_fmt = {
@@ -3024,7 +3029,12 @@ our $vmstatus_return_properties = {
        description => "The current config lock, if any.",
        type => 'string',
        optional => 1,
-    }
+    },
+    tags => {
+       description  => "The current configured tags, if any",
+       type => 'string',
+       optional => 1,
+    },
 };
 
 my $last_proc_pid_stat;
@@ -3095,6 +3105,7 @@ sub vmstatus {
 
        $d->{serial} = 1 if conf_has_serial($conf);
        $d->{lock} = $conf->{lock} if $conf->{lock};
+       $d->{tags} = $conf->{tags} if defined($conf->{tags});
 
        $res->{$vmid} = $d;
     }
@@ -4713,6 +4724,7 @@ my $fast_plug_option = {
     'protection' => 1,
     'vmstatestorage' => 1,
     'hookscript' => 1,
+    'tags' => 1,
 };
 
 # hotplug changes in [PENDING]