mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-07 03:29:37 +00:00
os-posix: report error message when lock file failed
It will cause that create vm failed When manager tool is killed forcibly (kill -9 libvirtd_pid), the file not was unlink, and unlock. It's better that report the error message for users. Signed-off-by: Huangweidong <weidong.huang@huawei.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
97699eff3a
commit
e5048d15ce
|
@ -319,6 +319,8 @@ int qemu_create_pidfile(const char *filename)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (lockf(fd, F_TLOCK, 0) == -1) {
|
if (lockf(fd, F_TLOCK, 0) == -1) {
|
||||||
|
fprintf(stderr, "lock file '%s' failed: %s\n",
|
||||||
|
filename, strerror(errno));
|
||||||
close(fd);
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue