From ca749954b09b89e22cd69c4949fb7e689b057963 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 11 Aug 2017 19:44:46 +0800 Subject: osdep: Add runtime OFD lock detection Build time check of OFD lock is not sufficient and can cause image open errors when the runtime environment doesn't support it. Add a helper function to probe it at runtime, additionally. Also provide a qemu_has_ofd_lock() for callers to check the status. Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- include/qemu/osdep.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 3b74f6fcb2..6855b94bbf 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -357,6 +357,7 @@ int qemu_dup(int fd); int qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); int qemu_unlock_fd(int fd, int64_t start, int64_t len); int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); +bool qemu_has_ofd_lock(void); #if defined(__HAIKU__) && defined(__i386__) #define FMT_pid "%ld" -- cgit v1.2.3-55-g7522