aboutsummaryrefslogtreecommitdiff
path: root/util/osdep.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2024-06-17 15:57:20 -0300
committerFabiano Rosas <farosas@suse.de>2024-06-20 10:42:24 -0300
commit1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0 (patch)
treef09602edbb8ff11353ffb618095eec870bc6af33 /util/osdep.c
parent926554c0bfdfbf7b058ed370c2b484e56b126d34 (diff)
downloadqemu-1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0.zip
qemu-1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0.tar.gz
qemu-1cd93fb0bf8b1fddab4c38e17145cc8776eadaa0.tar.bz2
monitor: Drop monitor_fdset_dup_fd_find/_remove()
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 <dave@treblig.org> Cc: Markus Armbruster <armbru@redhat.com> Cc: Philippe Mathieu-Daudé <philmd@linaro.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [add missing return statement, removal during traversal is not safe] Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'util/osdep.c')
-rw-r--r--util/osdep.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/util/osdep.c b/util/osdep.c
index 5d23bbf..756de9a 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -398,21 +398,8 @@ int qemu_open_old(const char *name, int flags, ...)
int qemu_close(int fd)
{
- int64_t fdset_id;
-
/* Close fd that was dup'd from an fdset */
- fdset_id = monitor_fdset_dup_fd_find(fd);
- if (fdset_id != -1) {
- int ret;
-
- ret = close(fd);
- if (ret == 0) {
- monitor_fdset_dup_fd_remove(fd);
- }
-
- return ret;
- }
-
+ monitor_fdset_dup_fd_remove(fd);
return close(fd);
}