qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 12/12] os-posix: report error message when lock file


From: Michael Tokarev
Subject: [Qemu-devel] [PULL 12/12] os-posix: report error message when lock file failed
Date: Fri, 26 Sep 2014 21:36:16 +0400

From: Gonglei <address@hidden>

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 <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
 os-posix.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/os-posix.c b/os-posix.c
index e31a099..4898ebf 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;
     }
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]