From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PULL 1/4] chardev: Improve error report by calling error_setg_win32()
Date: Mon, 9 Mar 2020 13:46:13 +0100 [thread overview]
Message-ID: <20200309124616.4372-2-armbru@redhat.com> (raw)
In-Reply-To: <20200309124616.4372-1-armbru@redhat.com>
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Use error_setg_win32() which adds a hint similar to strerror(errno)).
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200228100726.8414-2-philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
chardev/char-pipe.c | 2 +-
chardev/char-win.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/chardev/char-pipe.c b/chardev/char-pipe.c
index 94d714ffcd..fd12c9e63b 100644
--- a/chardev/char-pipe.c
+++ b/chardev/char-pipe.c
@@ -70,7 +70,7 @@ static int win_chr_pipe_init(Chardev *chr, const char *filename,
MAXCONNECT, NSENDBUF, NRECVBUF, NTIMEOUT, NULL);
g_free(openname);
if (s->file == INVALID_HANDLE_VALUE) {
- error_setg(errp, "Failed CreateNamedPipe (%lu)", GetLastError());
+ error_setg_win32(errp, GetLastError(), "Failed CreateNamedPipe");
s->file = NULL;
goto fail;
}
diff --git a/chardev/char-win.c b/chardev/char-win.c
index 34825f683d..d4fb44c4dc 100644
--- a/chardev/char-win.c
+++ b/chardev/char-win.c
@@ -96,7 +96,7 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp)
s->file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
if (s->file == INVALID_HANDLE_VALUE) {
- error_setg(errp, "Failed CreateFile (%lu)", GetLastError());
+ error_setg_win32(errp, GetLastError(), "Failed CreateFile");
s->file = NULL;
goto fail;
}
--
2.21.1
next prev parent reply other threads:[~2020-03-09 12:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 12:46 [PULL 0/4] Error reporting patches for 2020-03-09 Markus Armbruster
2020-03-09 12:46 ` Markus Armbruster [this message]
2020-03-09 12:46 ` [PULL 2/4] util/osdep: Improve error report by calling error_setg_win32() Markus Armbruster
2020-03-09 12:46 ` [PULL 3/4] qga: " Markus Armbruster
2020-03-09 12:46 ` [PULL 4/4] qga: Fix a memory leak Markus Armbruster
2020-03-09 15:35 ` [PULL 0/4] Error reporting patches for 2020-03-09 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200309124616.4372-2-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).