"Dr. David Alan Gilbert" <[email protected]> writes: > * Markus Armbruster ([email protected]) wrote: >> The error message changes from >> >> open FILENAME failed >> >> to >> >> Could not open 'FILENAME': REASON >> >> where REASON is the value of strerror(errno). >> >> Signed-off-by: Markus Armbruster <[email protected]> >> --- >> hw/usb/bus.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/usb/bus.c b/hw/usb/bus.c >> index 8dd2ce415e..47d42ca3c1 100644 >> --- a/hw/usb/bus.c >> +++ b/hw/usb/bus.c >> @@ -262,7 +262,7 @@ static void usb_qdev_realize(DeviceState *qdev, Error >> **errp) >> int fd = qemu_open_old(dev->pcap_filename, >> O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, >> 0666); >> if (fd < 0) { >> - error_setg(errp, "open %s failed", dev->pcap_filename); >> + error_setg_file_open(errp, errno, dev->pcap_filename); > > Wouldn't it be easier to flip it to use qemu_open() ?
Mechanical change; I missed the obvious :) I'll give it a try, along with the call in ui/ui-qmp-cmd.c [PATCH 09]. Thanks! > > Dave > >> usb_qdev_unrealize(qdev); >> return; >> } >> -- >> 2.49.0 >>
