hw/virtio: Use error_setg_file_open() for a better error message
The error message changes from
vhost-vsock: failed to open vhost device: REASON
to
Could not open '/dev/vhost-vsock': REASON
I think the exact file name is more useful to know than the file's
purpose.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251121121438.1249498-8-armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
6d85f1d449
commit
77f4f14e08
1 changed files with 1 additions and 2 deletions
|
|
@ -153,8 +153,7 @@ static void vhost_vsock_device_realize(DeviceState *dev, Error **errp)
|
||||||
} else {
|
} else {
|
||||||
vhostfd = open("/dev/vhost-vsock", O_RDWR);
|
vhostfd = open("/dev/vhost-vsock", O_RDWR);
|
||||||
if (vhostfd < 0) {
|
if (vhostfd < 0) {
|
||||||
error_setg_errno(errp, errno,
|
error_setg_file_open(errp, errno, "/dev/vhost-vsock");
|
||||||
"vhost-vsock: failed to open vhost device");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue