mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-13 21:15:25 +00:00
vm_start: add syslog info with which PID a VM was started
Adds a syslog entry to log the process id that has been given to the QEMU VM process at start. This is helpful debugging information if the pid shows up at other places, like a kernel stack trace, while the VM has been running, but cannot be retrieved anymore (e.g. the pidfile has been deleted or only the syslog is available). The syslog has been put in the `PVE::QemuServer::vm_start_nolock` subroutine to make sure that the PID is logged not only when the VM has been started by the API endpoint `vm_start`, but also when the VM is started by a remote migration. Suggested-by: Hannes Dürr <h.duerr@proxmox.com> Suggested-by: Friedrich Weber <f.weber@proxmox.com> Signed-off-by: Daniel Kral <d.kral@proxmox.com> Reviewed-by: Daniel Herzig <d.herzig@proxmox.com>
This commit is contained in:
parent
cf5080f991
commit
6f32c3fa7a
@ -43,6 +43,7 @@ use PVE::ProcFSTools;
|
||||
use PVE::PBSClient;
|
||||
use PVE::RESTEnvironment qw(log_warn);
|
||||
use PVE::RPCEnvironment;
|
||||
use PVE::SafeSyslog;
|
||||
use PVE::Storage;
|
||||
use PVE::SysFSTools;
|
||||
use PVE::Systemd;
|
||||
@ -6005,6 +6006,8 @@ sub vm_start_nolock {
|
||||
eval { PVE::QemuServer::PCI::reserve_pci_usage($pci_reserve_list, $vmid, undef, $pid) };
|
||||
warn $@ if $@;
|
||||
|
||||
syslog("info", "VM $vmid started with PID $pid.");
|
||||
|
||||
if (defined(my $migrate = $res->{migrate})) {
|
||||
if ($migrate->{proto} eq 'tcp') {
|
||||
my $nodename = nodename();
|
||||
|
Loading…
Reference in New Issue
Block a user