mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
qemu-ga: Implement alternative to O_ASYNC
ga_channel_open() was using open flag O_ASYNC for SIGIO-driven I/O. This breaks on illumos, so fall back to POSIX I_SETSIG ioctl (SIGPOLL). Signed-off-by: Lee Essen <lee.essen@nowonline.co.uk> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
3239ad0469
commit
e61ab1da7e
1 changed files with 17 additions and 1 deletions
|
@ -3,6 +3,10 @@
|
||||||
#include "qemu_socket.h"
|
#include "qemu_socket.h"
|
||||||
#include "qga/channel.h"
|
#include "qga/channel.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_SOLARIS
|
||||||
|
#include <stropts.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GA_CHANNEL_BAUDRATE_DEFAULT B38400 /* for isa-serial channels */
|
#define GA_CHANNEL_BAUDRATE_DEFAULT B38400 /* for isa-serial channels */
|
||||||
|
|
||||||
struct GAChannel {
|
struct GAChannel {
|
||||||
|
@ -123,11 +127,23 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod
|
||||||
|
|
||||||
switch (c->method) {
|
switch (c->method) {
|
||||||
case GA_CHANNEL_VIRTIO_SERIAL: {
|
case GA_CHANNEL_VIRTIO_SERIAL: {
|
||||||
int fd = qemu_open(path, O_RDWR | O_NONBLOCK | O_ASYNC);
|
int fd = qemu_open(path, O_RDWR | O_NONBLOCK
|
||||||
|
#ifndef CONFIG_SOLARIS
|
||||||
|
| O_ASYNC
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
g_critical("error opening channel: %s", strerror(errno));
|
g_critical("error opening channel: %s", strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
#ifdef CONFIG_SOLARIS
|
||||||
|
ret = ioctl(fd, I_SETSIG, S_OUTPUT | S_INPUT | S_HIPRI);
|
||||||
|
if (ret == -1) {
|
||||||
|
g_critical("error setting event mask for channel: %s",
|
||||||
|
strerror(errno));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
ret = ga_channel_client_add(c, fd);
|
ret = ga_channel_client_add(c, fd);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
g_critical("error adding channel to main loop");
|
g_critical("error adding channel to main loop");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue