From nobody Fri Mar 29 14:53:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152344577507739.387197589533; Wed, 11 Apr 2018 04:22:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F5153130F82; Wed, 11 Apr 2018 11:22:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89CC5662CE; Wed, 11 Apr 2018 11:22:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 78B57180596F; Wed, 11 Apr 2018 11:22:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3BBMnvK027598 for ; Wed, 11 Apr 2018 07:22:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 632038883C; Wed, 11 Apr 2018 11:22:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D0888884F for ; Wed, 11 Apr 2018 11:22:43 +0000 (UTC) Received: from mail1.bemta5.messagelabs.com (mail1.bemta5.messagelabs.com [195.245.231.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B479C03D466 for ; Wed, 11 Apr 2018 11:22:40 +0000 (UTC) Received: from [85.158.136.83] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-3.bemta-5.messagelabs.com id 5E/0D-17131-FFFEDCA5; Wed, 11 Apr 2018 11:22:39 +0000 Received: (qmail 17901 invoked from network); 11 Apr 2018 11:22:38 -0000 Received: from unknown (HELO mailhost3.uk.fujitsu.com) (62.60.8.84) by server-11.tower-36.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 11 Apr 2018 11:22:38 -0000 Received: from abgdgate60u.abg.fsc.net ([172.25.138.90]) by mailhost3.uk.fujitsu.com (8.14.5/8.14.5) with ESMTP id w3BBMcYo005002 for ; Wed, 11 Apr 2018 12:22:38 +0100 Received: from abg4858n-lnx.abg.fsc.net (HELO abg4858n-lnx.CSOD.local) ([172.26.71.109]) by abgdgate60u.abg.fsc.net with ESMTP; 11 Apr 2018 13:22:38 +0200 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRWlGSWpSXmKPExsViZ8MRovvv/dk og5N39SxWLbvO6sDo8X7fVbYAxijWzLyk/IoE1ozD886wFKx7yFhx//gC1gbGSWcYuxi5OIQE DjJKHN10iKmLkRPImcMosX+KWBcjBwebgJnEt/WFIGERASmJRfcWMIOEmQVMJJ6u9gMJCwuYS jzZf5cNJMwioCrx6I8FSJhXwFmi6+h0NhBbQkBe4tn0eewTGDkXMDKsYlQvTi0qSy3StdRLKs pMzyjJTczM0TU0MNXLTS0uTkxPzUlMKtZLzs/dxAj0FQMQ7GBc2+p8iFGSg0lJlHeex9koIb6 k/JTKjMTijPii0pzU4kOMMhwcShK8m98B5QSLUtNTK9Iyc4BBA5OW4OBREuHNAUnzFhck5hZn pkOkTjEac0xb1tPDzPHgC5AUYsnLz0uVEuc9B1IqAFKaUZoHNwgWzJcYZaWEeRmBThPiKUgty s0sQZV/xSjOwagkzFsLMoUnM68Ebt8roFOYgE455nMG5JSSRISUVAOj2oonFcdm5voZ/PA4d4 13dkkxsxlLLsuPcg/dbex3ua5/v+GfzP36zRql6G/xt+8y/HavkJxz4tKCU+Ef8/6yG/oXOsQ uUpx1dWeU8NaCxr95uRLdzYqhqgsrzGR3fpf6tf75ZbGXTCyT2RrLnIK+7GG6tG3l9o6k8wdb xRbkLy74uG1jd0eWEktxRqKhFnNRcSIAxFt4jmECAAA= X-Env-Sender: thilo.cestonaro@ts.fujitsu.com X-Msg-Ref: server-11.tower-36.messagelabs.com!1523445758!111969433!1 X-Originating-IP: [62.60.8.84] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.9.15; banners=-,-,- X-VirusChecked: Checked From: Thilo Cestonaro To: libvir-list@redhat.com Date: Wed, 11 Apr 2018 13:22:37 +0200 Message-Id: <20180411112237.30201-1-thilo.cestonaro@ts.fujitsu.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 11 Apr 2018 11:22:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 11 Apr 2018 11:22:41 +0000 (UTC) for IP:'195.245.231.139' DOMAIN:'mail1.bemta5.messagelabs.com' HELO:'mail1.bemta5.messagelabs.com' FROM:'thilo.cestonaro@ts.fujitsu.com' RCPT:'' X-RedHat-Spam-Score: -0.013 (RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS) 195.245.231.139 mail1.bemta5.messagelabs.com 195.245.231.139 mail1.bemta5.messagelabs.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Thilo Cestonaro Subject: [libvirt] [PATCH] qemu: use target.port for isa-serial X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 11 Apr 2018 11:22:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" A configured target.port is currently totaly ignored, while constructing qemu commandline, for all types of serial devices. This patch adds a -device parameter "index" for the target model isa-serial. This enables the user to specify which serial device will end in which ttySX device. Updated test results which failed because of this change. Added two tests serial-dev-without-target-port, serial-dev-with-target-port which test generating qemu command with multiple serial devices and differe= nt ports. Signed-off-by: Thilo Cestonaro --- v2: added tests which create qemu commandline with and without specified ta= rget ports. Updated existing tests to pass again. src/qemu/qemu_command.c | 16 ++++++++ tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-chardev.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- tests/qemuxml2argvdata/serial-dev-chardev.xml | 4 +- .../serial-dev-with-target-port.args | 31 +++++++++++++++ .../serial-dev-with-target-port.xml | 38 +++++++++++++++++++ .../serial-dev-without-target-port.args | 31 +++++++++++++++ .../serial-dev-without-target-port.xml | 35 +++++++++++++++++ .../qemuxml2argvdata/serial-file-chardev.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 2 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- tests/qemuxml2argvtest.c | 8 +++- 31 files changed, 191 insertions(+), 34 deletions(-) create mode 100644 tests/qemuxml2argvdata/serial-dev-with-target-port.args create mode 100644 tests/qemuxml2argvdata/serial-dev-with-target-port.xml create mode 100644 tests/qemuxml2argvdata/serial-dev-without-target-port.a= rgs create mode 100644 tests/qemuxml2argvdata/serial-dev-without-target-port.x= ml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 514c3ab2e..5f770404b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10291,6 +10291,22 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, virDomainChrSerialTargetModelTypeToString(serial->ta= rgetModel), serial->info.alias, serial->info.alias); =20 + switch ((virDomainChrSerialTargetModel) serial->targetModel) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + if (serial->target.port !=3D -1) + virBufferAsprintf(&cmd, ",index=3D%d", serial->target.port); + break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; + } + if (qemuBuildDeviceAddressStr(&cmd, def, &serial->info, qemuCaps) < 0) goto error; =20 diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios= .args index 048d4ff96..81e4a8ba7 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -24,6 +24,6 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxm= l2argvdata/console-compat-auto.args index cab47dbb5..3b048c721 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -22,5 +22,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qem= uxml2argvdata/console-compat-chardev.args index ff7678ebc..61f5712bd 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2arg= vdata/console-compat.args index fb96946f1..674c92696 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -22,4 +22,4 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxm= l2argvdata/console-virtio-many.args index 58a8a1fa0..f050cbb25 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -24,7 +24,7 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev pty,id=3Dcharconsole1 \ -device virtconsole,chardev=3Dcharconsole1,id=3Dconsole1 \ -chardev pty,id=3Dcharconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2a= rgvdata/controller-order.args index 70a8ba9ce..0e8c10f6d 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -33,7 +33,7 @@ id=3Ddrive-ide0-1-0,media=3Dcdrom,readonly=3Don \ -chardev spicevmc,id=3Dcharsmartcard0,name=3Dsmartcard \ -device ccid-card-passthru,chardev=3Dcharsmartcard0,id=3Dsmartcard0,bus=3D= ccid0.0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev spicevmc,id=3Dcharchannel0,name=3Dvdagent \ -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,\ id=3Dchannel0,name=3Dcom.redhat.spice.0 \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qem= uxml2argvdata/q35-virt-manager-basic.args index c7dd514fe..83e6dde5f 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -38,7 +38,7 @@ id=3Dvirtio-disk0 \ -device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:9a:e6:c6= ,bus=3Dpci.1,\ addr=3D0x0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev socket,id=3Dcharchannel0,\ path=3D/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,se= rver,\ nowait \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/= qemuxml2argvdata/serial-dev-chardev-iobase.args index 3a52b9efc..c19b05a18 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0,iobase=3D0x3f8,irq= =3D0x4 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0,iobase=3D0= x3f8,irq=3D0x4 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml= 2argvdata/serial-dev-chardev.args index 55b939551..f78f51ab2 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.xml b/tests/qemuxml2= argvdata/serial-dev-chardev.xml index dffd27d06..329a0fc19 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.xml +++ b/tests/qemuxml2argvdata/serial-dev-chardev.xml @@ -23,11 +23,11 @@ - + - + diff --git a/tests/qemuxml2argvdata/serial-dev-with-target-port.args b/test= s/qemuxml2argvdata/serial-dev-with-target-port.args new file mode 100644 index 000000000..c8626bf4f --- /dev/null +++ b/tests/qemuxml2argvdata/serial-dev-with-target-port.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ +-chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D1 \ +-chardev tty,id=3Dcharserial1,path=3D/dev/ttyS1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D2 \ +-chardev tty,id=3Dcharserial2,path=3D/dev/ttyS3 \ +-device isa-serial,chardev=3Dcharserial2,id=3Dserial2,index=3D3 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ No newline at end of file diff --git a/tests/qemuxml2argvdata/serial-dev-with-target-port.xml b/tests= /qemuxml2argvdata/serial-dev-with-target-port.xml new file mode 100644 index 000000000..593ee5162 --- /dev/null +++ b/tests/qemuxml2argvdata/serial-dev-with-target-port.xml @@ -0,0 +1,38 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvdata/serial-dev-without-target-port.args b/t= ests/qemuxml2argvdata/serial-dev-without-target-port.args new file mode 100644 index 000000000..8e46260c7 --- /dev/null +++ b/tests/qemuxml2argvdata/serial-dev-without-target-port.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ +-chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ +-chardev tty,id=3Dcharserial1,path=3D/dev/ttyS1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ +-chardev tty,id=3Dcharserial2,path=3D/dev/ttyS3 \ +-device isa-serial,chardev=3Dcharserial2,id=3Dserial2,index=3D2 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ No newline at end of file diff --git a/tests/qemuxml2argvdata/serial-dev-without-target-port.xml b/te= sts/qemuxml2argvdata/serial-dev-without-target-port.xml new file mode 100644 index 000000000..c170a111a --- /dev/null +++ b/tests/qemuxml2argvdata/serial-dev-without-target-port.xml @@ -0,0 +1,35 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxm= l2argvdata/serial-file-chardev.args index 47eb0aa9b..144ef37be 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev file,id=3Dcharserial0,path=3D/tmp/serial.log,append=3Don \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2ar= gvdata/serial-file-log.args index 86f8e73e0..43a2d655b 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -23,4 +23,4 @@ server,nowait \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev file,id=3Dcharserial0,path=3D/tmp/serial.log,\ logfile=3D/var/lib/libvirt/qemu/demo-serial.log,logappend=3Doff \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxm= l2argvdata/serial-many-chardev.args index eed3d418c..e07d1e9b0 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -23,7 +23,7 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev file,id=3Dcharserial1,path=3D/tmp/serial.log \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml= 2argvdata/serial-pty-chardev.args index ff7678ebc..61f5712bd 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2a= rgvdata/serial-spiceport.args index a3981499a..9bfa0450c 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -22,7 +22,7 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev spiceport,id=3Dcharserial0,name=3Dorg.qemu.console.serial.0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ -spice port=3D5903,tls-port=3D5904,addr=3D127.0.0.1,x509-dir=3D/etc/pki/li= bvirt-spice \ -device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,bus= =3Dpci.0,\ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml= 2argvdata/serial-tcp-chardev.args index 4c427e22c..79476c772 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev socket,id=3Dcharserial0,host=3D127.0.0.1,port=3D9999 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/= qemuxml2argvdata/serial-tcp-telnet-chardev.args index 3ed08e95f..a0a4877a2 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev socket,id=3Dcharserial0,host=3D127.0.0.1,port=3D9999,telnet,serve= r,nowait \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b= /tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index bd0feb319..1b92bf4a9 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -24,7 +24,7 @@ server,nowait \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,\ localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args = b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index ab5f7e27f..0b6363698 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -24,10 +24,10 @@ server,nowait \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,\ localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -object tls-creds-x509,id=3Dobjcharserial1_tls0,dir=3D/etc/pki/libvirt-cha= rdev,\ endpoint=3Dclient,verify-peer=3Dyes \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555,\ tls-creds=3Dobjcharserial1_tls0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests= /qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index ab5f7e27f..0b6363698 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -24,10 +24,10 @@ server,nowait \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,\ localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -object tls-creds-x509,id=3Dobjcharserial1_tls0,dir=3D/etc/pki/libvirt-cha= rdev,\ endpoint=3Dclient,verify-peer=3Dyes \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555,\ tls-creds=3Dobjcharserial1_tls0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args = b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 2567abbfa..58b7eca83 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -26,7 +26,7 @@ server,nowait \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D2222,localaddr=3D127= .0.0.1,\ localport=3D1111 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -object secret,id=3Dcharserial1-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ @@ -34,5 +34,5 @@ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,form= at=3Dbase64 \ endpoint=3Dclient,verify-peer=3Dyes,passwordid=3Dcharserial1-secret0 \ -chardev socket,id=3Dcharserial1,host=3D127.0.0.1,port=3D5555,\ tls-creds=3Dobjcharserial1_tls0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml= 2argvdata/serial-udp-chardev.args index c9db110e0..a671c5ed4 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -24,7 +24,7 @@ server,nowait \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D9998,localaddr=3D127= .0.0.1,\ localport=3D9999 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev udp,id=3Dcharserial1,host=3D,port=3D9999,localaddr=3D,localport= =3D0 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxm= l2argvdata/serial-unix-chardev.args index df75e15fe..6b09e27ec 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev socket,id=3Dcharserial0,path=3D/tmp/serial.sock \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2= argvdata/serial-vc-chardev.args index 3438c8447..af4cac559 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -23,5 +23,5 @@ server,nowait \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -chardev vc,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvd= ata/user-aliases.args index ad9394710..5fa328828 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -59,9 +59,9 @@ addr=3D0xa \ -net socket,connect=3D127.0.0.1:1234,vlan=3D2,name=3Dhostua-AndAlsoClientM= ode \ -device ccid-card-emulated,backend=3Dnss-emulated,id=3Dsmartcard0,bus=3Dua= -myCCID.0 \ -chardev pty,id=3Dcharserial0 \ --device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ -chardev pty,id=3Dcharserial1 \ --device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1,index=3D1 \ -chardev socket,id=3Dcharchannel0,\ path=3D/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,= server,\ nowait \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 165137e93..ca63886a6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1306,6 +1306,12 @@ mymain(void) DO_TEST("serial-dev-chardev-iobase", QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); + DO_TEST("serial-dev-with-target-port", + QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_NODEFCONFIG); + DO_TEST("serial-dev-without-target-port", + QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-file-chardev", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_ISA_SERIAL, @@ -1318,7 +1324,7 @@ mymain(void) QEMU_CAPS_NODEFCONFIG); DO_TEST("serial-udp-chardev", QEMU_CAPS_DEVICE_ISA_SERIAL, - QEMU_CAPS_NODEFCONFIG); + QEMU_CAPS_NODEFCONFIG); =20 DO_TEST("serial-tcp-telnet-chardev", QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_NODEFCONFIG); --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list