s390/vhost fix
[PULL for v11.2 1/1] vhost: only use config notifier when exists/initialized
In reply to Eric FarmanCommit e3b12d0c55e4 ("util/event_notifier: more strict API") added an assert for an uninitialized file descriptor in event_notifier_get_fd(), but it presumes that such a thing always exists.
On s390x, where a config notifier does not exist, this is a breaking change for any vhost-backed device such as virtio-net. To remedy this, move the acquisition of the file descriptor within the guard against vhost_set_config_call and expand the guard to ensure the notifier is initialized before being used.
--- hw/virtio/vhost.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/virtio/vhost.c +3 -2
@@ -2119,8 +2119,9 @@ static void vhost_start_config_intr(struct vhost_dev *dev)virtio_config_get_guest_notifier (dev->vdev);assert (dev->vhost_ops); -int fd =event_notifier_get_fd (config_notifier); -if (dev->vhost_ops->vhost_set_config_call) { +if (dev->vhost_ops->vhost_set_config_call && +event_notifier_initialized (config_notifier)) { +int fd =event_notifier_get_fd (config_notifier); r = dev->vhost_ops->vhost_set_config_call (dev, fd);if (!r) {event_notifier_set (config_notifier);
Signature · 1 line
2.56.0
The following changes since commit f71afb409a87c4ecd0f9d63a5963eb645dfab780:
Merge tag 'pull-loongarch-20261105' of https://github.com/bibo-mao/qemu into staging (2026-11-05 07:24:53 -0800)
are available in the Git repository at:
https://[email protected]/efarman/qemu.git tags/s390x-20261109
for you to fetch changes up to 94289e7960008ceedd16ba366ddca986df739936:
vhost: only use config notifier when exists/initialized (2026-11-09 08:14:45 -0500)
----------------------------------------------------------------
Fix vhost on s390x
----------------------------------------------------------------
Eric Farman (1):
vhost: only use config notifier when exists/initialized
hw/virtio/vhost.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.56.0
Richard Henderson
AppliedQuoted 6 lines · Eric Farman
The following changes since commit
f71afb409a87c4ecd0f9d63a5963eb645dfab780:Merge tag 'pull-loongarch-20261105' ofhttps://github.com/bibo-mao/qemu into staging (2026-11-05 07:24:53 -0800)are available in the Git repository at:
Quoted 8 lines
https://[email protected]/efarman/qemu.git tags/s390x-20261109for you to fetch changes up to
94289e7960008ceedd16ba366ddca986df739936:vhost: only use config notifier when exists/initialized (2026-11-09 08:14:45 -0500)
----------------------------------------------------------------
Fix vhost on s390x
Applied, thanks.
r~