[libvirt] [PATCH] qemu: fix virtual serial/parallel ports via unix/tcp

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

 



Hi,
as to my understanding we should pass 'server' instead of 'listen' to
forward virtual serial ports via unix domain sockets or tcp. See:
 http://bellard.org/qemu/qemu-doc.html

I also added nowait to tcp,unix and telnet since otherwise qemu/kvm
would wait for a connection before proceeding which breaks vm startup. I
wonder why nowait wasn't added with:
 0138ff79f26a5fdaae9b13d6345a84817a144e06
though.

Possible patch attached.
 -- Guido
>From 42eab29bff9ad8da3c7e7de72cf9d53e67782109 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx@xxxxxxxxxxx>
Date: Thu, 11 Dec 2008 12:02:50 +0100
Subject: [PATCH] qemu: fix parallel/serial mode "tcp" and "unix"

According to
 http://bellard.org/qemu/qemu-doc.html
the required option is 'server' not 'listen'. Use nowait so kvm/qemu doesn't
timeout during monitor startup as it waits for an incoming connection.
---
 src/qemu_conf.c                                    |    6 +++---
 .../qemuxml2argv-parallel-tcp.args                 |    2 +-
 .../qemuxml2argv-serial-tcp-telnet.args            |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index e6c378f..e890480 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -676,13 +676,13 @@ static int qemudBuildCommandLineChrDevStr(virDomainChrDefPtr dev,
             if (snprintf(buf, buflen, "telnet:%s:%s%s",
                          dev->data.tcp.host,
                          dev->data.tcp.service,
-                         dev->data.tcp.listen ? ",server" : "") >= buflen)
+                         dev->data.tcp.listen ? ",server,nowait" : "") >= buflen)
                 return -1;
         } else {
             if (snprintf(buf, buflen, "tcp:%s:%s%s",
                          dev->data.tcp.host,
                          dev->data.tcp.service,
-                         dev->data.tcp.listen ? ",listen" : "") >= buflen)
+                         dev->data.tcp.listen ? ",server,nowait" : "") >= buflen)
                 return -1;
         }
         break;
@@ -690,7 +690,7 @@ static int qemudBuildCommandLineChrDevStr(virDomainChrDefPtr dev,
     case VIR_DOMAIN_CHR_TYPE_UNIX:
         if (snprintf(buf, buflen, "unix:%s%s",
                      dev->data.nix.path,
-                     dev->data.nix.listen ? ",listen" : "") >= buflen)
+                     dev->data.nix.listen ? ",server,nowait" : "") >= buflen)
             return -1;
         break;
     }
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
index 1a08bbb..e9bbc71 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
@@ -1 +1 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel tcp:127.0.0.1:9999,listen -usb
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel tcp:127.0.0.1:9999,server,nowait -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
index f2d1f17..ad37de4 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
@@ -1 +1 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial telnet:127.0.0.1:9999,server -parallel none -usb
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial telnet:127.0.0.1:9999,server,nowait -parallel none -usb
-- 
1.6.0.2

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]