]> git.proxmox.com Git - mirror_qemu.git/commit
net: handle QIOTask completion to report useful error message
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 4 Jan 2024 16:29:41 +0000 (16:29 +0000)
committerThomas Huth <thuth@redhat.com>
Thu, 11 Jan 2024 10:39:26 +0000 (11:39 +0100)
commit9cd67f0cce1887598b09b80cdeb066531102d743
tree9705dd05571805fa193538e585b29d8342f38440
parentcc91ca64d826acc0214ebf9428f5130b37deecd8
net: handle QIOTask completion to report useful error message

The network stream backend uses the async QIO socket APIs for listening
and connecting sockets. It does not check the task object completion
status, however, instead just looking at whether the socket FD is -1
or not.

By checking the task completion, we can set a useful error message for
users instead of the non-actionable "connection error" string.

eg so users will see:

(qemu) info network
net: index=0,type=stream,error: Failed to connect to '/foo.unix': No such file or directory

Signed-off-by: "Daniel P. Berrangé" <berrange@redhat.com>
Message-ID: <20240104162942.211458-6-berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
net/stream.c