[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/4] qga/channel-posix: provide Solaris alternat
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 4/4] qga/channel-posix: provide Solaris alternative to O_ASYNC |
Date: |
Tue, 27 Mar 2012 16:56:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 |
Il 24/03/2012 17:26, Lee Essen ha scritto:
> Solaris does not support the O_ASYNC option to open, this patch
> adds the same functionality through the I_SETSIG ioctl.
>
> Signed-off-by: Lee Essen <address@hidden>
> ---
> qga/channel-posix.c | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/qga/channel-posix.c b/qga/channel-posix.c
> index 40f7658..86245c1 100644
> --- a/qga/channel-posix.c
> +++ b/qga/channel-posix.c
> @@ -3,6 +3,10 @@
> #include "qemu_socket.h"
> #include "qga/channel.h"
>
> +#ifdef CONFIG_SOLARIS
> +#include <sys/stropts.h>
> +#endif
> +
> #define GA_CHANNEL_BAUDRATE_DEFAULT B38400 /* for isa-serial channels */
>
> struct GAChannel {
> @@ -123,7 +127,19 @@ static gboolean ga_channel_open(GAChannel *c, const
> gchar *path, GAChannelMethod
>
> switch (c->method) {
> case GA_CHANNEL_VIRTIO_SERIAL: {
> +#ifdef CONFIG_SOLARIS
> + int fd = qemu_open(path, O_RDWR | O_NONBLOCK);
> + if (fd == -1) {
> + g_critical("error opening channel: %s", strerror(errno));
> + exit(EXIT_FAILURE);
> + }
> + if (ioctl(fd, I_SETSIG, S_OUTPUT | S_INPUT | S_HIPRI) < 0) {
> + g_critical("error with setsig on channel: %s", strerror(errno));
> + exit(EXIT_FAILURE);
> + }
> +#else
> int fd = qemu_open(path, O_RDWR | O_NONBLOCK | O_ASYNC);
> +#endif
> if (fd == -1) {
> g_critical("error opening channel: %s", strerror(errno));
> exit(EXIT_FAILURE);
Reviewed-by: Paolo Bonzini <address@hidden>
Paolo
- Re: [Qemu-devel] [PATCH 2/4] Enable sigbus_reraise for Solaris, (continued)
Re: [Qemu-devel] [PATCH 2/4] Enable sigbus_reraise for Solaris, Jan Kiszka, 2012/03/27
[Qemu-devel] [PATCH 3/4] Enable qemu-timer dynticks for Solaris, Lee Essen, 2012/03/24
[Qemu-devel] [PATCH 4/4] qga/channel-posix: provide Solaris alternative to O_ASYNC, Lee Essen, 2012/03/24
- Re: [Qemu-devel] [PATCH 4/4] qga/channel-posix: provide Solaris alternative to O_ASYNC,
Paolo Bonzini <=
Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Stefan Hajnoczi, 2012/03/27
- Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Andreas Färber, 2012/03/27
- Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Lee Essen, 2012/03/27
- Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Stefan Hajnoczi, 2012/03/27
- Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Andreas Färber, 2012/03/27
- Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Blue Swirl, 2012/03/27
- Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Andreas Färber, 2012/03/28
- Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Andreas Färber, 2012/03/28
Re: [Qemu-devel] [PATCH 1/4] Add socket/xnet libs to configure for Solaris, Andreas Färber, 2012/03/27