qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Unidirectional pipe support


From: Ed Swierk
Subject: [Qemu-devel] Unidirectional pipe support
Date: Wed, 13 Dec 2006 10:39:45 -0800

qemu allows redirecting the monitor to a named pipe (fifo): if you
specify "-monitor pipe:/my/fifo", it opens "/my/fifo" and uses it for
communication in both directions.

Unfortunately pipes are unidirectional on Linux. The pipe(7) man page
says: "Portability notes: On some systems (but not Linux), pipes are
bidirectional: data can be transmitted in both directions between the
pipe ends. According to POSIX.1-2001, pipes only need to be
unidirectional. Portable applications should avoid reliance on
bidirectional pipe semantics."

When qemu writes into the pipe, it immediately reads back what it just
wrote and treats it as a monitor command, endlessly breathing its own
exhaust.

The attached patch changes qemu to first try opening a pair of pipes,
"/my/fifo.in" and "/my/fifo.out",  and uses each to communicate in a
single direction. If either file cannot be opened, it reverts to the
current behavior, using "/my/fifo" bidirectionally.

--Ed

Attachment: qemu-pipe-pair.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]