[pve-devel] [PATCH qemu-server] add --description to systemd scope unit
Fabian Grünbichler
f.gruenbichler at proxmox.com
Fri May 13 15:36:51 CEST 2016
otherwise, long kvm commands lead to systemd unit files with
very long lines, with confuses the systemd unit file parser.
apparently systemd has a length limit for unit file lines and
(line-)breaks the description string at that point. since
the rest of the description is probably not a valid key/value
pair, this leads to warnings. the default semantics of systemd-run
is to use the executed command as description unless a description
is specified explicitly.
note that this behaviour of systemd could allow an attacker
with access to the VM configuration to craft a kvm commandline
that starts or stops arbitrary systemd units.
---
Note: this seems like a cosmetic issue only, but I did not
check systemd-internals.
PVE/QemuServer.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index fc064c5..3921c09 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2762,6 +2762,7 @@ sub config_to_command {
push @$cmd, '--scope';
push @$cmd, '--slice', "qemu";
push @$cmd, '--unit', $vmid;
+ push @$cmd, '--description', "'Proxmox VE VM $vmid'";
# set KillMode=none, so that systemd don't kill those scopes
# at shutdown (pve-manager service should stop the VMs instead)
push @$cmd, '-p', "KillMode=none";
--
2.1.4
More information about the pve-devel
mailing list