All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/3] Fix chrdev return value conversion
@ 2011-07-23 21:24 Blue Swirl
  2011-07-25  8:24 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Blue Swirl @ 2011-07-23 21:24 UTC (permalink / raw)
  To: qemu-devel, Kevin Wolf

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

6e1db57b2ac9025c2443c665a0d9e78748637b26 didn't
convert brlapi or win32 chrdevs, breaking build for those.

Fix by converting the chrdevs.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/baum.h   |    2 +-
 qemu-char.c |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/baum.h b/hw/baum.h
index 8af710f..3f28cc3 100644
--- a/hw/baum.h
+++ b/hw/baum.h
@@ -23,4 +23,4 @@
  */

 /* char device */
-CharDriverState *chr_baum_init(QemuOpts *opts);
+int chr_baum_init(QemuOpts *opts, CharDriverState **_chr);
diff --git a/qemu-char.c b/qemu-char.c
index dcf7065..2982bfd 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1782,7 +1782,7 @@ static int qemu_chr_open_win_pipe(QemuOpts
*opts, CharDriverState **_chr)
     return 0;
 }

-static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out)
+static int qemu_chr_open_win_file(HANDLE fd_out, CharDriverState **pchr)
 {
     CharDriverState *chr;
     WinCharState *s;
@@ -1793,10 +1793,11 @@ static CharDriverState
*qemu_chr_open_win_file(HANDLE fd_out)
     chr->opaque = s;
     chr->chr_write = win_chr_write;
     qemu_chr_generic_open(chr);
-    return chr;
+    *pchr = chr;
+    return 0;
 }

-static int qemu_chr_open_win_con(QemuOpts *opts, CharDriverState **_chr)
+static int qemu_chr_open_win_con(QemuOpts *opts, CharDriverState **chr)
 {
     return qemu_chr_open_win_file(GetStdHandle(STD_OUTPUT_HANDLE), chr);
 }
-- 
1.6.2.4

[-- Attachment #2: 0001-Fix-chrdev-return-value-conversion.patch --]
[-- Type: text/x-patch, Size: 1725 bytes --]

From 8bcd08d1fe7c90869ea6659b6248ace6cf7b1f32 Mon Sep 17 00:00:00 2001
Message-Id: <8bcd08d1fe7c90869ea6659b6248ace6cf7b1f32.1311456245.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sat, 23 Jul 2011 19:26:08 +0000
Subject: [PATCH 1/3] Fix chrdev return value conversion

6e1db57b2ac9025c2443c665a0d9e78748637b26 didn't
convert brlapi or win32 chrdevs, breaking build for those.

Fix by converting the chrdevs.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/baum.h   |    2 +-
 qemu-char.c |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/baum.h b/hw/baum.h
index 8af710f..3f28cc3 100644
--- a/hw/baum.h
+++ b/hw/baum.h
@@ -23,4 +23,4 @@
  */
 
 /* char device */
-CharDriverState *chr_baum_init(QemuOpts *opts);
+int chr_baum_init(QemuOpts *opts, CharDriverState **_chr);
diff --git a/qemu-char.c b/qemu-char.c
index dcf7065..2982bfd 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1782,7 +1782,7 @@ static int qemu_chr_open_win_pipe(QemuOpts *opts, CharDriverState **_chr)
     return 0;
 }
 
-static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out)
+static int qemu_chr_open_win_file(HANDLE fd_out, CharDriverState **pchr)
 {
     CharDriverState *chr;
     WinCharState *s;
@@ -1793,10 +1793,11 @@ static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out)
     chr->opaque = s;
     chr->chr_write = win_chr_write;
     qemu_chr_generic_open(chr);
-    return chr;
+    *pchr = chr;
+    return 0;
 }
 
-static int qemu_chr_open_win_con(QemuOpts *opts, CharDriverState **_chr)
+static int qemu_chr_open_win_con(QemuOpts *opts, CharDriverState **chr)
 {
     return qemu_chr_open_win_file(GetStdHandle(STD_OUTPUT_HANDLE), chr);
 }
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH 1/3] Fix chrdev return value conversion
  2011-07-23 21:24 [Qemu-devel] [PATCH 1/3] Fix chrdev return value conversion Blue Swirl
@ 2011-07-25  8:24 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2011-07-25  8:24 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

Am 23.07.2011 23:24, schrieb Blue Swirl:
> 6e1db57b2ac9025c2443c665a0d9e78748637b26 didn't
> convert brlapi or win32 chrdevs, breaking build for those.
> 
> Fix by converting the chrdevs.
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

Sorry, I should have run a mingw build after touching this code.

Acked-by: Kevin Wolf <kwolf@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-25  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-23 21:24 [Qemu-devel] [PATCH 1/3] Fix chrdev return value conversion Blue Swirl
2011-07-25  8:24 ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.