From patchwork Sat Mar 24 16:26:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Essen X-Patchwork-Id: 148513 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3AF23B6EEF for ; Sun, 25 Mar 2012 03:27:05 +1100 (EST) Received: from localhost ([::1]:55213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBTnz-0006KY-0Q for incoming@patchwork.ozlabs.org; Sat, 24 Mar 2012 12:27:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBTnc-0006Ew-GX for qemu-devel@nongnu.org; Sat, 24 Mar 2012 12:26:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBTnV-0000YA-CB for qemu-devel@nongnu.org; Sat, 24 Mar 2012 12:26:40 -0400 Received: from 204.146.238.178.in-addr.arpa ([178.238.146.204]:50238 helo=mail.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBTnV-0000Xd-5D for qemu-devel@nongnu.org; Sat, 24 Mar 2012 12:26:33 -0400 Received: from soldev64.local (209.146.238.178.in-addr.arpa [178.238.146.209]) by mail.local (Postfix) with ESMTP id 803974E59; Sat, 24 Mar 2012 16:26:30 +0000 (UTC) From: Lee Essen To: qemu-devel@nongnu.org Date: Sat, 24 Mar 2012 16:26:30 +0000 Message-Id: <1332606390-3605-4-git-send-email-lee.essen@nowonline.co.uk> X-Mailer: git-send-email 1.7.6.3 In-Reply-To: <1332606390-3605-1-git-send-email-lee.essen@nowonline.co.uk> References: <1332606390-3605-1-git-send-email-lee.essen@nowonline.co.uk> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 178.238.146.204 Cc: Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 4/4] qga/channel-posix: provide Solaris alternative to O_ASYNC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Paolo Bonzini --- 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);