From: Gonglei Date: Fri, 26 Sep 2014 08:14:32 +0000 (+0800) Subject: os-posix: report error message when lock file failed X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e5048d15ce6addae869f23514b2a1f0d4466418a;p=qemu.git 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 Signed-off-by: Gonglei Reviewed-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- diff --git a/os-posix.c b/os-posix.c index e31a099a2b..4898ebf4a2 100644 --- a/os-posix.c +++ b/os-posix.c @@ -319,6 +319,8 @@ int qemu_create_pidfile(const char *filename) return -1; } if (lockf(fd, F_TLOCK, 0) == -1) { + fprintf(stderr, "lock file '%s' failed: %s\n", + filename, strerror(errno)); close(fd); return -1; }