Skip to contentSkip to conversation

QEMU host support

Qemu-devel Jes Sorensen 4 participants 7 messages Oct 15, 2010 – Oct 16, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

Looking through some code in qemu-char.c I was wondering if we support any other QEMU host target than Win32 which isn't covered by these defines:

#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
    || defined(__NetBSD__) || defined(__OpenBSD__) ||
defined(__DragonFly__) \
    || defined(__GLIBC__)

Thanks,
Jes

#1 lore raw
Quoted 7 lines · Jes Sorensen

Looking through some code in qemu-char.c I was wondering if we support any other QEMU host target than Win32 which isn't covered by these defines:

#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
   || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \
   || defined(__GLIBC__)

What about Haiku? It uses __HAIKU__ but I'm not sure if it defines __GLIBC__ or even one of the others.

Stefan

#3 lore raw
In reply to Jes Sorensen
Quoted 9 lines · Jes Sorensen

Hi,

Looking through some code in qemu-char.c I was wondering if we support any other QEMU host target than Win32 which isn't covered by these defines:

#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
     || defined(__NetBSD__) || defined(__OpenBSD__) ||
defined(__DragonFly__) \
     || defined(__GLIBC__)

Darwin?

Paolo

#2 lore raw
In reply to Stefan Hajnoczi

Am 16.10.2010 um 09:46 schrieb Stefan Hajnoczi:

Quoted 11 lines · Jes Sorensen
Quoted 7 lines

Looking through some code in qemu-char.c I was wondering if we support any other QEMU host target than Win32 which isn't covered by these defines:

#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
   || defined(__NetBSD__) || defined(__OpenBSD__) ||
defined(__DragonFly__) \
   || defined(__GLIBC__)

What about Haiku? It uses __HAIKU__ but I'm not sure if it defines __GLIBC__ or even one of the others.

Apparently it doesn't define __GLIBC__ (it has a libroot that contains parts of glibc only). It definitely doesn't define any of the others.

If I add || defined (__HAIKU__) to the list above, I get:

CC qemu-char.o
/Data/QEMU/qemu/qemu-char.c: In function 'qemu_chr_open_pty':
/Data/QEMU/qemu/qemu-char.c:982: warning: implicit declaration of function 'openpty' /Data/QEMU/qemu/qemu-char.c:982: warning: nested extern declaration of 'openpty' /Data/QEMU/qemu/qemu-char.c:988: warning: implicit declaration of function 'cfmakeraw' /Data/QEMU/qemu/qemu-char.c:988: warning: nested extern declaration of 'cfmakeraw' /Data/QEMU/qemu/qemu-char.c: In function 'tty_serial_ioctl':
/Data/QEMU/qemu/qemu-char.c:1149: error: 'TIOCMGET' undeclared (first use in this function) /Data/QEMU/qemu/qemu-char.c:1149: error: (Each undeclared identifier is reported only once /Data/QEMU/qemu/qemu-char.c:1149: error: for each function it appears in.) /Data/QEMU/qemu/qemu-char.c:1151: error: 'TIOCM_CTS' undeclared (first use in this function) /Data/QEMU/qemu/qemu-char.c:1153: error: 'TIOCM_CAR' undeclared (first use in this function) /Data/QEMU/qemu/qemu-char.c:1155: error: 'TIOCM_DSR' undeclared (first use in this function) /Data/QEMU/qemu/qemu-char.c:1157: error: 'TIOCM_RI' undeclared (first use in this function) /Data/QEMU/qemu/qemu-char.c:1159: error: 'TIOCM_DTR' undeclared (first use in this function) /Data/QEMU/qemu/qemu-char.c:1161: error: 'TIOCM_RTS' undeclared (first use in this function) /Data/QEMU/qemu/qemu-char.c:1184: error: 'TIOCMSET' undeclared (first use in this function)
make: *** [qemu-char.o] Error 1

openpty() is defined in Haiku's BSD compatibility layer, in pty.h. Hacking the FreeBSD #include code path makes QEMU find it. There's no cfmakeraw(). Reusing the one from the Sun code path seems to work.

I believe these TIOCM* defines were not supported in Haiku and we didn't find out where they originate from. They were not in POSIX. Anyone know off-hand?

Andreas

#4 lore raw
In reply to Paolo Bonzini

Am 16.10.2010 um 02:37 schrieb Paolo Bonzini:

Quoted 10 lines · Jes Sorensen
Quoted 7 lines

Looking through some code in qemu-char.c I was wondering if we support any other QEMU host target than Win32 which isn't covered by these defines:

#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
    || defined(__NetBSD__) || defined(__OpenBSD__) ||
defined(__DragonFly__) \
    || defined(__GLIBC__)

Darwin?

Affirmative. If I add || defined(__APPLE__) it builds with a warning:

CC qemu-char.o
/Users/andreas/QEMU/qemu/qemu-char.c:1215: warning: ‘qemu_chr_open_tty’ defined but not used

Andreas

#6 lore raw
In reply to Paolo Bonzini
Quoted 7 lines · Paolo Bonzini
Quoted 6 lines · Jes Sorensen

Hi,

Looking through some code in qemu-char.c I was wondering if we support any other QEMU host target than Win32 which isn't covered by these defines:

Quoted 6 lines
Quoted 4 lines
#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
     || defined(__NetBSD__) || defined(__OpenBSD__) ||
defined(__DragonFly__) \
     || defined(__GLIBC__)

Darwin?

Ah right, I wasn't sure if that was still building. It just seemed a pretty excessive positive list.

Jes

#5 lore raw
In reply to Andreas Färber
Quoted 7 lines · Andreas Färber

Am 16.10.2010 um 02:37 schrieb Paolo Bonzini:

Quoted 5 lines · Jes Sorensen
Quoted 4 lines

Looking through some code in qemu-char.c I was wondering if we support any other QEMU host target than Win32 which isn't covered by these defines:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
    || defined(__NetBSD__) || defined(__OpenBSD__) ||
defined(__DragonFly__) \
    || defined(__GLIBC__)

Darwin?

Affirmative. If I add || defined(__APPLE__) it builds with a warning:

Should we add __APPLE__ to the list or is it not necessary? I really know zilch about our OSX support.

Cheers,
Jes