mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
hw/usb: Convert to qemu_create() for a better error message
The error message changes from
open FILENAME failed
to
Could not create 'FILENAME': REASON
where REASON is the value of strerror(errno).
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251121121438.1249498-3-armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
a5da8dd90b
commit
622a0c9dee
+2
-3
@@ -259,10 +259,9 @@ static void usb_qdev_realize(DeviceState *qdev, Error **errp)
|
||||
}
|
||||
|
||||
if (dev->pcap_filename) {
|
||||
int fd = qemu_open_old(dev->pcap_filename,
|
||||
O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666);
|
||||
int fd = qemu_create(dev->pcap_filename,
|
||||
O_WRONLY | O_TRUNC | O_BINARY, 0666, errp);
|
||||
if (fd < 0) {
|
||||
error_setg(errp, "open %s failed", dev->pcap_filename);
|
||||
usb_qdev_unrealize(qdev);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user