From 1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Mon, 17 Jun 2024 15:57:20 -0300 Subject: monitor: Drop monitor_fdset_dup_fd_find/_remove() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Those functions are not needed, one remove function should already work. Clean it up. Here the code doesn't really care about whether we need to keep that dupfd around if close() failed: when that happens something got very wrong, keeping the dup_fd around the fdsets may not help that situation so far. Cc: Dr. David Alan Gilbert Cc: Markus Armbruster Cc: Philippe Mathieu-Daudé Cc: Paolo Bonzini Cc: Daniel P. Berrangé Signed-off-by: Peter Xu Reviewed-by: Daniel P. Berrangé [add missing return statement, removal during traversal is not safe] Signed-off-by: Fabiano Rosas --- include/monitor/monitor.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 965f5d5..fd9b3f5 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -53,7 +53,6 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id, const char *opaque, Error **errp); int monitor_fdset_dup_fd_add(int64_t fdset_id, int flags); void monitor_fdset_dup_fd_remove(int dup_fd); -int64_t monitor_fdset_dup_fd_find(int dup_fd); void monitor_register_hmp(const char *name, bool info, void (*cmd)(Monitor *mon, const QDict *qdict)); -- cgit v1.1 From 960f29b347ad34a53580fa822083d51ba7851b7b Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Mon, 17 Jun 2024 15:57:24 -0300 Subject: monitor: Report errors from monitor_fdset_dup_fd_add I'm keeping the EACCES because callers expect to be able to look at errno. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- include/monitor/monitor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index fd9b3f5..c3740ec 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -51,7 +51,7 @@ int monitor_read_password(MonitorHMP *mon, ReadLineFunc *readline_func, AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id, const char *opaque, Error **errp); -int monitor_fdset_dup_fd_add(int64_t fdset_id, int flags); +int monitor_fdset_dup_fd_add(int64_t fdset_id, int flags, Error **errp); void monitor_fdset_dup_fd_remove(int dup_fd); void monitor_register_hmp(const char *name, bool info, -- cgit v1.1 From b43b61d5bee522dadf44b472af71aab7235c13d5 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Mon, 17 Jun 2024 15:57:26 -0300 Subject: 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 Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- include/qemu/osdep.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index f61edcf..191916f 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -612,6 +612,8 @@ int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); bool qemu_has_ofd_lock(void); #endif +bool qemu_has_direct_io(void); + #if defined(__HAIKU__) && defined(__i386__) #define FMT_pid "%ld" #elif defined(WIN64) -- cgit v1.1 From 04b09de16d78cf2d163ca65d7c6d161bf2baceb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 21 Jun 2024 09:03:17 +0200 Subject: migration: Remove unused VMSTATE_ARRAY_TEST() macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last use of VMSTATE_ARRAY_TEST() was removed in commit 46baa9007f ("migration/i386: Remove old non-softfloat 64bit FP support"), we can safely get rid of it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Li Zhijian Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- include/migration/vmstate.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include') diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 294d2d8..f313f2f 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -388,16 +388,6 @@ extern const VMStateInfo vmstate_info_qlist; .offset = vmstate_offset_varray(_state, _field, _type), \ } -#define VMSTATE_ARRAY_TEST(_field, _state, _num, _test, _info, _type) {\ - .name = (stringify(_field)), \ - .field_exists = (_test), \ - .num = (_num), \ - .info = &(_info), \ - .size = sizeof(_type), \ - .flags = VMS_ARRAY, \ - .offset = vmstate_offset_array(_state, _field, _type, _num),\ -} - #define VMSTATE_SUB_ARRAY(_field, _state, _start, _num, _version, _info, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \ -- cgit v1.1