qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu & openpty


From: Brad Smith
Subject: Re: [Qemu-devel] qemu & openpty
Date: Wed, 05 Jun 2013 08:41:44 -0400
User-agent: Mozilla/5.0 (Macintosh; PPC Mac OS X 10.5; rv:17.0) Gecko/20130513 Thunderbird/17.0.6 TenFourFox/Debugging

On 05/06/13 6:28 AM, Michael Tokarev wrote:
Hello.

One of old issues with compatibility between different
*Nix systems was the way how pty pairs were allocated.

And qemu have a twist in #includes, depending on which
platform it is run, and quite some compat cruft in
qemu-char.c about this issue.

Here it is, from qemu-char.c:

#ifdef __sun__
/* Once Solaris has openpty(), this is going to be removed. */
static int openpty(int *amaster, int *aslave, char *name,
                    struct termios *termp, struct winsize *winp)
{...}

static void cfmakeraw (struct termios *termios_p)
{...}
#endif

and later on, openpty() is used in the code.  Note that
both functions are marked as static - static to the
source file, qemu-char.c.

Now, we have ui/gtk.c, which calls openpty() and cfmakeraw()
too, but this time, there's no compat alternative implementation
provided.

Does this mean we don't need the old compat implementation
anymore?  Does gtk ui work (or at least builds) on solaris?

If gtk builds fine on solaris, it should be safe to remove
these static functions from qemu-char.c.

If not, we should obviously re-use these for ui/gtk.c --
for which I'd create a new file, say, qemu-openpty.c,
with all the system-dependent stuff inside, and create
a wrapper function, qemu_openpty(), to do the work,
and, ofcourse, remove <pty.h> and other fancy stuff
(like <stropts.h> for solaris) from qemu-common.h (!!!)
where it finally ended up.

Thanks,

/mjt

Solaris does not have openpty() / cfmakeraw() functions so
the Gtk+ front-end is broken there as well.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]