summaryrefslogtreecommitdiffstats
path: root/util/compatfd.c
Commit message (Collapse)AuthorAgeFilesLines
* util: replace pipe()+cloexec with g_unix_open_pipe()Marc-André Lureau2022-05-031-4/+1Star
| | | | | | Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* util: simplify write in signal handlerMarc-André Lureau2022-04-211-16/+2Star
| | | | | | | | Use qemu_write_full() instead of open-coding a write loop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-36-marcandre.lureau@redhat.com>
* util/compatfd.c: use libc signalfd wrapper instead of raw syscallKacper Słomiński2021-10-131-3/+2Star
| | | | | | | | | This allows the use of native signalfd instead of the sigtimedwait based emulation on systems other than Linux. Signed-off-by: Kacper Słomiński <kacper.slominski72@gmail.com> Message-Id: <20210905011621.200785-1-kacper.slominski72@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* util/compatfd.c: Replaced a malloc call with g_malloc.Mahmoud Mandour2021-05-141-6/+2Star
| | | | | | | | | | | | | | | | | Replaced a call to malloc() and its respective call to free() with g_malloc() and g_free(). g_malloc() is preferred more than g_try_* functions, which return NULL on error, when the size of the requested allocation is small. This is because allocating few bytes should not be a problem in a healthy system. Otherwise, the system is already in a critical state. Subsequently, removed NULL-checking after g_malloc(). Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com> Message-Id: <20210315105814.5188-3-ma.mandourr@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* util/compatfd.c: Fixed style issuesMahmoud Mandour2021-04-011-3/+3
| | | | | | | | | Fixed two styling issues that caused checkpatch.pl errors. Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20210315105814.5188-2-ma.mandourr@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* util/compatfd.c: Only include <sys/syscall.h> if CONFIG_SIGNALFDDavid CARLIER2020-07-131-0/+2
| | | | | | | | | | | | | | | | util/compatfd.c includes <sys/syscall.h> so that the CONFIG_SIGNALFD code can use SYS_signalfd. Guard the #include with CONFIG_SIGNALFD to avoid portability issues on hosts like Haiku which do not provide that header file. Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20200703145614.16684-8-peter.maydell@linaro.org [PMM: Expanded commit message] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Include qemu-common.h exactly where neededMarkus Armbruster2019-06-121-1/+0Star
| | | | | | | | | | | | | | | | No header includes qemu-common.h after this commit, as prescribed by qemu-common.h's file comment. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-5-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and net/tap-bsd.c fixed up]
* cpus: remove ugly cast on sigbus_handlerPaolo Bonzini2017-03-031-1/+0Star
| | | | | | | | | | | The cast is there because sigbus_handler is invoked via sigfd_handler. But it feels just wrong to use struct qemu_signalfd_siginfo in the prototype of a function that is passed to sigaction. Instead, do a simple-minded conversion of qemu_signalfd_siginfo to siginfo_t. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* util: Clean up includesPeter Maydell2016-02-041-0/+1
| | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1454089805-5470-6-git-send-email-peter.maydell@linaro.org
* util: Remove unused functionsThomas Huth2015-04-301-19/+0Star
| | | | | | | | Delete the unused functions qemu_signalfd_available(), qemu_send_full() and qemu_recv_full(). Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Add a 'name' parameter to qemu_thread_createDr. David Alan Gilbert2014-03-091-1/+2
| | | | | | | | | | If enabled, set the thread name at creation (on GNU systems with pthread_set_np) Fix up all the callers with a thread name Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* compatfd: switch to QemuThreadJan Kiszka2013-10-171-13/+3Star
| | | | | | | qemu_thread_create already does signal blocking and detaching for us. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* build: move libqemuutil.a components to util/Paolo Bonzini2013-01-121-0/+138
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>