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>
}
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;
}