From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCXqS-0008Rr-Et for qemu-devel@nongnu.org; Tue, 27 Mar 2012 10:58:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCXqM-0006W1-1T for qemu-devel@nongnu.org; Tue, 27 Mar 2012 10:58:00 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:50210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCXqL-0006U4-PV for qemu-devel@nongnu.org; Tue, 27 Mar 2012 10:57:53 -0400 Received: by ggnp2 with SMTP id p2so1491918ggn.4 for ; Tue, 27 Mar 2012 07:57:51 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4F71D530.30302@redhat.com> Date: Tue, 27 Mar 2012 16:56:48 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1332606390-3605-1-git-send-email-lee.essen@nowonline.co.uk> <1332606390-3605-4-git-send-email-lee.essen@nowonline.co.uk> In-Reply-To: <1332606390-3605-4-git-send-email-lee.essen@nowonline.co.uk> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/4] qga/channel-posix: provide Solaris alternative to O_ASYNC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lee Essen Cc: Blue Swirl , =?ISO-8859-15?Q?Andreas_F=E4rber?= , qemu-devel@nongnu.org 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 > --- > 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 > +#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 Paolo