mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemu: handle -1 for pid in qemuDomainGetMachineName
We call qemuDomainGetMachineName on domain start. On first
start (after daemon start) pid is 0 and virSystemdGetMachineNameByPID
don't get called. But after domain shutting down pid became -1 so
on next start virSystemdGetMachineNameByPID is called and returned an error.
Error is ignored so it is not critical. But at least on my system
(systemd-219 with extra patches) systemd-machined is crashed on
this request.
This behaviour is triggered by eaf2c9f89
.
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
f0607f394c
commit
9820756cd3
@ -9781,7 +9781,7 @@ qemuDomainGetMachineName(virDomainObjPtr vm)
|
||||
virQEMUDriverPtr driver = priv->driver;
|
||||
char *ret = NULL;
|
||||
|
||||
if (vm->pid) {
|
||||
if (vm->pid > 0) {
|
||||
ret = virSystemdGetMachineNameByPID(vm->pid);
|
||||
if (!ret)
|
||||
virResetLastError();
|
||||
|
Loading…
Reference in New Issue
Block a user