[pve-devel] [PATCH container] vmstatus: Align name if not set in config to VMs

Aaron Lauterer a.lauterer at proxmox.com
Thu Jan 16 14:35:58 CET 2020


VMs have a space in between VM and the VMID.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---

While this is a small optical nit pick we could also think about
replacing the whitespace between CT/VM and the ID with a dash. We do not
allow a space when setting the name in the config AFAICT.

This could potentially break something down the line if the names are
used for more than just display.

 src/PVE/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 34949c6..81d2dd4 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -197,7 +197,7 @@ sub vmstatus {
 
 	$unprivileged->{$vmid} = $conf->{unprivileged};
 
-	$d->{name} = $conf->{'hostname'} || "CT$vmid";
+	$d->{name} = $conf->{'hostname'} || "CT $vmid";
 	$d->{name} =~ s/[\s]//g;
 
 	$d->{cpus} = $conf->{cores} || $conf->{cpulimit};
-- 
2.20.1




More information about the pve-devel mailing list