@@ -138,12 +138,14 @@ static void qemu_chr_open_pipe(Chardev *chr,
if (fd_in < 0 || fd_out < 0) {
if (fd_in >= 0) {
close(fd_in);
+ fd_in = -1;
}
if (fd_out >= 0) {
close(fd_out);
+ fd_out = -1;
}
- TFR(fd_in = fd_out = qemu_open_old(filename, O_RDWR | O_BINARY));
- if (fd_in < 0) {
+ TFR(fd_out = qemu_open_old(filename, O_WRONLY | O_BINARY));
+ if (fd_out < 0) {
error_setg_file_open(errp, errno, filename);
return;
}
@@ -3514,18 +3514,21 @@ The available backends are:
``path`` is required.
``-chardev pipe,id=id,path=path``
- Create a two-way connection to the guest. The behaviour differs
+ Create a one-way or two-way stream. The behaviour differs
slightly between Windows hosts and other hosts:
- On Windows, a single duplex pipe will be created at
+ On Windows, a full duplex pipe will be created at
``\\.pipe\path``.
- On other hosts, 2 pipes will be created called ``path.in`` and
+ On other hosts, 2 paths will be opened called ``path.in`` and
``path.out``. Data written to ``path.in`` will be received by the
- guest. Data written by the guest can be read from ``path.out``. QEMU
- will not create these fifos, and requires them to be present.
+ guest. Data written by the guest can be read from ``path.out``.
+ QEMU will not create these fifos, and requires them to be present.
- ``path`` forms part of the pipe path as described above. ``path`` is
+ If ``path.in`` or ``path.out`` are missing, QEMU will open
+ ``path`` for an output-only stream.
+
+ ``path`` forms part of the paths as described above. ``path`` is
required.
``-chardev console,id=id``