[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/11] chardev: reduce chardev ifdef mess a bit
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 03/11] chardev: reduce chardev ifdef mess a bit |
Date: |
Thu, 10 Jan 2013 11:27:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
Il 07/01/2013 14:55, Gerd Hoffmann ha scritto:
> Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Paolo
> ---
> qemu-char.c | 22 +++++++++++-----------
> 1 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index a29c2bb..c511de3 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -856,6 +856,8 @@ static void cfmakeraw (struct termios *termios_p)
> || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
> \
> || defined(__GLIBC__)
>
> +#define HAVE_CHARDEV_TTY 1
> +
> typedef struct {
> int fd;
> int connected;
> @@ -1244,14 +1246,12 @@ static CharDriverState *qemu_chr_open_tty(QemuOpts
> *opts)
> chr->chr_close = qemu_chr_close_tty;
> return chr;
> }
> -#else /* ! __linux__ && ! __sun__ */
> -static CharDriverState *qemu_chr_open_pty(QemuOpts *opts)
> -{
> - return NULL;
> -}
> #endif /* __linux__ || __sun__ */
>
> #if defined(__linux__)
> +
> +#define HAVE_CHARDEV_PARPORT 1
> +
> typedef struct {
> int fd;
> int mode;
> @@ -1395,6 +1395,9 @@ static CharDriverState *qemu_chr_open_pp(QemuOpts *opts)
> #endif /* __linux__ */
>
> #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ||
> defined(__DragonFly__)
> +
> +#define HAVE_CHARDEV_PARPORT 1
> +
> static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
> {
> int fd = (int)(intptr_t)chr->opaque;
> @@ -2755,19 +2758,16 @@ static const struct {
> #else
> { .name = "file", .open = qemu_chr_open_file_out },
> { .name = "pipe", .open = qemu_chr_open_pipe },
> - { .name = "pty", .open = qemu_chr_open_pty },
> { .name = "stdio", .open = qemu_chr_open_stdio },
> #endif
> #ifdef CONFIG_BRLAPI
> { .name = "braille", .open = chr_baum_init },
> #endif
> -#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
> - || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
> \
> - || defined(__FreeBSD_kernel__)
> +#ifdef HAVE_CHARDEV_TTY
> { .name = "tty", .open = qemu_chr_open_tty },
> + { .name = "pty", .open = qemu_chr_open_pty },
> #endif
> -#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) \
> - || defined(__FreeBSD_kernel__)
> +#ifdef HAVE_CHARDEV_PARPORT
> { .name = "parport", .open = qemu_chr_open_pp },
> #endif
> #ifdef CONFIG_SPICE
>
- [Qemu-devel] [PATCH 05/11] chardev: add hmp hotplug commands, (continued)
- [Qemu-devel] [PATCH 10/11] chardev: add socket chardev support to chardev-add (qmp), Gerd Hoffmann, 2013/01/07
- [Qemu-devel] [PATCH 07/11] chardev: add tty chardev support to chardev-add (qmp), Gerd Hoffmann, 2013/01/07
- [Qemu-devel] [PATCH 03/11] chardev: reduce chardev ifdef mess a bit, Gerd Hoffmann, 2013/01/07
- Re: [Qemu-devel] [PATCH 03/11] chardev: reduce chardev ifdef mess a bit,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 11/11] chardev: add pty chardev support to chardev-add (qmp), Gerd Hoffmann, 2013/01/07
- [Qemu-devel] [PATCH 06/11] chardev: add file chardev support to chardev-add (qmp), Gerd Hoffmann, 2013/01/07