aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-06-17 15:57:26 -0300
committerFabiano Rosas <farosas@suse.de>2024-06-21 09:47:22 -0300
commitb43b61d5bee522dadf44b472af71aab7235c13d5 (patch)
treef8fc16b33cdc39384d4836d9b18330db89bed3ba /util
parent46cec74c1b71973756d8960a305bae1491ae6259 (diff)
downloadqemu-b43b61d5bee522dadf44b472af71aab7235c13d5.zip
qemu-b43b61d5bee522dadf44b472af71aab7235c13d5.tar.gz
qemu-b43b61d5bee522dadf44b472af71aab7235c13d5.tar.bz2
migration: Add direct-io parameter
Add the direct-io migration parameter that tells the migration code to use O_DIRECT when opening the migration stream file whenever possible. This is currently only used with the mapped-ram migration that has a clear window guaranteed to perform aligned writes. Acked-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'util')
-rw-r--r--util/osdep.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/osdep.c b/util/osdep.c
index 5bbfdfa..7703698 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -282,6 +282,15 @@ int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive)
}
#endif
+bool qemu_has_direct_io(void)
+{
+#ifdef O_DIRECT
+ return true;
+#else
+ return false;
+#endif
+}
+
static int qemu_open_cloexec(const char *name, int flags, mode_t mode)
{
int ret;