]> git.proxmox.com Git - mirror_qemu.git/commitdiff
chardev: Improve error report by calling error_setg_win32()
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Fri, 28 Feb 2020 10:07:23 +0000 (11:07 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 9 Mar 2020 12:36:15 +0000 (13:36 +0100)
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
chardev/char-win.c

index 94d714ffcd0ab1914b1b97fb53436e4535b1d3e1..fd12c9e63b5313cdfd972aa815b7db4ae659dff7 100644 (file)
@@ -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;
     }
index 34825f683dbaa752fcfd6168916d142489a280a5..d4fb44c4dcc5faefd8abc8e699324e9b6874022b 100644 (file)
@@ -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;
     }