current qemu cvs broken for mingw hosts
in vl.c (change introduced 2 days ago by Paul):
In file included from c:/qemu/qemu-30jan07/vl.c:24:
c:/qemu/qemu-30jan07/vl.h:57:1: warning: "ENOMEDIUM" redefined c:/qemu/qemu-30jan07/vl.h:49:1: warning: this is the location of the previous definition
c:/qemu/qemu-30jan07/vl.c: In function `win_chr_read_poll':
c:/qemu/qemu-30jan07/vl.c:2021: error: structure has no member named chr' c:/qemu/qemu-30jan07/vl.c: In function win_chr_readfile':
c:/qemu/qemu-30jan07/vl.c:2042: error: structure has no member named `chr'
I cannot figure out what "chr"'s type is supposed to be in the struct. Any clue ?
This should break other hosts builds too.
Signature · 1 line
Christian
Hi,
Quoted 2 lines · Christian MICHON
In file included from c:/qemu/qemu-30jan07/vl.c:24:
c:/qemu/qemu-30jan07/vl.h:57:1: warning: "ENOMEDIUM" redefined
just guard it with an #ifndef ENOMEDIUM
Quoted 5 lines
c:/qemu/qemu-30jan07/vl.c: In function `win_chr_read_poll':
c:/qemu/qemu-30jan07/vl.c:2021: error: structure has no member named `chr' [...]I cannot figure out what "chr"'s type is supposed to be in the struct.
How about CharDriverState? I deduce this from
origin:vl.h:318:int qemu_chr_can_read(CharDriverState *s);
Hth,
Dscho
Quoted 1 line · Johannes Schindelin
just guard it with an #ifndef ENOMEDIUM
this one was not bothering so much, but it's true it's cleaner with this.
Quoted 9 lines
Quoted 5 lines
c:/qemu/qemu-30jan07/vl.c: In function `win_chr_read_poll':
c:/qemu/qemu-30jan07/vl.c:2021: error: structure has no member named `chr' [...]I cannot figure out what "chr"'s type is supposed to be in the struct.
How about CharDriverState? I deduce this from
origin:vl.h:318:int
qemu_chr_can_read(CharDriverState *s);
I guess I'm tired (banged too much my head on git recently :) ) The fix is attached: thanks.
Signature · 1 line
Christian
vl.c_xian renamed from vl.c +1 -0
@@ -1880,6 +1880,7 @@ OVERLAPPED orecv, osend; BOOL fpipe; DWORD len; + CharDriverState *chr; } WinCharState; #define NSENDBUF 2048
Quoted 9 lines · Christian MICHON
Quoted 1 line · Johannes Schindelin
just guard it with an #ifndef ENOMEDIUM
this one was not bothering so much, but it's true it's cleaner with this.
Quoted 4 lines
Quoted 4 lines
c:/qemu/qemu-30jan07/vl.c: In function `win_chr_read_poll':
c:/qemu/qemu-30jan07/vl.c:2021: error: structure has no member named `chr' [...]
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
I cannot figure out what "chr"'s type is supposed to be in the struct.
How about CharDriverState? I deduce this from
origin:vl.h:318:int
qemu_chr_can_read(CharDriverState *s);I guess I'm tired (banged too much my head on git recently :) ) The fix is attached: thanks.
Did you test it? I'm fairly certain it still won't work. AFAICS You're not setting the field anywhere.
Paul
Hi,
Quoted 14 lines · Paul Brook
Quoted 13 lines · Christian MICHON
Quoted 1 line · Johannes Schindelin
just guard it with an #ifndef ENOMEDIUM
this one was not bothering so much, but it's true it's cleaner with this.
Quoted 8 lines
Quoted 5 lines
c:/qemu/qemu-30jan07/vl.c: In function `win_chr_read_poll':
c:/qemu/qemu-30jan07/vl.c:2021: error: structure has no member named `chr' [...]I cannot figure out what "chr"'s type is supposed to be in the struct.
How about CharDriverState? I deduce this from
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
origin:vl.h:318:int
qemu_chr_can_read(CharDriverState *s);I guess I'm tired (banged too much my head on git recently :) ) The fix is attached: thanks.
Did you test it? I'm fairly certain it still won't work. AFAICS You're not setting the field anywhere.
Indeed. Somehow I assumed that text_console_init() would set this. Sorry.
Ciao,
Dscho
Quoted 3 lines · Paul Brook
Did you test it? I'm fairly certain it still won't work. AFAICS You're not setting the field anywhere.
it solved the compilation, which was broken, which was my primary concern. Your patches normally don't break the build :)
so in a sense, with regards to the current cvs state, it helps fixing the compilation, without segfault for example.
the binary works. The struct statement was missing the "chr". Now, in term of functionality, I do not know how you test it, if this was your question.
Signature · 1 line
Christian
Hi,
Quoted 7 lines · Christian MICHON
Quoted 2 lines · Paul Brook
Did you test it? I'm fairly certain it still won't work. AFAICS You're not setting the field anywhere.
the binary works. The struct statement was missing the "chr". Now, in term of functionality, I do not know how you test it, if this was your question.
You'd have to attach a serial device with "-serial COM". Unfortunately, I don't even have "COM" anymore, let alone on a machine which runs Windows, so I cannot test either.
But this patch looks sane to me (since WinCharState is initialized by win_chr_init(), IMHO it makes sense to pass the CharDriverState to that function):
vl.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
vl.c +4 -2
@@ -1875,6 +1875,7 @@ static CharDriverState *qemu_chr_open_pty(void) #ifdef _WIN32 typedef struct { + CharDriverState *chr; int max_size; HANDLE hcom, hrecv, hsend; OVERLAPPED orecv, osend;
@@ -1916,7 +1917,7 @@ static void win_chr_close(CharDriverState *chr)win_chr_close2 (s); } -static int win_chr_init (WinCharState *s,const char *filename) +static int win_chr_init (WinCharState *s,CharDriverState *chr,const char *filename) {COMMCONFIG comcfg;COMMTIMEOUTS cto = {0 ,0 ,0 ,0 ,0 };
@@ -1974,6 +1975,7 @@ static int win_chr_init(WinCharState *s, const char *filename)fprintf (stderr,"Failed ClearCommError\n" ); goto fail; } + s->chr = chr;qemu_add_polling_cb (win_chr_poll, s);return 0 ;
@@ -2086,7 +2088,7 @@ static CharDriverState *qemu_chr_open_win(const char *filename) chr->chr_write = win_chr_write; chr->chr_close = win_chr_close; -if (win_chr_init (s, filename) <0 ) { +if (win_chr_init (s, chr, filename) <0 ) {free (s);free (chr);return NULL ;