]> git.proxmox.com Git - mirror_qemu.git/commitdiff
os-posix: report error message when lock file failed
authorGonglei <arei.gonglei@huawei.com>
Fri, 26 Sep 2014 08:14:32 +0000 (16:14 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 26 Sep 2014 17:21:09 +0000 (21:21 +0400)
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>
os-posix.c

index e31a099a2b6019d029d1c3dd902800a793de1d1c..4898ebf4a2ae3c50af4305aec29c2e35549a188f 100644 (file)
@@ -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;
     }