diff mbox

fixup! char: Convert to new qapi union layout

Message ID 1446235313-2570-1-git-send-email-eblake@redhat.com
State New
Headers show

Commit Message

Eric Blake Oct. 30, 2015, 8:01 p.m. UTC
Fix build failure on w32

Signed-off-by: Eric Blake <eblake@redhat.com>
---

Hopefully, this is the only use of qapi union types hiding
behind #ifdefs (I relied on the compiler to tell me which spots
need conversion, but that doesn't work for spots that aren't
compiled in my setup)

 qemu-char.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Markus Armbruster Nov. 2, 2015, 9:10 a.m. UTC | #1
Eric Blake <eblake@redhat.com> writes:

> Fix build failure on w32
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

Squashed, thanks!

> ---
>
> Hopefully, this is the only use of qapi union types hiding
> behind #ifdefs (I relied on the compiler to tell me which spots
> need conversion, but that doesn't work for spots that aren't
> compiled in my setup)

We could've generated a semantic patch for Coccinelle.  Not foolproof,
either, as Coccinelle can miss things when its parser heuristics fail.
Anyway, not worth it now.
diff mbox

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 8f04a9d..5448b0f 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -4048,7 +4048,7 @@  static CharDriverState *qmp_chardev_open_file(const char *id,
                                               ChardevReturn *ret,
                                               Error **errp)
 {
-    ChardevFile *file = backend->file;
+    ChardevFile *file = backend->u.file;
     HANDLE out;

     if (file->has_in) {
@@ -4070,7 +4070,7 @@  static CharDriverState *qmp_chardev_open_serial(const char *id,
                                                 ChardevReturn *ret,
                                                 Error **errp)
 {
-    ChardevHostdev *serial = backend->serial;
+    ChardevHostdev *serial = backend->u.serial;
     return qemu_chr_open_win_path(serial->device, errp);
 }