Commit e5048d15 authored by Gonglei's avatar Gonglei Committed by Michael Tokarev
Browse files

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: default avatarHuangweidong <weidong.huang@huawei.com>
Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent 97699eff
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
    }