qemu-cr16/hw
Vladimir Sementsov-Ogievskiy 8cb17f9c36 util: drop qemu_socket_set_nonblock()
Use common qemu_set_blocking() instead.

Note that pre-patch the behavior of Win32 and Linux realizations
are inconsistent: we ignore failure for Win32, and assert success
for Linux.

How do we convert the callers?

1. Most of callers call qemu_socket_set_nonblock() on a
freshly created socket fd, in conditions when we may simply
report an error. Seems correct switching to error handling
both for Windows (pre-patch error is ignored) and Linux
(pre-patch we assert success). Anyway, we normally don't
expect errors in these cases.

Still in tests let's use &error_abort for simplicity.

What are exclusions?

2. hw/virtio/vhost-user.c - we are inside #ifdef CONFIG_LINUX,
so no damage in switching to error handling from assertion.

3. io/channel-socket.c: here we convert both old calls to
qemu_socket_set_nonblock() and qemu_socket_set_block() to
one new call. Pre-patch we assert success for Linux in
qemu_socket_set_nonblock(), and ignore all other errors here.
So, for Windows switch is a bit dangerous: we may get
new errors or crashes(when error_abort is passed) in
cases where we have silently ignored the error before
(was it correct in all such cases, if they were?) Still,
there is no other way to stricter API than take
this risk.

4. util/vhost-user-server - compiled only for Linux (see
util/meson.build), so we are safe, switching from assertion to
&error_abort.

Note: In qga/channel-posix.c we use g_warning(), where g_printerr()
would actually be a better choice. Still let's for now follow
common style of qga, where g_warning() is commonly used to print
such messages, and no call to g_printerr(). Converting everything
to use g_printerr() should better be another series.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-09-19 12:46:07 +01:00
..
9pfs hw/9pfs: move G_GNUC_PRINTF to header 2025-07-16 14:18:48 +02:00
acpi acpi: mark PMTIMER as unlocked 2025-08-29 12:48:14 +02:00
adc
alpha
arm target-arm queue: 2025-09-17 11:10:55 -07:00
audio hw/audio/via-ac97: skip automatic zero-init of large array 2025-06-12 13:40:15 -04:00
avr
block hw/virtio: Build various files once 2025-07-15 02:56:39 -04:00
char hw/char/max78000_uart: Destroy FIFO on deinit 2025-09-02 17:57:05 +02:00
core * cpu-exec: more cleanups to CPU loop exits 2025-09-18 07:05:59 -07:00
cpu
cxl hw/cxl: mailbox-utils: 0x5605 - FMAPI Initiate DC Release 2025-07-15 02:56:40 -04:00
display hw/display/bcm2835_fb: Move inclusion of console.h to the .c file 2025-09-09 09:31:15 +02:00
dma hw/dma/xlnx_csu_dma: skip automatic zero-init of large array 2025-06-12 13:40:15 -04:00
fsi
gpio hw/gpio/pca9554: Avoid leak in pca9554_set_pin() 2025-09-02 17:57:05 +02:00
hppa
hyperv util: drop qemu_socket_set_nonblock() 2025-09-19 12:46:07 +01:00
i2c
i386 hw/i386/pc_piix.c: remove unnecessary if() from pc_init1() 2025-09-02 17:58:05 +02:00
ide hw/ide/ich.c: Use qemu_init_irq_child() to avoid memory leak 2025-09-02 17:57:05 +02:00
input
intc hw/intc: compile some arm related source once 2025-09-02 17:57:05 +02:00
ipack
ipmi
isa hw/isa/superio: Include 'system/system.h' 2025-09-02 17:58:05 +02:00
loongarch hw/loongarch/virt: Register reset interface with cpu plug callback 2025-09-18 17:39:57 +08:00
m68k hw: add compat machines for 10.2 2025-08-27 07:07:53 +02:00
mem hw/cxl: mailbox-utils: 0x5604 - FMAPI Initiate DC Add 2025-07-15 02:56:40 -04:00
microblaze hw/microblaze: Add missing FDT dependency 2025-07-15 00:24:26 +02:00
mips hw/mips/malta: Silence warning from ubsan 2025-09-09 09:34:45 +02:00
misc hw/misc/xlnx-versal-cframe-reg: Free FIFO, g_tree on deinit 2025-09-02 17:57:05 +02:00
net hw/net: Remove mipsnet device model 2025-09-02 17:57:05 +02:00
nubus
nvme hw/nvme: cap MDTS value for internal limitation 2025-08-11 00:17:38 -07:00
nvram hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE 2025-05-30 09:52:08 +02:00
openrisc add cpu_test_interrupt()/cpu_set_interrupt() helpers and use them tree wide 2025-08-29 12:48:14 +02:00
pci hw/pci: Introduce pci_setup_iommu_per_bus() for per-bus IOMMU ops retrieval 2025-09-16 17:31:54 +01:00
pci-bridge hw/arm/smmu-common: Check SMMU has PCIe Root Complex association 2025-09-16 17:31:54 +01:00
pci-host hw/pci-host/gpex-acpi: Use build_pci_host_bridge_osc_method 2025-07-15 02:56:40 -04:00
ppc cpus: properly kick CPUs out of inner execution loop 2025-09-17 19:00:55 +02:00
remote treewide: handle result of qio_channel_set_blocking() 2025-09-19 12:46:07 +01:00
riscv hw/riscv/virt-acpi-build.c: Update FADT and MADT versions 2025-07-30 10:59:26 +10:00
rtc
rx
s390x s390x/s390-pci-vfio.c: use QOM casts where appropriate 2025-09-08 16:46:31 +02:00
scsi hw/scsi/mptsas: Avoid silent integer truncation in MPI_FUNC_IOC_INIT 2025-09-02 17:57:05 +02:00
sd hw/sd/sdcard: Refactor sd_bootpart_offset 2025-09-02 17:58:05 +02:00
sensor qemu: Declare all load/store helper in 'qemu/bswap.h' 2025-07-15 02:56:39 -04:00
sh4
smbios qemu: Declare all load/store helper in 'qemu/bswap.h' 2025-07-15 02:56:39 -04:00
sparc
sparc64
ssi hw/ssi/aspeed_smc: Fix incorrect FMC_WDT2 register read on AST1030 2025-08-04 09:07:38 +02:00
timer hpet: guard IRQ handling with BQL 2025-09-17 19:00:58 +02:00
tpm
tricore
uefi hw/uefi: open json file in binary mode 2025-08-12 08:03:16 +02:00
ufs hw/ufs/lu: skip automatic zero-init of large array 2025-06-12 13:40:16 -04:00
usb hw/usb/network: Remove hardcoded 0x40 prefix in STRING_ETHADDR response 2025-09-16 17:32:06 +01:00
vfio vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj 2025-09-08 16:46:32 +02:00
vfio-user treewide: handle result of qio_channel_set_blocking() 2025-09-19 12:46:07 +01:00
virtio util: drop qemu_socket_set_nonblock() 2025-09-19 12:46:07 +01:00
vmapple qemu: Declare all load/store helper in 'qemu/bswap.h' 2025-07-15 02:56:39 -04:00
watchdog
xen hw/xen/passthrough: add missing error-report include 2025-07-29 13:56:39 +02:00
xenpv
xtensa
Kconfig vfio-user: add vfio-user class and container 2025-06-26 08:55:38 +02:00
meson.build hw/meson: enter target hw first 2025-09-02 17:57:05 +02:00