[RFC 0/1] qemu: update index for serial device using taget.port

Issue ----- The port being provided in the xml file of the domain is not being used for the creation of qemu command. On adding the serial device : <serial> <target type='serial' port='3'/> </serial> Generated qemu command will look like : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0 Actually it should be : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0,index=3 Patch ----- Out already for the correction : https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html This patch was not followed up. According to me there are multiple reasons Reasons for not following up ---------------------------- Index : specifies the index number of a connector port. If not specified, the index is automatically incremented. This logic exists both on qemu as well as libvirt. https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62 Issue 1: If we want two isa-serial devices and for the first one is we mention the port to be 3, then for the next device it not automatically assign the port number 4 which will throw the following error : error: internal error: process exited while connecting to monitor: 2021-11-12T11:05:31.169987Z qemu-kvm: -device isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA serial ports is 4. But we are left with 3 ports (0,1,2) which are unused. So ideally we should have used them. Issue 2: It is possible that two devices get the same port address which might lead to a lot of ambiguity. Example: we want two devices and for the second one we provide the index 0. Then from default logic the first device will be allotted port 0 and the second device will overwrite it and get port 0. Solution : ---------- Port allocation logic 1. Precedence should be given to serial devices as we only have the first 4 ports for them. 1.1. Check the command line/xml file, scan for all the devices mentioned and then start with the isa-serial devices for port allocation. 2.Maintain a buffer(bitmap) for marking the allocated ports. 3.While assigning a port to the device 3.1. If no port is provided by the user : provide the next available port. 3.2. Else check: 3.2.1. If the port is already allocated : throw the error. 3.2.2. Else allocate the port. 3.3. If out of ports : throw error -> qemu throws the error. Libvirt manages the port numbers with the similar logic(auto increment) along with the above mentioned bug. Hence need to add the above patch along with the Port allocation logic. root (1): update index for serial device using taget.port src/conf/domain_conf.c | 70 +++++++++++++++++-- src/qemu/qemu_command.c | 20 ++++-- tests/qemuhotplugtest.c | 1 - ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- tests/qemuxml2argvdata/name-escape.xml | 1 + .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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 | 8 ++- .../serial-tcp-tlsx509-chardev-notls.xml | 18 ++++- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 43 files changed, 149 insertions(+), 65 deletions(-) -- 2.27.0

From: root <root@localhost.localdomain> --- src/conf/domain_conf.c | 70 +++++++++++++++++-- src/qemu/qemu_command.c | 20 ++++-- tests/qemuhotplugtest.c | 1 - ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- tests/qemuxml2argvdata/name-escape.xml | 1 + .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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 | 8 ++- .../serial-tcp-tlsx509-chardev-notls.xml | 18 ++++- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 43 files changed, 149 insertions(+), 65 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5cfb2d91eb..edc5e897be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -65,6 +65,7 @@ #include "virutil.h" #define VIR_FROM_THIS VIR_FROM_DOMAIN +#define max_available_isa_serial_ports 4 VIR_LOG_INIT("conf.domain_conf"); @@ -19649,6 +19650,10 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *nodes = NULL; g_autofree char *tmp = NULL; g_autoptr(virDomainDef) def = NULL; + uint8_t used_serial_port_buffer = 0; + int isa_serial_count = 0; + int next_available_serial_port = 0; + int max_serial_port = -1; if (!(def = virDomainDefNew(xmlopt))) return NULL; @@ -19886,16 +19891,67 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; - if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; + def->serials[def->nserials++] = chr; + + // Giving precedence to the isa-serial device since + // only limited ports can be used for such devices. + if (chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + // Taking the isa serial devices to start of the array. + for (j = def->nserials; j > isa_serial_count; j--) + def->serials[j] = def->serials[j-1]; + def->serials[isa_serial_count++] = chr; + } + + // Maintaining the buffer for first max_available_isa_serial_ports unused ports. + if (chr->target.port != -1 && chr->target.port <= max_available_isa_serial_ports) { + if (used_serial_port_buffer & (1 << chr->target.port)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), + chr->target.port); + return NULL; } - chr->target.port = maxport + 1; + used_serial_port_buffer |= 1 << chr->target.port; + } + + // Update max serial port used. + if (chr->target.port > max_serial_port) + max_serial_port = chr->target.port; + } + + // Assign the ports to the devices. + for (i = 0; i < n; i++) { + if (def->serials[i]->target.port != -1) continue; + // Assign one of the unused ports from first max_available_isa_serial_ports ports + // to isa-serial device. + if (def->serials[i]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + + // Search for the next available port. + while (used_serial_port_buffer & (1 << next_available_serial_port) && + next_available_serial_port <= max_available_isa_serial_ports) { + next_available_serial_port++; + } + + // qemu doesn't support more than max_available_isa_serial_ports isa devices. + if (i > max_available_isa_serial_ports || + next_available_serial_port > max_available_isa_serial_ports) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), + max_available_isa_serial_ports); + return NULL; + } + + used_serial_port_buffer |= 1 << next_available_serial_port; + def->serials[i]->target.port = next_available_serial_port; + + // Update max serial port used. + if (def->serials[i]->target.port > max_serial_port) + max_serial_port = def->serials[i]->target.port; + + } else { + def->serials[i]->target.port = ++max_serial_port; } - def->serials[def->nserials++] = chr; } + VIR_FREE(nodes); if ((n = virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0) { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7a185061d8..c8f8a27f30 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10947,11 +10947,21 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; } - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL && + serial->target.port != -1) { + if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "i:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL; if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 263a92425c..88c9ea0339 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -355,7 +355,6 @@ testQemuHotplug(const void *data) if (keep) { test->vm = vm; } else { - virObjectUnref(vm); test->vm = NULL; } virDomainDeviceDefFree(dev); diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.xml b/tests/qemuxml2argvdata/name-escape.xml index 6aefac19b2..e2de9aeb10 100644 --- a/tests/qemuxml2argvdata/name-escape.xml +++ b/tests/qemuxml2argvdata/name-escape.xml @@ -43,6 +43,7 @@ </graphics> <serial type='dev'> <source path='/dev/ttyS2,foo'/> + <target/> </serial> <serial type='file'> <source path='/tmp/serial.log,foo' append='on'/> diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..c2e23e5bc7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,12 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=2 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ +-chardev socket,id=charserial2,host=127.0.0.1,port=5555 \ +-device isa-serial,chardev=charserial2,id=serial2,index=1 \ +-chardev socket,id=charserial3,host=127.0.0.1,port=5555 \ +-device isa-serial,chardev=charserial3,id=serial3,index=3 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..73ed3e9712 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -30,7 +30,7 @@ <serial type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> <source mode='connect' host='127.0.0.1' service='2222'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> </serial> @@ -41,10 +41,24 @@ <model name='isa-serial'/> </target> </serial> + <serial type='tcp'> + <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> + <protocol type='raw'/> + <target type='isa-serial' port='1'> + <model name='isa-serial'/> + </target> + </serial> + <serial type='tcp'> + <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> + <protocol type='raw'/> + <target type='isa-serial' port='3'> + <model name='isa-serial'/> + </target> + </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> <source mode='connect' host='127.0.0.1' service='2222'/> - <target type='serial' port='0'/> + <target type='serial' port='2'/> </console> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> -- 2.27.0

On Wed, Nov 24, 2021 at 07:06:06 -0500, divya wrote: Hi, just a few quick points, I'm not going to analyze what this does too deeply at this point.
From: root <root@localhost.localdomain>
Author should be set properly. Also we require a proper commit message explaining the issue. Additionally we require that the submitter declares conformance with the developer certificate of origin: https://www.libvirt.org/hacking.html#developer-certificate-of-origin
---
[...]
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5cfb2d91eb..edc5e897be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -65,6 +65,7 @@ #include "virutil.h"
#define VIR_FROM_THIS VIR_FROM_DOMAIN
Firstly I see many problems with coding style:
+#define max_available_isa_serial_ports 4
We usually use uppercase macros
VIR_LOG_INIT("conf.domain_conf");
@@ -19649,6 +19650,10 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *nodes = NULL; g_autofree char *tmp = NULL; g_autoptr(virDomainDef) def = NULL; + uint8_t used_serial_port_buffer = 0;
We have virBitmap for such things.
+ int isa_serial_count = 0; + int next_available_serial_port = 0; + int max_serial_port = -1;
if (!(def = virDomainDefNew(xmlopt))) return NULL; @@ -19886,16 +19891,67 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; + def->serials[def->nserials++] = chr; + + // Giving precedence to the isa-serial device since + // only limited ports can be used for such devices.
We don't use line comments (//) but block comments everywhere /* */
+ if (chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + // Taking the isa serial devices to start of the array. + for (j = def->nserials; j > isa_serial_count; j--) + def->serials[j] = def->serials[j-1]; + def->serials[isa_serial_count++] = chr; + } + + // Maintaining the buffer for first max_available_isa_serial_ports unused ports. + if (chr->target.port != -1 && chr->target.port <= max_available_isa_serial_ports) { + if (used_serial_port_buffer & (1 << chr->target.port)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), + chr->target.port);
This is misaligned.
+ return NULL; } - chr->target.port = maxport + 1; + used_serial_port_buffer |= 1 << chr->target.port; + } + + // Update max serial port used. + if (chr->target.port > max_serial_port) + max_serial_port = chr->target.port; + } + + // Assign the ports to the devices. + for (i = 0; i < n; i++) { + if (def->serials[i]->target.port != -1) continue; + // Assign one of the unused ports from first max_available_isa_serial_ports ports + // to isa-serial device. + if (def->serials[i]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + + // Search for the next available port. + while (used_serial_port_buffer & (1 << next_available_serial_port) && + next_available_serial_port <= max_available_isa_serial_ports) { + next_available_serial_port++; + } + + // qemu doesn't support more than max_available_isa_serial_ports isa devices. + if (i > max_available_isa_serial_ports || + next_available_serial_port > max_available_isa_serial_ports) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), + max_available_isa_serial_ports); + return NULL; + } + + used_serial_port_buffer |= 1 << next_available_serial_port; + def->serials[i]->target.port = next_available_serial_port; + + // Update max serial port used. + if (def->serials[i]->target.port > max_serial_port) + max_serial_port = def->serials[i]->target.port; + + } else { + def->serials[i]->target.port = ++max_serial_port; } - def->serials[def->nserials++] = chr; }
In general, none of this code should be in the parser itself. Not even the existing code which you are changing actually. We have code which is meant to adjust and fill defaults for devices. For your case virDomainChrDefPostParse or virDomainDefPostParseCommon might be the right place. Note that until now the assignment code was rather trivial, but you are adding a massive amount of logic to this so it definitely doesn't belong to the parser any more.
+ VIR_FREE(nodes);
if ((n = virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0) { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7a185061d8..c8f8a27f30 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10947,11 +10947,21 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL && + serial->target.port != -1) { + if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "i:index", serial->target.port,
You can use "k:index" which conditionally adds the 'index' field only when it's 0 or positive ...
+ NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0)
... so that you don't have to have this else branch here. Also all of this new code seems to be badly misalligned.
return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 263a92425c..88c9ea0339 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -355,7 +355,6 @@ testQemuHotplug(const void *data) if (keep) { test->vm = vm; } else { - virObjectUnref(vm); test->vm = NULL; } virDomainDeviceDefFree(dev);
This is a very questionable hunk. Was this just for testing?

Hi Peter, This code was just for test and reference. I primarily wanted to get review on RFC. I have sent the cover letter explaining the issues as well as the change. This patch is still in testing phase. Before moving forward I wanted to confirm if my changes and the logic for port allocation looks good and get some history behind the earlier logic. Attaching the doc explaining the issue and change just for reference. PFA Thanks Regards Divya Garg From: Peter Krempa <pkrempa@redhat.com> Date: Wednesday, 24 November 2021 at 6:22 PM To: Divya Garg <divya.garg@nutanix.com> Cc: libvir-list@redhat.com <libvir-list@redhat.com>, Manish Mishra <manish.mishra@nutanix.com>, Prerna Saxena <prerna.saxena@nutanix.com> Subject: Re: [RFC 1/1] update index for serial device using taget.port On Wed, Nov 24, 2021 at 07:06:06 -0500, divya wrote: Hi, just a few quick points, I'm not going to analyze what this does too deeply at this point.
From: root <root@localhost.localdomain>
Author should be set properly. Also we require a proper commit message explaining the issue. Additionally we require that the submitter declares conformance with the developer certificate of origin: https://urldefense.proofpoint.com/v2/url?u=https-3A__www.libvirt.org_hacking.html-23developer-2Dcertificate-2Dof-2Dorigin&d=DwIBAg&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=IUWwXppAjhBSqGVOlRTyZ70mhLrTUeeQA692o-Q942j1SPk8i8nrvQPV9KtRHOwl&s=23RVgvzwCkcam2r_OcJ3920vDnxkmIm4tY15Bb4LdFY&e=
---
[...]
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5cfb2d91eb..edc5e897be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -65,6 +65,7 @@ #include "virutil.h"
#define VIR_FROM_THIS VIR_FROM_DOMAIN
Firstly I see many problems with coding style:
+#define max_available_isa_serial_ports 4
We usually use uppercase macros
VIR_LOG_INIT("conf.domain_conf");
@@ -19649,6 +19650,10 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *nodes = NULL; g_autofree char *tmp = NULL; g_autoptr(virDomainDef) def = NULL; + uint8_t used_serial_port_buffer = 0;
We have virBitmap for such things.
+ int isa_serial_count = 0; + int next_available_serial_port = 0; + int max_serial_port = -1;
if (!(def = virDomainDefNew(xmlopt))) return NULL; @@ -19886,16 +19891,67 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; + def->serials[def->nserials++] = chr; + + // Giving precedence to the isa-serial device since + // only limited ports can be used for such devices.
We don't use line comments (//) but block comments everywhere /* */
+ if (chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + // Taking the isa serial devices to start of the array. + for (j = def->nserials; j > isa_serial_count; j--) + def->serials[j] = def->serials[j-1]; + def->serials[isa_serial_count++] = chr; + } + + // Maintaining the buffer for first max_available_isa_serial_ports unused ports. + if (chr->target.port != -1 && chr->target.port <= max_available_isa_serial_ports) { + if (used_serial_port_buffer & (1 << chr->target.port)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), + chr->target.port);
This is misaligned.
+ return NULL; } - chr->target.port = maxport + 1; + used_serial_port_buffer |= 1 << chr->target.port; + } + + // Update max serial port used. + if (chr->target.port > max_serial_port) + max_serial_port = chr->target.port; + } + + // Assign the ports to the devices. + for (i = 0; i < n; i++) { + if (def->serials[i]->target.port != -1) continue; + // Assign one of the unused ports from first max_available_isa_serial_ports ports + // to isa-serial device. + if (def->serials[i]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + + // Search for the next available port. + while (used_serial_port_buffer & (1 << next_available_serial_port) && + next_available_serial_port <= max_available_isa_serial_ports) { + next_available_serial_port++; + } + + // qemu doesn't support more than max_available_isa_serial_ports isa devices. + if (i > max_available_isa_serial_ports || + next_available_serial_port > max_available_isa_serial_ports) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), + max_available_isa_serial_ports); + return NULL; + } + + used_serial_port_buffer |= 1 << next_available_serial_port; + def->serials[i]->target.port = next_available_serial_port; + + // Update max serial port used. + if (def->serials[i]->target.port > max_serial_port) + max_serial_port = def->serials[i]->target.port; + + } else { + def->serials[i]->target.port = ++max_serial_port; } - def->serials[def->nserials++] = chr; }
In general, none of this code should be in the parser itself. Not even the existing code which you are changing actually. We have code which is meant to adjust and fill defaults for devices. For your case virDomainChrDefPostParse or virDomainDefPostParseCommon might be the right place. Note that until now the assignment code was rather trivial, but you are adding a massive amount of logic to this so it definitely doesn't belong to the parser any more.
+ VIR_FREE(nodes);
if ((n = virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0) { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7a185061d8..c8f8a27f30 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10947,11 +10947,21 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL && + serial->target.port != -1) { + if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "i:index", serial->target.port,
You can use "k:index" which conditionally adds the 'index' field only when it's 0 or positive ...
+ NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0)
... so that you don't have to have this else branch here. Also all of this new code seems to be badly misalligned.
return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 263a92425c..88c9ea0339 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -355,7 +355,6 @@ testQemuHotplug(const void *data) if (keep) { test->vm = vm; } else { - virObjectUnref(vm); test->vm = NULL; } virDomainDeviceDefFree(dev);
This is a very questionable hunk. Was this just for testing?

On Wed, Nov 24, 2021 at 07:06:06 -0500, divya wrote:
Hi, just a few quick points, I'm not going to analyze what this does too deeply at this point.
From: root<root@localhost.localdomain> Author should be set properly. Also we require a proper commit message explaining the issue.
Additionally we require that the submitter declares conformance with the developer certificate of origin:
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.libvirt.org_hacking.html-23developer-2Dcertificate-2Dof-2Dorigin&d=DwIBAg&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=IUWwXppAjhBSqGVOlRTyZ70mhLrTUeeQA692o-Q942j1SPk8i8nrvQPV9KtRHOwl&s=23RVgvzwCkcam2r_OcJ3920vDnxkmIm4tY15Bb4LdFY&e= This patch was just for getting the understanding of historical reasons of the
--- [...]
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5cfb2d91eb..edc5e897be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -65,6 +65,7 @@ #include "virutil.h"
#define VIR_FROM_THIS VIR_FROM_DOMAIN Firstly I see many problems with coding style: I am really sorry for that, I didnt give much attention to that. It was just to show how I will be changing the port allocation logic for isa-serial devices.
+#define max_available_isa_serial_ports 4 We usually use uppercase macros
VIR_LOG_INIT("conf.domain_conf");
@@ -19649,6 +19650,10 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *nodes = NULL; g_autofree char *tmp = NULL; g_autoptr(virDomainDef) def = NULL; + uint8_t used_serial_port_buffer = 0;
We have virBitmap for such things. Noted. Thanks.
+ int isa_serial_count = 0; + int next_available_serial_port = 0; + int max_serial_port = -1;
if (!(def = virDomainDefNew(xmlopt))) return NULL; @@ -19886,16 +19891,67 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; + def->serials[def->nserials++] = chr; + + // Giving precedence to the isa-serial device since + // only limited ports can be used for such devices. We don't use line comments (//) but block comments everywhere /* */ Noted
+ if (chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + // Taking the isa serial devices to start of the array. + for (j = def->nserials; j > isa_serial_count; j--) + def->serials[j] = def->serials[j-1]; + def->serials[isa_serial_count++] = chr; + } + + // Maintaining the buffer for first max_available_isa_serial_ports unused ports. + if (chr->target.port != -1 && chr->target.port <= max_available_isa_serial_ports) { + if (used_serial_port_buffer & (1 << chr->target.port)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), + chr->target.port); This is misaligned. Noted
+ return NULL; } - chr->target.port = maxport + 1; + used_serial_port_buffer |= 1 << chr->target.port; + } + + // Update max serial port used. + if (chr->target.port > max_serial_port) + max_serial_port = chr->target.port; + } + + // Assign the ports to the devices. + for (i = 0; i < n; i++) { + if (def->serials[i]->target.port != -1) continue; + // Assign one of the unused ports from first max_available_isa_serial_ports ports + // to isa-serial device. + if (def->serials[i]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + + // Search for the next available port. + while (used_serial_port_buffer & (1 << next_available_serial_port) && + next_available_serial_port <= max_available_isa_serial_ports) { + next_available_serial_port++; + } + + // qemu doesn't support more than max_available_isa_serial_ports isa devices. + if (i > max_available_isa_serial_ports || + next_available_serial_port > max_available_isa_serial_ports) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), + max_available_isa_serial_ports); + return NULL; + } + + used_serial_port_buffer |= 1 << next_available_serial_port; + def->serials[i]->target.port = next_available_serial_port; + + // Update max serial port used. + if (def->serials[i]->target.port > max_serial_port) + max_serial_port = def->serials[i]->target.port; + + } else { + def->serials[i]->target.port = ++max_serial_port; } - def->serials[def->nserials++] = chr; } In general, none of this code should be in the parser itself. Not even the existing code which you are changing actually.
We have code which is meant to adjust and fill defaults for devices. For your case virDomainChrDefPostParse or virDomainDefPostParseCommon might be the right place.
Note that until now the assignment code was rather trivial, but you are adding a massive amount of logic to this so it definitely doesn't belong to the parser any more. Earlier we never checked for repeated ports or the max port that can be assigned to a particular design. Besides we used to assign the ports blindly without considering what kind of device it is. Was there any specefic reason for this ?
+ VIR_FREE(nodes);
if ((n = virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0) { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7a185061d8..c8f8a27f30 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10947,11 +10947,21 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL && + serial->target.port != -1) { + if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "i:index", serial->target.port, You can use "k:index" which conditionally adds the 'index' field only when it's 0 or positive ...
+ NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) ... so that you don't have to have this else branch here. Thanks, but this will be anyhow required to check if the device is ISA-serial or not.
Also all of this new code seems to be badly misalligned. Will update the allignment.
return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 263a92425c..88c9ea0339 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -355,7 +355,6 @@ testQemuHotplug(const void *data) if (keep) { test->vm = vm; } else { - virObjectUnref(vm); test->vm = NULL; } virDomainDeviceDefFree(dev);
This is a very questionable hunk. Was this just for testing? Hi Peter. This was an RFC and yeah, still not finalised. I will be working on
On 24/11/21 6:21 pm, Peter Krempa wrote: port allocation logic we process today and if the changes suggested looks good and doesn't violate any convention or if we are planning to have a different handling for such cases. formatting and restructure the code once the logic goods. Before putting more efforts in finalising the code I wanted to confirm if the changes in the port allocation logic for isa-serial devices looks good or not. Sharing the details : _*Issue*_ ----- The port being provided in the xml file of the domain is not being used for the creation of qemu command. On adding the serial device : <serial> <target type='serial' port='3'/> </serial> Generated qemu command will look like : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0 Actually it should be : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0,index=3 There is a patch out there already for the correction : https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html But This patch was not followed up. According to me there are multiple reasons _*Reasons for not following up*_ ---------------------------- ---------------------------- Index : specifies the index number of a connector port. If not specified, the index is automatically incremented. This logic exists both on qemu as well as libvirt. https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62 _*Issue 1:*_ If we want two isa-serial devices and for the first one is we mention the port to be 3, then for the next device it not automatically assign the port number 4 which will throw the following error : error: internal error: process exited while connecting to monitor: 2021-11-12T11:05:31.169987Z qemu-kvm: -device isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA serial ports is 4. But we are left with 3 ports (0,1,2) which are unused. So ideally we should have used them. _*Issue 2:*_** It is possible that two devices get the same port address which might lead to a lot of ambiguity. Example: we want two devices and for the second one we provide the index 0. Then from default logic the first device will be allotted port 0 and the second device will overwrite it and get port 0. _*Solution :*_ ---------- ---------- *_Port allocation logic_* 1. Precedence should be given to serial devices as we only have the first 4 ports for them. 1.1. Check the command line/xml file, scan for all the devices mentioned and then start with the isa-serial devices for port allocation. 2.Maintain a buffer(bitmap) for marking the allocated ports. 3.While assigning a port to the device 3.1. If no port is provided by the user : provide the next available port. 3.2. Else check: 3.2.1. If the port is already allocated : throw the error. 3.2.2. Else allocate the port. 3.3. If out of ports : throw error -> qemu throws the error. Libvirt also manages the port numbers with the auto increment logic but never updates the index value using the port number. Hence index should be assigned with proper port allocation logic.

Hi Peter ! Thankyou so much for the comments. I am really new here and really sorry for not following coding standards at the first place. Really glad that you took out the time and reviewed my patches. Will be sending out the updated patch in a day or two with all the comments addressed and code refactored. Thanks On 25/11/21 4:02 pm, Divya Garg wrote:
On 24/11/21 6:21 pm, Peter Krempa wrote:
On Wed, Nov 24, 2021 at 07:06:06 -0500, divya wrote:
Hi, just a few quick points, I'm not going to analyze what this does too deeply at this point.
From: root<root@localhost.localdomain> Author should be set properly. Also we require a proper commit message explaining the issue.
Additionally we require that the submitter declares conformance with the developer certificate of origin:
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.libvirt.org_hacking.html-23developer-2Dcertificate-2Dof-2Dorigin&d=DwIBAg&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=IUWwXppAjhBSqGVOlRTyZ70mhLrTUeeQA692o-Q942j1SPk8i8nrvQPV9KtRHOwl&s=23RVgvzwCkcam2r_OcJ3920vDnxkmIm4tY15Bb4LdFY&e= This patch was just for getting the understanding of historical reasons of the port allocation logic we process today and if the changes suggested looks good and doesn't violate any convention or if we are planning to have a different handling for such cases.
--- [...]
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5cfb2d91eb..edc5e897be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -65,6 +65,7 @@ #include "virutil.h"
#define VIR_FROM_THIS VIR_FROM_DOMAIN Firstly I see many problems with coding style: I am really sorry for that, I didnt give much attention to that. It was just to show how I will be changing the port allocation logic for isa-serial devices. +#define max_available_isa_serial_ports 4 We usually use uppercase macros
VIR_LOG_INIT("conf.domain_conf");
@@ -19649,6 +19650,10 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *nodes = NULL; g_autofree char *tmp = NULL; g_autoptr(virDomainDef) def = NULL; + uint8_t used_serial_port_buffer = 0;
+ int isa_serial_count = 0; + int next_available_serial_port = 0; + int max_serial_port = -1;
if (!(def = virDomainDefNew(xmlopt))) return NULL; @@ -19886,16 +19891,67 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; + def->serials[def->nserials++] = chr; + + // Giving precedence to the isa-serial device since + // only limited ports can be used for such devices. We don't use line comments (//) but block comments everywhere /* */ Noted + if (chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + // Taking the isa serial devices to start of the array. + for (j = def->nserials; j > isa_serial_count; j--) + def->serials[j] = def->serials[j-1]; + def->serials[isa_serial_count++] = chr; + } + + // Maintaining the buffer for first max_available_isa_serial_ports unused ports. + if (chr->target.port != -1 && chr->target.port <= max_available_isa_serial_ports) { + if (used_serial_port_buffer & (1 << chr->target.port)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), + chr->target.port); This is misaligned. Noted + return NULL; } - chr->target.port = maxport + 1; + used_serial_port_buffer |= 1 << chr->target.port; + } + + // Update max serial port used. + if (chr->target.port > max_serial_port) + max_serial_port = chr->target.port; + } + + // Assign the ports to the devices. + for (i = 0; i < n; i++) { + if (def->serials[i]->target.port != -1) continue; + // Assign one of the unused ports from first max_available_isa_serial_ports ports + // to isa-serial device. + if (def->serials[i]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + + // Search for the next available port. + while (used_serial_port_buffer & (1 << next_available_serial_port) && + next_available_serial_port <= max_available_isa_serial_ports) { + next_available_serial_port++; + } + + // qemu doesn't support more than max_available_isa_serial_ports isa devices. + if (i > max_available_isa_serial_ports || + next_available_serial_port > max_available_isa_serial_ports) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), + max_available_isa_serial_ports); + return NULL; + } + + used_serial_port_buffer |= 1 << next_available_serial_port; + def->serials[i]->target.port = next_available_serial_port; + + // Update max serial port used. + if (def->serials[i]->target.port > max_serial_port) + max_serial_port = def->serials[i]->target.port; + + } else { + def->serials[i]->target.port = ++max_serial_port; } - def->serials[def->nserials++] = chr; } In general, none of this code should be in the parser itself. Not even
We have virBitmap for such things. Noted. Thanks. the existing code which you are changing actually.
We have code which is meant to adjust and fill defaults for devices. For your case virDomainChrDefPostParse or virDomainDefPostParseCommon might be the right place.
Note that until now the assignment code was rather trivial, but you are adding a massive amount of logic to this so it definitely doesn't belong to the parser any more. Earlier we never checked for repeated ports or the max port that can be assigned to a particular design. Besides we used to assign the ports blindly without considering what kind of device it is. Was there any specefic reason for this ?
+ VIR_FREE(nodes);
if ((n = virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0) { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7a185061d8..c8f8a27f30 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10947,11 +10947,21 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL && + serial->target.port != -1) { + if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "i:index", serial->target.port, You can use "k:index" which conditionally adds the 'index' field only when it's 0 or positive ...
+ NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) ... so that you don't have to have this else branch here. Thanks, but this will be anyhow required to check if the device is ISA-serial or not. Also all of this new code seems to be badly misalligned. Will update the allignment. return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 263a92425c..88c9ea0339 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -355,7 +355,6 @@ testQemuHotplug(const void *data) if (keep) { test->vm = vm; } else { - virObjectUnref(vm); test->vm = NULL; } virDomainDeviceDefFree(dev); This is a very questionable hunk. Was this just for testing? Hi Peter. This was an RFC and yeah, still not finalised. I will be working on formatting and restructure the code once the logic goods. Before putting more efforts in finalising the code I wanted to confirm if the changes in the port allocation logic for isa-serial devices looks good or not.
Sharing the details :
_*Issue*_ ----- The port being provided in the xml file of the domain is not being used for the creation of qemu command.
On adding the serial device :
<serial> <target type='serial' port='3'/> </serial>
Generated qemu command will look like : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0
Actually it should be : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0,index=3
There is a patch out there already for the correction : https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html
But This patch was not followed up. According to me there are multiple reasons
_*Reasons for not following up*_ ----------------------------
----------------------------
Index : specifies the index number of a connector port. If not specified, the index is automatically incremented. This logic exists both on qemu as well as libvirt. https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62
_*Issue 1:*_
If we want two isa-serial devices and for the first one is we mention the port to be 3, then for the next device it not automatically assign the port number 4 which will throw the following error : error: internal error: process exited while connecting to monitor: 2021-11-12T11:05:31.169987Z qemu-kvm: -device isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA serial ports is 4.
But we are left with 3 ports (0,1,2) which are unused. So ideally we should have used them.
_*Issue 2:*_
It is possible that two devices get the same port address which might lead to a lot of ambiguity. Example: we want two devices and for the second one we provide the index 0. Then from default logic the first device will be allotted port 0 and the second device will overwrite it and get port 0.
_*Solution :*_ ----------
----------
*_Port allocation logic_*
1. Precedence should be given to serial devices as we only have the first 4 ports for them. 1.1. Check the command line/xml file, scan for all the devices mentioned and then start with the isa-serial devices for port allocation. 2.Maintain a buffer(bitmap) for marking the allocated ports. 3.While assigning a port to the device 3.1. If no port is provided by the user : provide the next available port. 3.2. Else check: 3.2.1. If the port is already allocated : throw the error. 3.2.2. Else allocate the port. 3.3. If out of ports : throw error -> qemu throws the error.
Libvirt also manages the port numbers with the auto increment logic but never updates the index value using the port number. Hence index should be assigned with proper port allocation logic.

From: Divya Garg<divya.garg@nutanix.com> Issue ----- The port being provided in the xml file of the domain is not getting reflected in the generated qemu command For instance, on adding the serial device: <serial> <target type='serial' port='3'/> </serial> Generated qemu command will look like : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0 Actually it should be : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0,index=3 So that qemu understands which port needs to be allocated for the device. Patch ----- Out already for the correction : https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html This patch was not followed up. According to me there can be multiple reasons. I have mentioned them below: --------------------------------------------------------------------------- Index : specifies the index number of a connector port. If not specified, the index is automatically incremented. This logic exists both on qemu as well as libvirt. https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62 Issue 1: If we want two isa-serial devices and for the first one if we mention the port to be 3, then for the next device it automatically assigns the port number 4, which will throw the following error : error: internal error: process exited while connecting to monitor: 2021-11-12T11:05:31.169987Z qemu-kvm: -device isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA serial ports is 4. But we are left with 3 ports (0,1,2) which are unused. So ideally we should have used them. Issue 2: It is possible that two devices get the same port address which might lead to a lot of ambiguity. Example: we want two devices and for the second one we provide the index 0. Then from default logic the first device will be allotted port 0 and the second device will overwrite it and get port 0. Solution : ---------- Port allocation logic 1. Precedence should be given to serial devices as we only have the first 4 ports for them. 1.1. Check the command line/xml file, scan for all the devices mentioned and then start with the isa-serial devices for port allocation. 2.Maintain a buffer for marking the allocated ports. 3.While assigning a port to the device 3.1. If no port is provided by the user : provide the next available port. 3.2. Else: 3.2.1. If the port is already allocated : throw the error. 3.2.2. Else allocate the port. 3.3. If out of ports : throw error -> qemu also throws the error. Libvirt manages the port numbers with the auto increment logic but never updates the index value using the port number. Hence using the above mentioned port allocation logic to assign the port for isa-serial devices and fill the index value using the same. Divya Garg(1): qemu: add index for isa-serial device using target.port src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-) -- 2.27.0

From: Divya Garg <divya.garg@nutanix.com> VM XML accepts target.port but this does not get passed while building the qemu command line for this VM. This patch fixes this bug. In addition, this introduces additional checks in the port allocation logic for isa-serial devices to : * Check availability of requested ports * Prevent duplicate device assignments to the same port. * In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM. Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 107d2a4f5d..e8b19828d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5319,6 +5319,61 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, } +static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + int isa_device_index_arr[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {0}; + bool used_serial_port[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {false}; + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->targetType == + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (isa_serial_count >= VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS); + return -1; + } + isa_device_index_arr[isa_serial_count++] = i; + } + /* Check for the user defined ports and mark them used if in the range + * of isa-serial ports, .i.e, from 0 to + * VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS. + */ + if (def->serials[i]->target.port != -1 && + def->serials[i]->target.port < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + + } + + /* Assign the ports to the devices. */ + for (i = 0; i < isa_serial_count; i++) { + int isa_index = isa_device_index_arr[i]; + if (def->serials[isa_index]->target.port != -1) + continue; + for (j = 0; j < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[isa_index]->target.port = j; + used_serial_port[j] = true; + break; + } + } + if (def->serials[isa_index]->target.port == -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("out of ports for isa-serial device.")); + return -1; + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6186,6 +6241,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; } + if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19857,14 +19915,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; - if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c0c07ea6ba..be162e592c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1179,6 +1179,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; +#define VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS 4 typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c47998aabd..797cdfb955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10953,11 +10953,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; } - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL; if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> -- 2.27.0

Hi all ! Looking forward for the review comments on the patch. Thanks Regards Divya Garg On 12/12/21 9:27 am, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
This patch fixes this bug. In addition, this introduces additional checks in the port allocation logic for isa-serial devices to : * Check availability of requested ports * Prevent duplicate device assignments to the same port. * In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 107d2a4f5d..e8b19828d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5319,6 +5319,61 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, }
+static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + int isa_device_index_arr[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {0}; + bool used_serial_port[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {false}; + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->targetType == + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (isa_serial_count >= VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS); + return -1; + } + isa_device_index_arr[isa_serial_count++] = i; + } + /* Check for the user defined ports and mark them used if in the range + * of isa-serial ports, .i.e, from 0 to + * VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS. + */ + if (def->serials[i]->target.port != -1 && + def->serials[i]->target.port < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + + } + + /* Assign the ports to the devices. */ + for (i = 0; i < isa_serial_count; i++) { + int isa_index = isa_device_index_arr[i]; + if (def->serials[isa_index]->target.port != -1) + continue; + for (j = 0; j < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[isa_index]->target.port = j; + used_serial_port[j] = true; + break; + } + } + if (def->serials[isa_index]->target.port == -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("out of ports for isa-serial device.")); + return -1; + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6186,6 +6241,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; }
+ if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19857,14 +19915,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c0c07ea6ba..be162e592c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1179,6 +1179,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+#define VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS 4 typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c47998aabd..797cdfb955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10953,11 +10953,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial>

On Mon, 3 Jan 2022, Divya Garg wrote:
Hi all !
Looking forward for the review comments on the patch.
For single patches, no need to use numbering.
Thanks Regards Divya Garg
On 12/12/21 9:27 am, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
This patch fixes this bug. In addition,
I think we should split up this patch into two, one that fixes the existing issue and the other that introduces additinal checks. It would be easier to review it that way. this introduces additional checks in
the port allocation logic for isa-serial devices to : * Check availability of requested ports * Prevent duplicate device assignments to the same port. * In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 107d2a4f5d..e8b19828d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5319,6 +5319,61 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, } +static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + int isa_device_index_arr[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {0}; + bool used_serial_port[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {false}; + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->targetType == + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (isa_serial_count >= VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS);
Use '%d' , please see https://libvirt.org/coding-style.html#error-message-format
+ return -1; + } + isa_device_index_arr[isa_serial_count++] = i; + } + /* Check for the user defined ports and mark them used if in the range + * of isa-serial ports, .i.e, from 0 to + * VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS. + */ + if (def->serials[i]->target.port != -1 && + def->serials[i]->target.port < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."),
Please conform to the error string formats as documented here: https://libvirt.org/coding-style.html#error-message-format
def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + + } + + /* Assign the ports to the devices. */ + for (i = 0; i < isa_serial_count; i++) { + int isa_index = isa_device_index_arr[i]; + if (def->serials[isa_index]->target.port != -1) + continue; + for (j = 0; j < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[isa_index]->target.port = j; + used_serial_port[j] = true; + break; + } + } + if (def->serials[isa_index]->target.port == -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("out of ports for isa-serial device.")); + return -1; + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6186,6 +6241,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; } + if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19857,14 +19915,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; - if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c0c07ea6ba..be162e592c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1179,6 +1179,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; +#define VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS 4 typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c47998aabd..797cdfb955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10953,11 +10953,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; } - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL; if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial>

Thankyou Ani for the review. I will be taking up the comments in next patchset along with other comments. On 03/01/22 1:44 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Hi all !
Looking forward for the review comments on the patch.
For single patches, no need to use numbering.
I have also added the cover letter with the patch. Hence added the numbering here.
Thanks Regards Divya Garg
On 12/12/21 9:27 am, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
This patch fixes this bug. In addition, I think we should split up this patch into two, one that fixes the existing issue and the other that introduces additinal checks. It would be easier to review it that way.
Yeah sounds reasonable. Will do it in the next patch set.
this introduces additional checks in
the port allocation logic for isa-serial devices to : * Check availability of requested ports * Prevent duplicate device assignments to the same port. * In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 107d2a4f5d..e8b19828d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5319,6 +5319,61 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, } +static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + int isa_device_index_arr[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {0}; + bool used_serial_port[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {false}; + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->targetType == + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (isa_serial_count >= VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS); Use '%d' , please see https://urldefense.proofpoint.com/v2/url?u=https-3A__libvirt.org_coding-2Dstyle.html-23error-2Dmessage-2Dformat&d=DwIDaQ&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=KNQ_Qw3y8qxj42KUdx9VcbmzQrwtyRwq2RiDkhMkNFypGybsocys4iwqrICwnIDn&s=n1ip3VFBqnojUNQYyHUmorNlMSHxKHm-rHK9BfGQ2lQ&e=
Got it ! Thanks.
+ return -1; + } + isa_device_index_arr[isa_serial_count++] = i; + } + /* Check for the user defined ports and mark them used if in the range + * of isa-serial ports, .i.e, from 0 to + * VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS. + */ + if (def->serials[i]->target.port != -1 && + def->serials[i]->target.port < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), Please conform to the error string formats as documented here: https://urldefense.proofpoint.com/v2/url?u=https-3A__libvirt.org_coding-2Dstyle.html-23error-2Dmessage-2Dformat&d=DwIDaQ&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=KNQ_Qw3y8qxj42KUdx9VcbmzQrwtyRwq2RiDkhMkNFypGybsocys4iwqrICwnIDn&s=n1ip3VFBqnojUNQYyHUmorNlMSHxKHm-rHK9BfGQ2lQ&e= Sure. Instead of [%d] I will use '%d'. Thankyou.
def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + + } + + /* Assign the ports to the devices. */ + for (i = 0; i < isa_serial_count; i++) { + int isa_index = isa_device_index_arr[i]; + if (def->serials[isa_index]->target.port != -1) + continue; + for (j = 0; j < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[isa_index]->target.port = j; + used_serial_port[j] = true; + break; + } + } + if (def->serials[isa_index]->target.port == -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("out of ports for isa-serial device.")); + return -1; + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6186,6 +6241,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; } + if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19857,14 +19915,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; - if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c0c07ea6ba..be162e592c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1179,6 +1179,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; +#define VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS 4 typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c47998aabd..797cdfb955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10953,11 +10953,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; } - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL; if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial>

On Mon, 3 Jan 2022, Divya Garg wrote:
Thankyou Ani for the review. I will be taking up the comments in next patchset along with other comments.
On 03/01/22 1:44 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Hi all !
Looking forward for the review comments on the patch.
For single patches, no need to use numbering.
I have also added the cover letter with the patch. Hence added the numbering here.
OK I did not see the cover letter.
Thanks Regards Divya Garg
On 12/12/21 9:27 am, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
This patch fixes this bug. In addition, I think we should split up this patch into two, one that fixes the existing issue and the other that introduces additinal checks. It would be easier to review it that way.
Yeah sounds reasonable. Will do it in the next patch set.
this introduces additional checks in
the port allocation logic for isa-serial devices to : * Check availability of requested ports * Prevent duplicate device assignments to the same port. * In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 107d2a4f5d..e8b19828d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5319,6 +5319,61 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, } +static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + int isa_device_index_arr[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {0}; + bool used_serial_port[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {false}; + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->targetType == + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (isa_serial_count >= VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS); Use '%d' , please see https://urldefense.proofpoint.com/v2/url?u=https-3A__libvirt.org_coding-2Dstyle.html-23error-2Dmessage-2Dformat&d=DwIDaQ&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=KNQ_Qw3y8qxj42KUdx9VcbmzQrwtyRwq2RiDkhMkNFypGybsocys4iwqrICwnIDn&s=n1ip3VFBqnojUNQYyHUmorNlMSHxKHm-rHK9BfGQ2lQ&e=
Got it ! Thanks.
+ return -1; + } + isa_device_index_arr[isa_serial_count++] = i; + } + /* Check for the user defined ports and mark them used if in the range + * of isa-serial ports, .i.e, from 0 to + * VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS. + */ + if (def->serials[i]->target.port != -1 && + def->serials[i]->target.port < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), Please conform to the error string formats as documented here: https://urldefense.proofpoint.com/v2/url?u=https-3A__libvirt.org_coding-2Dstyle.html-23error-2Dmessage-2Dformat&d=DwIDaQ&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=KNQ_Qw3y8qxj42KUdx9VcbmzQrwtyRwq2RiDkhMkNFypGybsocys4iwqrICwnIDn&s=n1ip3VFBqnojUNQYyHUmorNlMSHxKHm-rHK9BfGQ2lQ&e= Sure. Instead of [%d] I will use '%d'. Thankyou.
def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + + } + + /* Assign the ports to the devices. */ + for (i = 0; i < isa_serial_count; i++) { + int isa_index = isa_device_index_arr[i]; + if (def->serials[isa_index]->target.port != -1) + continue; + for (j = 0; j < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[isa_index]->target.port = j; + used_serial_port[j] = true; + break; + } + } + if (def->serials[isa_index]->target.port == -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("out of ports for isa-serial device.")); + return -1; + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6186,6 +6241,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; } + if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19857,14 +19915,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; - if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c0c07ea6ba..be162e592c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1179,6 +1179,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; +#define VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS 4
For this hard limit, you should probably refer to the Qemu commit which introduced this: commit def337ffda34d331404bd7f1a42726b71500df22 Author: Peter Maydell <peter.maydell@linaro.org> Date: Fri Apr 20 15:52:46 2018 +0100 serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTS You can add this information in the commit message and refer to MAX_ISA_SERIAL_PORTS definition in Qemu with a comment here. If in future in Qemu if we change the value of MAX_ISA_SERIAL_PORTS, we can also make same changes here.
typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c47998aabd..797cdfb955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10953,11 +10953,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; } - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL; if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial>

On Mon, 3 Jan 2022, Divya Garg wrote:
Thankyou Ani for the review. I will be taking up the comments in next patchset along with other comments.
On 03/01/22 1:44 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Hi all !
Looking forward for the review comments on the patch.
For single patches, no need to use numbering.
I have also added the cover letter with the patch. Hence added the numbering here.
btw, cover letters are not essential for single patches: https://libvirt.org/submitting-patches.html

On 04/01/22 5:47 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Thankyou Ani for the review. I will be taking up the comments in next patchset along with other comments.
On 03/01/22 1:44 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Hi all !
Looking forward for the review comments on the patch.
For single patches, no need to use numbering. I have also added the cover letter with the patch. Hence added the numbering here. btw, cover letters are not essential for single patches:
Thankyou so much Ani. I added the cover letter because i was not sure if the checks I am applying are needed or not. Hence wanted to explain all my cases that I am handling through the cover letter.

On Tue, 4 Jan 2022, Divya Garg wrote:
On 04/01/22 5:47 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Thankyou Ani for the review. I will be taking up the comments in next patchset along with other comments.
On 03/01/22 1:44 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Hi all !
Looking forward for the review comments on the patch.
For single patches, no need to use numbering. I have also added the cover letter with the patch. Hence added the numbering here. btw, cover letters are not essential for single patches:
Thankyou so much Ani. I added the cover letter because i was not sure if the checks I am applying are needed or not. Hence wanted to explain all my cases that I am handling through the cover letter.
yes that's perfectly fine.

On 04/01/22 5:56 pm, Ani Sinha wrote:
On Tue, 4 Jan 2022, Divya Garg wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Thankyou Ani for the review. I will be taking up the comments in next patchset along with other comments.
On 03/01/22 1:44 pm, Ani Sinha wrote:
On Mon, 3 Jan 2022, Divya Garg wrote:
Hi all !
Looking forward for the review comments on the patch.
For single patches, no need to use numbering. I have also added the cover letter with the patch. Hence added the numbering here. btw, cover letters are not essential for single patches:
https://urldefense.proofpoint.com/v2/url?u=https-3A__libvirt.org_submitting-2Dpatches.html&d=DwIBAg&c=s883GpUCOChKOHiocYtGcg&r=2QGHz-fTCVWImEBKe1ZcSe5t6UfasnhvdzD5DcixwOE&m=neaBi0ZuC9uGNNnNZGkXsPK_JEReYD2oA8csE4KE4LUYwtOWFxn6ipCd7_mPXNll&s=u-g3In7hJ90OdEzNmUj41bzzvmAIvOmLJSBpcAB2kQc&e= Thankyou so much Ani. I added the cover letter because i was not sure if the checks I am applying are needed or not. Hence wanted to explain all my cases
On 04/01/22 5:47 pm, Ani Sinha wrote: that I am handling through the cover letter. yes that's perfectly fine.
Thanks Ani for your time.

On Sat, Dec 11, 2021 at 07:57:47PM -0800, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Apologies, I failed to notice this had been sent out to the list; Re-posting my comments from an internal thread, so all can see: I don't think serial ports that are not isa-serial should clash with serial ports like this. In fact, from what I can see, as "port" is not used for any other type, we should just completely ignore non-isa-serial ports here. So you can simplify this all to, I think: for (i = 0; i < isa_serial_count; i++) { if (type ! = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL): continue if (def->serials[i]->port != -1): // check for clash / too high value // else mark port used } for (i = 0; i < isa_serial_count; i++) { if (type != VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL): continue if (def->serials[i]->port == -1): // allocate lowest free port // error if none available } regards john
This patch fixes this bug. In addition, this introduces additional checks in the port allocation logic for isa-serial devices to : * Check availability of requested ports * Prevent duplicate device assignments to the same port. * In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 107d2a4f5d..e8b19828d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5319,6 +5319,61 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, }
+static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + int isa_device_index_arr[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {0}; + bool used_serial_port[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {false}; + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->targetType == + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (isa_serial_count >= VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS); + return -1; + } + isa_device_index_arr[isa_serial_count++] = i; + } + /* Check for the user defined ports and mark them used if in the range + * of isa-serial ports, .i.e, from 0 to + * VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS. + */ + if (def->serials[i]->target.port != -1 && + def->serials[i]->target.port < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + + } + + /* Assign the ports to the devices. */ + for (i = 0; i < isa_serial_count; i++) { + int isa_index = isa_device_index_arr[i]; + if (def->serials[isa_index]->target.port != -1) + continue; + for (j = 0; j < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[isa_index]->target.port = j; + used_serial_port[j] = true; + break; + } + } + if (def->serials[isa_index]->target.port == -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("out of ports for isa-serial device.")); + return -1; + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6186,6 +6241,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; }
+ if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19857,14 +19915,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c0c07ea6ba..be162e592c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1179,6 +1179,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+#define VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS 4 typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c47998aabd..797cdfb955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10953,11 +10953,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial>

On 04/01/22 5:17 pm, John Levon wrote:
On Sat, Dec 11, 2021 at 07:57:47PM -0800, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM. Apologies, I failed to notice this had been sent out to the list; Re-posting my comments from an internal thread, so all can see:
I don't think serial ports that are not isa-serial should clash with serial ports like this.
In fact, from what I can see, as "port" is not used for any other type, we should just completely ignore non-isa-serial ports here.
So you can simplify this all to, I think:
for (i = 0; i < isa_serial_count; i++) { if (type ! = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL): continue
if (def->serials[i]->port != -1): // check for clash / too high value // else mark port used }
for (i = 0; i < isa_serial_count; i++) { if (type != VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL): continue
if (def->serials[i]->port == -1): // allocate lowest free port // error if none available }
regards john Thankyou John ! I will be taking up the changes in my next patch.
This patch fixes this bug. In addition, this introduces additional checks in the port allocation logic for isa-serial devices to : * Check availability of requested ports * Prevent duplicate device assignments to the same port. * In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 66 ++++++++++++++++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 ++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- 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 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../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-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 42 files changed, 126 insertions(+), 64 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 107d2a4f5d..e8b19828d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5319,6 +5319,61 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, }
+static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + int isa_device_index_arr[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {0}; + bool used_serial_port[VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS] = {false}; + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->targetType == + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (isa_serial_count >= VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is %d."), VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS); + return -1; + } + isa_device_index_arr[isa_serial_count++] = i; + } + /* Check for the user defined ports and mark them used if in the range + * of isa-serial ports, .i.e, from 0 to + * VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS. + */ + if (def->serials[i]->target.port != -1 && + def->serials[i]->target.port < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port [%d] already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + + } + + /* Assign the ports to the devices. */ + for (i = 0; i < isa_serial_count; i++) { + int isa_index = isa_device_index_arr[i]; + if (def->serials[isa_index]->target.port != -1) + continue; + for (j = 0; j < VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[isa_index]->target.port = j; + used_serial_port[j] = true; + break; + } + } + if (def->serials[isa_index]->target.port == -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("out of ports for isa-serial device.")); + return -1; + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6186,6 +6241,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; }
+ if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19857,14 +19915,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c0c07ea6ba..be162e592c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1179,6 +1179,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+#define VIR_MAX_AVAILABLE_ISA_SERIAL_PORTS 4 typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c47998aabd..797cdfb955 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10953,11 +10953,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", + virDomainChrSerialTargetModelTypeToString(serial->targetModel), + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial>

On Tue, Jan 04, 2022 at 11:47:39AM +0000, John Levon wrote:
On Sat, Dec 11, 2021 at 07:57:47PM -0800, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Apologies, I failed to notice this had been sent out to the list; Re-posting my comments from an internal thread, so all can see:
I don't think serial ports that are not isa-serial should clash with serial ports like this.
In fact, from what I can see, as "port" is not used for any other type, we should just completely ignore non-isa-serial ports here.
Agreed, conceptually the 'port' is only required to be unique within the scope of the 'type' setting. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On 04/01/22 7:27 pm, Daniel P. Berrangé wrote:
On Sat, Dec 11, 2021 at 07:57:47PM -0800, “Divya wrote:
From: Divya Garg <divya.garg@nutanix.com>
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM. Apologies, I failed to notice this had been sent out to the list; Re-posting my comments from an internal thread, so all can see:
I don't think serial ports that are not isa-serial should clash with serial ports like this.
In fact, from what I can see, as "port" is not used for any other type, we should just completely ignore non-isa-serial ports here. Agreed, conceptually the 'port' is only required to be unique within
On Tue, Jan 04, 2022 at 11:47:39AM +0000, John Levon wrote: the scope of the 'type' setting.
Sure Daniel. Let me update it and send the patch for the review. Thanks Regards Divya
Regards, Daniel

Issue ----- ----- The port being provided in the xml file of the domain is not getting reflected in the generated qemu command For instance, on adding the serial device: <serial> <target type='serial' port='3'/> </serial> Generated qemu command will look like : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0 Actually it should be : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0,index=3 So that qemu understands which port needs to be allocated for the device. Patch ----- ----- Out already for the correction : https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html This patch was not followed up. According to me there can be multiple reasons. I have mentioned them below: --------------------------------------------------------------------------- --------------------------------------------------------------------------- Index : specifies the index number of a connector port. If not specified, the index is automatically incremented. This logic exists both on qemu as well as libvirt. https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62 Issue 1: ------- If we want two isa-serial devices and for the first one if we mention the port to be 3, then for the next device it automatically assigns the port number 4, which will throw the following error : error: internal error: process exited while connecting to monitor: 2021-11-12T11:05:31.169987Z qemu-kvm: -device isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA serial ports is 4. But we are left with 3 ports (0,1,2) which are unused. So ideally we should have used them. Issue 2: ------- It is possible that two devices get the same port address which might lead to a lot of ambiguity. Example: we want two devices and for the second one we provide the index 0. Then from default logic the first device will be allotted port 0 and the second device will overwrite it and get port 0. This patch-set tends to solve the problem. It contains two commits that deals with the issue in following order : - check the input provided, and make sure to correctly assign ports - provide the corrected port values to qemu Divya Garg (2): Add the port allocation logic for isa-serial devices. qemu: add index for isa-serial device using target.port src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ src/qemu/qemu_command.c | 22 +++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../name-escape.x86_64-latest.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +- .../serial-many-chardev.x86_64-latest.args | 4 +- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../serial-udp-chardev.x86_64-latest.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 61 files changed, 153 insertions(+), 90 deletions(-) -- 2.25.1

This commit takes care of following cases: -> Check availability of requested ports. ->The total number of requested ports should not be more than VIR_MAX_ISA_SERIAL_PORTS. ->The ports requested should be less than VIR_MAX_ISA_SERIAL_PORTS. ->VIR_MAX_ISA_SERIAL_PORTS should correspond to MAX_ISA_SERIAL_PORTS specified in qemu code commit def337ffda34d331404bd7f1a42726b71500df22. -> Prevent duplicate device assignments to the same port. -> In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM. --- src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 9 files changed, 68 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5691b8d2d5..e468e98045 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5330,6 +5330,56 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, } +static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + bool used_serial_port[VIR_MAX_ISA_SERIAL_PORTS] = {false}; + + /* Perform all the required checks. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) + continue; + + if (isa_serial_count++ >= VIR_MAX_ISA_SERIAL_PORTS || + def->serials[i]->target.port >= VIR_MAX_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is '%d'."), VIR_MAX_ISA_SERIAL_PORTS); + return -1; + } + + if (def->serials[i]->target.port != -1) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port '%d' already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + } + + /* Assign the ports to the devices. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL || + def->serials[i]->target.port != -1) + continue; + + for (j = 0; j < VIR_MAX_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[i]->target.port = j; + used_serial_port[j] = true; + break; + } + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6197,6 +6247,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; } + if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19929,14 +19982,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; - if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; +/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base. + */ +#define VIR_MAX_ISA_SERIAL_PORTS 4 + typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> -- 2.25.1

Please add SOB. On Mon, 10 Jan 2022, Divya Garg wrote:
This commit takes care of following cases: -> Check availability of requested ports. ->The total number of requested ports should not be more than VIR_MAX_ISA_SERIAL_PORTS. ->The ports requested should be less than VIR_MAX_ISA_SERIAL_PORTS. ->VIR_MAX_ISA_SERIAL_PORTS should correspond to MAX_ISA_SERIAL_PORTS specified in qemu code commit def337ffda34d331404bd7f1a42726b71500df22. -> Prevent duplicate device assignments to the same port. -> In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM. --- src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 9 files changed, 68 insertions(+), 17 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5691b8d2d5..e468e98045 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5330,6 +5330,56 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, }
+static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + bool used_serial_port[VIR_MAX_ISA_SERIAL_PORTS] = {false}; + + /* Perform all the required checks. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) + continue; + + if (isa_serial_count++ >= VIR_MAX_ISA_SERIAL_PORTS || + def->serials[i]->target.port >= VIR_MAX_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is '%d'."), VIR_MAX_ISA_SERIAL_PORTS); + return -1; + } + + if (def->serials[i]->target.port != -1) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port '%d' already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + } + + /* Assign the ports to the devices. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL || + def->serials[i]->target.port != -1) + continue; + + for (j = 0; j < VIR_MAX_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[i]->target.port = j; + used_serial_port[j] = true; + break; + } + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6197,6 +6247,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; }
+ if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19929,14 +19982,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base. + */ +#define VIR_MAX_ISA_SERIAL_PORTS 4 + typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> -- 2.25.1

Please add SOB. Yes Thankyou so much. Should I have a new version for it or on the same
On 11/01/22 4:09 pm, Ani Sinha wrote: thread send the updated patches ?
On Mon, 10 Jan 2022, Divya Garg wrote:
This commit takes care of following cases: -> Check availability of requested ports. ->The total number of requested ports should not be more than VIR_MAX_ISA_SERIAL_PORTS. ->The ports requested should be less than VIR_MAX_ISA_SERIAL_PORTS. ->VIR_MAX_ISA_SERIAL_PORTS should correspond to MAX_ISA_SERIAL_PORTS specified in qemu code commit def337ffda34d331404bd7f1a42726b71500df22. -> Prevent duplicate device assignments to the same port. -> In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM. --- src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 9 files changed, 68 insertions(+), 17 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5691b8d2d5..e468e98045 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5330,6 +5330,56 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, }
+static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + bool used_serial_port[VIR_MAX_ISA_SERIAL_PORTS] = {false}; + + /* Perform all the required checks. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) + continue; + + if (isa_serial_count++ >= VIR_MAX_ISA_SERIAL_PORTS || + def->serials[i]->target.port >= VIR_MAX_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is '%d'."), VIR_MAX_ISA_SERIAL_PORTS); + return -1; + } + + if (def->serials[i]->target.port != -1) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port '%d' already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + } + + /* Assign the ports to the devices. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL || + def->serials[i]->target.port != -1) + continue; + + for (j = 0; j < VIR_MAX_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[i]->target.port = j; + used_serial_port[j] = true; + break; + } + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6197,6 +6247,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; }
+ if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19929,14 +19982,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base. + */ +#define VIR_MAX_ISA_SERIAL_PORTS 4 + typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 5d688e7748..295d75b768 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index b916f30412..850ebddf52 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index 9b0b8b3e73..522f0184d3 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index 75c6c7f5f4..d41f5ee03e 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 670f282b84..2bf954bc9f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index 7fde19f283..de11465233 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> -- 2.25.1

On Tue, 11 Jan 2022, Divya Garg wrote:
Please add SOB. Yes Thankyou so much. Should I have a new version for it or on the same thread send
On 11/01/22 4:09 pm, Ani Sinha wrote: the updated patches ?
I am fine with your bugfix patch patch 2. DanPB and others, could you guys provide some feedback on both patches before she spins out another version with SOB added?

Issue ----- ----- The port being provided in the xml file of the domain is not getting reflected in the generated qemu command For instance, on adding the serial device: <serial> <target type='serial' port='3'/> </serial> Generated qemu command will look like : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0 Actually it should be : /usr/libexec/qemu-kvm ...\ -device isa-serial,chardev=charserial0,id=serial0,index=3 So that qemu understands which port needs to be allocated for the device. Patch ----- ----- Out already for the correction : https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html This patch was not followed up. According to me there can be multiple reasons. I have mentioned them below: --------------------------------------------------------------------------- --------------------------------------------------------------------------- Index : specifies the index number of a connector port. If not specified, the index is automatically incremented. This logic exists both on qemu as well as libvirt. https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62 Issue 1: ------- If we want two isa-serial devices and for the first one if we mention the port to be 3, then for the next device it automatically assigns the port number 4, which will throw the following error : error: internal error: process exited while connecting to monitor: 2021-11-12T11:05:31.169987Z qemu-kvm: -device isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA serial ports is 4. But we are left with 3 ports (0,1,2) which are unused. So ideally we should have used them. Issue 2: ------- It is possible that two devices get the same port address which might lead to a lot of ambiguity. Example: we want two devices and for the second one we provide the index 0. Then from default logic the first device will be allotted port 0 and the second device will overwrite it and get port 0. This patch-set tends to solve the problem. It contains two commits that deals with the issue in following order : - check the input provided, and make sure to correctly assign ports - provide the corrected port values to qemu Divya Garg (2): Add the port allocation logic for isa-serial devices. qemu: add index for isa-serial device using target.port src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ src/qemu/qemu_command.c | 25 ++++++-- ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +- .../name-escape.x86_64-latest.args | 4 +- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +- .../serial-many-chardev.x86_64-latest.args | 4 +- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.args | 4 +- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.args | 4 +- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.args | 4 +- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +- .../serial-udp-chardev.x86_64-latest.args | 4 +- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +- .../serial-unix-chardev.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 61 files changed, 156 insertions(+), 90 deletions(-) -- 2.25.1

This commit takes care of following cases: -> Check availability of requested ports. ->The total number of requested ports should not be more than VIR_MAX_ISA_SERIAL_PORTS. ->The ports requested should be less than VIR_MAX_ISA_SERIAL_PORTS. ->VIR_MAX_ISA_SERIAL_PORTS should correspond to MAX_ISA_SERIAL_PORTS specified in qemu code commit def337ffda34d331404bd7f1a42726b71500df22. -> Prevent duplicate device assignments to the same port. -> In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM. Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 9 files changed, 68 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5691b8d2d5..e468e98045 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5330,6 +5330,56 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, } +static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j; + size_t isa_serial_count = 0; + bool used_serial_port[VIR_MAX_ISA_SERIAL_PORTS] = {false}; + + /* Perform all the required checks. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) + continue; + + if (isa_serial_count++ >= VIR_MAX_ISA_SERIAL_PORTS || + def->serials[i]->target.port >= VIR_MAX_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is '%d'."), VIR_MAX_ISA_SERIAL_PORTS); + return -1; + } + + if (def->serials[i]->target.port != -1) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port '%d' already allocated."), def->serials[i]->target.port); + return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + } + + /* Assign the ports to the devices. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL || + def->serials[i]->target.port != -1) + continue; + + for (j = 0; j < VIR_MAX_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[i]->target.port = j; + used_serial_port[j] = true; + break; + } + } + } + return 0; +} + static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6197,6 +6247,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; } + if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19929,14 +19982,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL; - if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; +/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base. + */ +#define VIR_MAX_ISA_SERIAL_PORTS 4 + typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml index 38311b188c..72516555a0 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml index 3fe205430c..6197a2bfe3 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml @@ -74,7 +74,7 @@ <alias name='serial0'/> </serial> <serial type='pty'> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> <alias name='serial1'/> @@ -82,7 +82,7 @@ <serial type='tcp'> <source mode='bind' host='0.0.0.0' service='2445'/> <protocol type='raw'/> - <target type='isa-serial' port='1'> + <target type='isa-serial' port='2'> <model name='isa-serial'/> </target> <alias name='serial2'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml index f27b119270..16734d9cce 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555' tls='no'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml index be58ccc1da..15ce29c67d 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml index be58ccc1da..15ce29c67d 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.xml @@ -29,7 +29,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml index 8e44dea365..8bb7cbefae 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.xml @@ -34,7 +34,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target port='0'/> + <target port='1'/> </serial> <console type='udp'> <source mode='bind' host='127.0.0.1' service='1111'/> diff --git a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml index aefd3513ce..4cdefed63d 100644 --- a/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml +++ b/tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev.xml @@ -37,7 +37,7 @@ <serial type='tcp'> <source mode='connect' host='127.0.0.1' service='5555'/> <protocol type='raw'/> - <target type='isa-serial' port='0'> + <target type='isa-serial' port='1'> <model name='isa-serial'/> </target> </serial> -- 2.25.1

On 1/13/22 08:33, Divya Garg wrote:
This commit takes care of following cases: -> Check availability of requested ports. ->The total number of requested ports should not be more than VIR_MAX_ISA_SERIAL_PORTS. ->The ports requested should be less than VIR_MAX_ISA_SERIAL_PORTS. ->VIR_MAX_ISA_SERIAL_PORTS should correspond to MAX_ISA_SERIAL_PORTS specified in qemu code commit def337ffda34d331404bd7f1a42726b71500df22. -> Prevent duplicate device assignments to the same port. -> In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 9 files changed, 68 insertions(+), 17 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5691b8d2d5..e468e98045 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5330,6 +5330,56 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, }
Only a few nitpicks.
+static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j;
We like to define variables on separate lines, because it then allows for smaller, easier to understand diffs when changing them. Then, a variable should be declared at the lowest level possible, which in case of @j is inside the other for() loop.
+ size_t isa_serial_count = 0; + bool used_serial_port[VIR_MAX_ISA_SERIAL_PORTS] = {false};
I prefer spaces around curly-braces.
+ + /* Perform all the required checks. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL)
Not your fault, we have a code like this, but I find it more readable if the condition is on one line. There is a recommendation on lines not being 80 chars long, but there are few exceptions to the rule (well, recommendation) and improved code readability is one of them.
+ continue; + + if (isa_serial_count++ >= VIR_MAX_ISA_SERIAL_PORTS || + def->serials[i]->target.port >= VIR_MAX_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is '%d'."), VIR_MAX_ISA_SERIAL_PORTS);
Here, and ...
+ return -1; + } + + if (def->serials[i]->target.port != -1) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port '%d' already allocated."), def->serials[i]->target.port);
... here, however, the lines could be broken after the error message.
+ return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + } + + /* Assign the ports to the devices. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL || + def->serials[i]->target.port != -1) + continue; + + for (j = 0; j < VIR_MAX_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[i]->target.port = j; + used_serial_port[j] = true; + break; + } + } + } + return 0; +} +
If you'd look around, we like to separate functions with two empty lines. Yes, we still do have plenty of ancient code with one line separation, but for new code we definitely should use two lines. Then again, an exception would be the function would be added around a code that's still using one line.
static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6197,6 +6247,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; }
+ if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19929,14 +19982,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base.
We prefer upper case spelling of QEMU. And it's been a long time since I've last booted up my machine with ISA, but IIRC it could only have 4 COM ports, so maybe the limit doesn't come from QEMU really but BIOS of that time? What I'm trying to say is, if this is a limit shared across other hypervisors then it can live under src/conf/ but if isn't shared then it has to go under hypervisor specific dir (src/qemu/ in this case). I'm just going to assume the limit is shared and not QEMU specific. Michal

On Thu, 13 Jan 2022, Michal Prívozník wrote:
index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base.
We prefer upper case spelling of QEMU. And it's been a long time since I've last booted up my machine with ISA, but IIRC it could only have 4 COM ports, so maybe the limit doesn't come from QEMU really but BIOS of that time? What I'm trying to say is, if this is a limit shared across other hypervisors then it can live under src/conf/ but if isn't shared then it has to go under hypervisor specific dir (src/qemu/ in this case).
I'm just going to assume the limit is shared and not QEMU specific.
Maybe I read this wrong but I interpreted this commit message in QEMU repo to mean that the limitation is qemu specific : commit def337ffda34d331404bd7f1a42726b71500df22 Author: Peter Maydell <peter.maydell@linaro.org> Date: Fri Apr 20 15:52:46 2018 +0100 serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTS The ISA serial port handling in serial-isa.c imposes a limit of 4 serial ports. This is because we only know of 4 IO port and IRQ settings for them, and is unrelated to the generic MAX_SERIAL_PORTS limit, though they happen to both be set at 4 currently. Use a new MAX_ISA_SERIAL_PORTS wherever that is the correct limit to be checking against. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-11-peter.maydell@linaro.org

index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base.
We prefer upper case spelling of QEMU. And it's been a long time since I've last booted up my machine with ISA, but IIRC it could only have 4 COM ports, so maybe the limit doesn't come from QEMU really but BIOS of that time? What I'm trying to say is, if this is a limit shared across other hypervisors then it can live under src/conf/ but if isn't shared then it has to go under hypervisor specific dir (src/qemu/ in this case).
I'm just going to assume the limit is shared and not QEMU specific.
Ok I spoke to Peter about the following commit on @qemu-devel. The underlying limitation is indeed dictated by the hw it is emulating. Fair enough! I still think though that we should leave the above comment as is because this validation in libvirt is dependent on what Qemu allows today. The reference is important IMHO.
Maybe I read this wrong but I interpreted this commit message in QEMU repo to mean that the limitation is qemu specific :
commit def337ffda34d331404bd7f1a42726b71500df22 Author: Peter Maydell <peter.maydell@linaro.org> Date: Fri Apr 20 15:52:46 2018 +0100
serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTS
The ISA serial port handling in serial-isa.c imposes a limit of 4 serial ports. This is because we only know of 4 IO port and IRQ settings for them, and is unrelated to the generic MAX_SERIAL_PORTS limit, though they happen to both be set at 4 currently.
Use a new MAX_ISA_SERIAL_PORTS wherever that is the correct limit to be checking against.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-11-peter.maydell@linaro.org

Thanks Michal !! For reviewing and merging my patch. I will keep all the nits pointed by you in mind for my next patches. :) On 13/01/22 8:50 pm, Michal Prívozník wrote:
On 1/13/22 08:33, Divya Garg wrote:
This commit takes care of following cases: -> Check availability of requested ports. ->The total number of requested ports should not be more than VIR_MAX_ISA_SERIAL_PORTS. ->The ports requested should be less than VIR_MAX_ISA_SERIAL_PORTS. ->VIR_MAX_ISA_SERIAL_PORTS should correspond to MAX_ISA_SERIAL_PORTS specified in qemu code commit def337ffda34d331404bd7f1a42726b71500df22. -> Prevent duplicate device assignments to the same port. -> In case no ports are provided in the XML, this patch scans the list of unused isa-serial indices to automatically assign available ports for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/conf/domain_conf.c | 61 ++++++++++++++++--- src/conf/domain_conf.h | 6 ++ ...g-console-compat-2-live+console-virtio.xml | 4 +- .../qemuhotplug-console-compat-2-live.xml | 4 +- .../serial-tcp-tlsx509-chardev-notls.xml | 2 +- .../serial-tcp-tlsx509-chardev-verify.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- .../serial-tcp-tlsx509-secret-chardev.xml | 2 +- .../serial-tcp-tlsx509-chardev.xml | 2 +- 9 files changed, 68 insertions(+), 17 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5691b8d2d5..e468e98045 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5330,6 +5330,56 @@ virDomainHostdevDefPostParse(virDomainHostdevDef *dev, }
Only a few nitpicks.
+static int +virDomainChrIsaSerialDefPostParse(virDomainDef *def) +{ + size_t i, j;
We like to define variables on separate lines, because it then allows for smaller, easier to understand diffs when changing them. Then, a variable should be declared at the lowest level possible, which in case of @j is inside the other for() loop. Ohh yeah right !! I will keep these details in mind for my next patch.
+ size_t isa_serial_count = 0; + bool used_serial_port[VIR_MAX_ISA_SERIAL_PORTS] = {false}; I prefer spaces around curly-braces. Sure. Actually all the space related issue was coming up with the tests. Hence I thought it will be okay not to add spaces.
+ + /* Perform all the required checks. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) Not your fault, we have a code like this, but I find it more readable if the condition is on one line. There is a recommendation on lines not being 80 chars long, but there are few exceptions to the rule (well, recommendation) and improved code readability is one of them. Noted
+ continue; + + if (isa_serial_count++ >= VIR_MAX_ISA_SERIAL_PORTS || + def->serials[i]->target.port >= VIR_MAX_ISA_SERIAL_PORTS) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Maximum supported number of ISA serial ports is '%d'."), VIR_MAX_ISA_SERIAL_PORTS); Here, and ...
+ return -1; + } + + if (def->serials[i]->target.port != -1) { + if (used_serial_port[def->serials[i]->target.port]) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("target port '%d' already allocated."), def->serials[i]->target.port); ... here, however, the lines could be broken after the error message. In the coding convention it was written not to break the error messages hence followed that rule. But next time will break after error message.
+ return -1; + } + used_serial_port[def->serials[i]->target.port] = true; + } + } + + /* Assign the ports to the devices. */ + for (i = 0; i < def->nserials; i++) { + + if (def->serials[i]->targetType != + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL || + def->serials[i]->target.port != -1) + continue; + + for (j = 0; j < VIR_MAX_ISA_SERIAL_PORTS; j++) { + if (!used_serial_port[j]) { + def->serials[i]->target.port = j; + used_serial_port[j] = true; + break; + } + } + } + return 0; +} + If you'd look around, we like to separate functions with two empty lines. Yes, we still do have plenty of ancient code with one line separation, but for new code we definitely should use two lines. Then again, an exception would be the function would be added around a code that's still using one line. Noted.
static void virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) @@ -6197,6 +6247,9 @@ virDomainDefPostParse(virDomainDef *def, goto cleanup; }
+ if (virDomainChrIsaSerialDefPostParse(def) < 0) + return -1; + /* iterate the devices */ ret = virDomainDeviceInfoIterateFlags(def, virDomainDefPostParseDeviceIterator, @@ -19929,14 +19982,6 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (!chr) return NULL;
- if (chr->target.port == -1) { - int maxport = -1; - for (j = 0; j < i; j++) { - if (def->serials[j]->target.port > maxport) - maxport = def->serials[j]->target.port; - } - chr->target.port = maxport + 1; - } def->serials[def->nserials++] = chr; } VIR_FREE(nodes); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..a8f41dc8c2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1187,6 +1187,12 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType;
+/* + * The value of VIR_MAX_ISA_SERIAL_PORTS corresponds to MAX_ISA_SERIAL_PORTS + * set in qemu code base. We prefer upper case spelling of QEMU. And it's been a long time since I've last booted up my machine with ISA, but IIRC it could only have 4 COM ports, so maybe the limit doesn't come from QEMU really but BIOS of that time? What I'm trying to say is, if this is a limit shared across other hypervisors then it can live under src/conf/ but if isn't shared then it has to go under hypervisor specific dir (src/qemu/ in this case).
I'm just going to assume the limit is shared and not QEMU specific. Thanks Michal ! Should I run some experiments to understand this ? Or are we good for now ?
Michal

VM XML accepts target.port but this does not get passed while building the qemu command line for this VM. Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/qemu/qemu_command.c | 25 +++++++++++++++---- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +-- .../name-escape.x86_64-latest.args | 4 +-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +-- .../serial-many-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev-verify.args | 4 +-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev.args | 4 +-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-secret-chardev.args | 4 +-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +-- .../serial-udp-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +-- .../serial-unix-chardev.x86_64-latest.args | 4 +-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 88 insertions(+), 73 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret; switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: @@ -10750,11 +10752,24 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; } - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + typestr = virDomainChrSerialTargetModelTypeToString(serial->targetModel); + + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL); + } else { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL); + } + + if (ret < 0) return NULL; if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index afaf50d4ba..e91e3c349f 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args index cd81c2cec9..66cb02b1c6 100644 --- a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 241449f75d..a246c08b12 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args index bdd0254499..19939030ad 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -34,10 +34,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-foo=1,bar=2/.config \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -audiodev '{"id":"audio1","driver":"spice"}' \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 49e0f6794e..afaff44212 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index bcca630616..bcaf66f88d 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args index 94d76fac91..067fa6987f 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index fb5276bc5f..0bf5d6ceb0 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args index fe46edb5f6..a76bf66f8f 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index db46920bab..4ec07d9b1f 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args index 02a5bbc121..308e73c0b9 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args @@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index 3833413150..1ffa30d207 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args index 39c93eaa0c..558e189e86 100644 --- a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -add-fd set=0,fd=1750 \ -add-fd set=1,fd=1751 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on,logfile=/dev/fdset/1,logappend=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 11e187fead..e0005656ea 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args index c15fbeafb9..29be886c5d 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 9e0c483f3d..7d4c2a0d37 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args index 5ac813d814..5315f66849 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args @@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -audiodev '{"id":"audio1","driver":"spice"}' \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index 63b16ded13..de5af9c7ed 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args index f15a843909..bd98ea6be4 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index a804bdf7e6..2ac30c694c 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args index da4f1e8aae..67cedc30e9 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index a49f649309..302dc59394 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args index 45b1386916..58ae1338fa 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index 8e45fc5490..998413bf0f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args index 7b9b49b1cb..7f72c2d045 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index 8e45fc5490..998413bf0f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args index 7b9b49b1cb..7f72c2d045 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 23331ed1d4..17926d7a11 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args index 1ce871f3cf..7ff4f6c5b2 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args @@ -32,11 +32,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"secret","id":"charserial1-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"passwordid":"charserial1-secret0"}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9e5e909881..93bf2f4f0d 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args index 48b44f8ffd..2c8b2bd117 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 6f533a991a..4192ef5621 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index b8adaa39bc..27388d1351 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index 65b1473c70..6870f976e4 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args index 5c59309ad5..81f51dc8d7 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 248469a668..bcd901da90 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 697bb1e655..92e4c770e2 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device virtio-9p-pci,id=fs3,fsdev=fsdev-fs3,mount_tag=fs3,bus=pci.0,addr=0x5 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index e52826f2c4..cd8948de04 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device virtio-9p-pci,id=fs2,fsdev=fsdev-fs2,mount_tag=fs2,bus=pci.0,addr=0x4 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 313d1e684f..4b76dd1665 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:4c:e3:86,bus=pci.0,addr=0x3 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index 0ce0be2bc8..64559a1150 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.0,addr=0x2 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index deab063476..f8f12ada5c 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d2:70:0b,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index f35385702a..7db2d691d6 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -- 2.25.1

On Wed, 12 Jan 2022, Divya Garg wrote:
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/qemu/qemu_command.c | 25 +++++++++++++++---- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +-- .../name-escape.x86_64-latest.args | 4 +-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +-- .../serial-many-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev-verify.args | 4 +-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev.args | 4 +-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-secret-chardev.args | 4 +-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +-- .../serial-udp-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +-- .../serial-unix-chardev.x86_64-latest.args | 4 +-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 88 insertions(+), 73 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret;
type should match the return type of this function. ret should be defined as virJSONValue. I preferred your previous style to this one. Also please rebase this patch to the latest git HEAD and run "ninja test" to make sure all tests passes. When I applied this patch to my tree, qemuxml2argvtest failed. I think some more xmls needs fixing.
switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: @@ -10750,11 +10752,24 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + typestr = virDomainChrSerialTargetModelTypeToString(serial->targetModel); + + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL); + } else { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL); + } + + if (ret < 0) return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index afaf50d4ba..e91e3c349f 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args index cd81c2cec9..66cb02b1c6 100644 --- a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 241449f75d..a246c08b12 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args index bdd0254499..19939030ad 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -34,10 +34,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-foo=1,bar=2/.config \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -audiodev '{"id":"audio1","driver":"spice"}' \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 49e0f6794e..afaff44212 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index bcca630616..bcaf66f88d 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args index 94d76fac91..067fa6987f 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index fb5276bc5f..0bf5d6ceb0 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args index fe46edb5f6..a76bf66f8f 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index db46920bab..4ec07d9b1f 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args index 02a5bbc121..308e73c0b9 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args @@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index 3833413150..1ffa30d207 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args index 39c93eaa0c..558e189e86 100644 --- a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -add-fd set=0,fd=1750 \ -add-fd set=1,fd=1751 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on,logfile=/dev/fdset/1,logappend=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 11e187fead..e0005656ea 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args index c15fbeafb9..29be886c5d 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 9e0c483f3d..7d4c2a0d37 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args index 5ac813d814..5315f66849 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args @@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -audiodev '{"id":"audio1","driver":"spice"}' \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index 63b16ded13..de5af9c7ed 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args index f15a843909..bd98ea6be4 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index a804bdf7e6..2ac30c694c 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args index da4f1e8aae..67cedc30e9 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index a49f649309..302dc59394 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args index 45b1386916..58ae1338fa 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index 8e45fc5490..998413bf0f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args index 7b9b49b1cb..7f72c2d045 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index 8e45fc5490..998413bf0f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args index 7b9b49b1cb..7f72c2d045 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 23331ed1d4..17926d7a11 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args index 1ce871f3cf..7ff4f6c5b2 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args @@ -32,11 +32,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"secret","id":"charserial1-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"passwordid":"charserial1-secret0"}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9e5e909881..93bf2f4f0d 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args index 48b44f8ffd..2c8b2bd117 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 6f533a991a..4192ef5621 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index b8adaa39bc..27388d1351 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index 65b1473c70..6870f976e4 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args index 5c59309ad5..81f51dc8d7 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 248469a668..bcd901da90 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 697bb1e655..92e4c770e2 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device virtio-9p-pci,id=fs3,fsdev=fsdev-fs3,mount_tag=fs3,bus=pci.0,addr=0x5 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index e52826f2c4..cd8948de04 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device virtio-9p-pci,id=fs2,fsdev=fsdev-fs2,mount_tag=fs2,bus=pci.0,addr=0x4 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 313d1e684f..4b76dd1665 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:4c:e3:86,bus=pci.0,addr=0x3 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index 0ce0be2bc8..64559a1150 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.0,addr=0x2 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index deab063476..f8f12ada5c 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d2:70:0b,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index f35385702a..7db2d691d6 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -- 2.25.1

On Thu, 13 Jan 2022, Ani Sinha wrote:
On Wed, 12 Jan 2022, Divya Garg wrote:
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret;
type should match the return type of this function. ret should be defined as virJSONValue. I preferred your previous style to this one.
Also please rebase this patch to the latest git HEAD and run "ninja test" to make sure all tests passes. When I applied this patch to my tree, qemuxml2argvtest failed. I think some more xmls needs fixing.
oops! forgot to prune the huge set of xml changes not relavent to the context of my response from my last email. Apologies for that.

On 13/01/22 3:16 pm, Ani Sinha wrote:
On Thu, 13 Jan 2022, Ani Sinha wrote:
On Wed, 12 Jan 2022, Divya Garg wrote:
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret; type should match the return type of this function. ret should be defined as virJSONValue. I preferred your previous style to this one.
Also please rebase this patch to the latest git HEAD and run "ninja test" to make sure all tests passes. When I applied this patch to my tree, qemuxml2argvtest failed. I think some more xmls needs fixing.
oops! forgot to prune the huge set of xml changes not relavent to the context of my response from my last email. Apologies for that.
Thankyou so much Ani ! Hope everything is working fine now.

Thanks Ani for giving your time to this patch. On 13/01/22 3:11 pm, Ani Sinha wrote:
On Wed, 12 Jan 2022, Divya Garg wrote:
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/qemu/qemu_command.c | 25 +++++++++++++++---- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +-- .../name-escape.x86_64-latest.args | 4 +-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +-- .../serial-many-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev-verify.args | 4 +-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev.args | 4 +-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-secret-chardev.args | 4 +-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +-- .../serial-udp-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +-- .../serial-unix-chardev.x86_64-latest.args | 4 +-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 88 insertions(+), 73 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret; type should match the return type of this function. ret should be defined as virJSONValue. I preferred your previous style to this one.
@john.levon will you like to give your thoughts here ?
Also please rebase this patch to the latest git HEAD and run "ninja test" to make sure all tests passes. When I applied this patch to my tree, qemuxml2argvtest failed. I think some more xmls needs fixing.
Thanks for taking the pain and checking.
switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: @@ -10750,11 +10752,24 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + typestr = virDomainChrSerialTargetModelTypeToString(serial->targetModel); + + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL); + } else { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL); + } + + if (ret < 0) return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index afaf50d4ba..e91e3c349f 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args index cd81c2cec9..66cb02b1c6 100644 --- a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 241449f75d..a246c08b12 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args index bdd0254499..19939030ad 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -34,10 +34,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-foo=1,bar=2/.config \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -audiodev '{"id":"audio1","driver":"spice"}' \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 49e0f6794e..afaff44212 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index bcca630616..bcaf66f88d 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args index 94d76fac91..067fa6987f 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index fb5276bc5f..0bf5d6ceb0 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args index fe46edb5f6..a76bf66f8f 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index db46920bab..4ec07d9b1f 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args index 02a5bbc121..308e73c0b9 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args @@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index 3833413150..1ffa30d207 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args index 39c93eaa0c..558e189e86 100644 --- a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -add-fd set=0,fd=1750 \ -add-fd set=1,fd=1751 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on,logfile=/dev/fdset/1,logappend=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 11e187fead..e0005656ea 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args index c15fbeafb9..29be886c5d 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index a4fbf3a2f2..936f375100 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args index 688baaf2aa..5eafadd428 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 9e0c483f3d..7d4c2a0d37 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args index 5ac813d814..5315f66849 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args @@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -audiodev '{"id":"audio1","driver":"spice"}' \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index 63b16ded13..de5af9c7ed 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args index f15a843909..bd98ea6be4 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index a804bdf7e6..2ac30c694c 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args index da4f1e8aae..67cedc30e9 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index a49f649309..302dc59394 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args index 45b1386916..58ae1338fa 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index 8e45fc5490..998413bf0f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args index 7b9b49b1cb..7f72c2d045 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index 8e45fc5490..998413bf0f 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args index 7b9b49b1cb..7f72c2d045 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 23331ed1d4..17926d7a11 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args index 1ce871f3cf..7ff4f6c5b2 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args @@ -32,11 +32,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object '{"qom-type":"secret","id":"charserial1-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"passwordid":"charserial1-secret0"}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9e5e909881..93bf2f4f0d 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args index 48b44f8ffd..2c8b2bd117 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 6f533a991a..4192ef5621 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index b8adaa39bc..27388d1351 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index 65b1473c70..6870f976e4 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args index 5c59309ad5..81f51dc8d7 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 248469a668..bcd901da90 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 697bb1e655..92e4c770e2 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device virtio-9p-pci,id=fs3,fsdev=fsdev-fs3,mount_tag=fs3,bus=pci.0,addr=0x5 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index e52826f2c4..cd8948de04 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device virtio-9p-pci,id=fs2,fsdev=fsdev-fs2,mount_tag=fs2,bus=pci.0,addr=0x4 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 313d1e684f..4b76dd1665 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:4c:e3:86,bus=pci.0,addr=0x3 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index 0ce0be2bc8..64559a1150 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.0,addr=0x2 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index deab063476..f8f12ada5c 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d2:70:0b,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index f35385702a..7db2d691d6 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -audiodev '{"id":"audio1","driver":"none"}' \ -- 2.25.1

On Thu, Jan 13, 2022 at 03:11:51PM +0530, Ani Sinha wrote:
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret;
type should match the return type of this function.
It does match return type of virDomainChrSerialTargetModelTypeToString(): 47 #define VIR_ENUM_DECL(name) \ 48 const char *name ## TypeToString(int type); \
ret should be defined as virJSONValue.
"int" is correct: 358 int 359 virJSONValueObjectAdd(virJSONValue **objptr, ...)
I preferred your previous style to this one.
Below is cleaner IMO: we don't repeat code, and the flow is much clearer.
switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: @@ -10750,11 +10752,24 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + typestr = virDomainChrSerialTargetModelTypeToString(serial->targetModel); + + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL); + } else { + ret = virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL); + } + + if (ret < 0) return NULL;
regards john

On Thu, Jan 13, 2022 at 4:50 PM John Levon <levon@movementarian.org> wrote:
On Thu, Jan 13, 2022 at 03:11:51PM +0530, Ani Sinha wrote:
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret;
type should match the return type of this function.
It does match return type of virDomainChrSerialTargetModelTypeToString():
47 #define VIR_ENUM_DECL(name) \
48 const char *name ## TypeToString(int type); \
Yes you are correct. I was thinking of qemuBuildSerialChrDeviceProps() but it does not return ret directly from this function. Another reason it makes me uncomfortable.
I preferred your previous style to this one.
Below is cleaner IMO: we don't repeat code, and the flow is much clearer.
If you look at other functions for example qemuBuildVirtioDevProps() etc they follow the previous style. I think it's fine to return NULL from multiple points. In any case if the maintainers are fine with it , I'm ok. Style is trivial.

On 13/01/22 6:47 pm, Ani Sinha wrote:
On Thu, Jan 13, 2022 at 4:50 PM John Levon <levon@movementarian.org> wrote:
On Thu, Jan 13, 2022 at 03:11:51PM +0530, Ani Sinha wrote:
> > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c > > index d822533ccb..4130df0ed9 100644 > > --- a/src/qemu/qemu_command.c > > +++ b/src/qemu/qemu_command.c > > @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, > > g_autoptr(virJSONValue) props = NULL; > > g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); > > virQEMUCapsFlags caps; > > + const char *typestr; > > + int ret; > > type should match the return type of this function.
It does match return type of virDomainChrSerialTargetModelTypeToString():
47 #define VIR_ENUM_DECL(name) \ 48 const char *name ## TypeToString(int type); \
Yes you are correct. I was thinking of qemuBuildSerialChrDeviceProps() but it does not return ret directly from this function. Another reason it makes me uncomfortable.
> I preferred your previous style to this one.
Below is cleaner IMO: we don't repeat code, and the flow is much clearer.
If you look at other functions for example qemuBuildVirtioDevProps() etc they follow the previous style. I think it's fine to return NULL from multiple points. In any case if the maintainers are fine with it , I'm ok. Style is trivial.
Thankyou Ani ! Let me know if I need to update anything else for the patch. Thanks :)

On Thu, Jan 13, 2022 at 06:47:26PM +0530, Ani Sinha wrote:
I preferred your previous style to this one.
Below is cleaner IMO: we don't repeat code, and the flow is much clearer.
If you look at other functions for example qemuBuildVirtioDevProps() etc they follow the previous style. I think it's fine to return NULL from multiple points. In any case if the maintainers are fine with it , I'm ok. Style is trivial.
Sure, either is fine with me too, if needed. regards john

On 1/13/22 08:33, Divya Garg wrote:
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/qemu/qemu_command.c | 25 +++++++++++++++---- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +-- .../name-escape.x86_64-latest.args | 4 +-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +-- .../serial-many-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev-verify.args | 4 +-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev.args | 4 +-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-secret-chardev.args | 4 +-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +-- .../serial-udp-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +-- .../serial-unix-chardev.x86_64-latest.args | 4 +-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 88 insertions(+), 73 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret;
This is a bit confusing. Usually, we use @ret for keeping return value from the function its defined in. In this specific case, @ret would hold the retval of qemuBuildSerialChrDeviceProps() and thus would have to be type of virJSONValue*. If you want to keep an intermediary retval of a function called from within we use other names, like rc, rv, tmp. But fortunatelly, we can do without @ret and even without @typestr.
switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: @@ -10750,11 +10752,24 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0)
There's no need to remove this code, especially when you're replacing it with itself. The pattern that we can use here is: if (virJSONValueObjectAdd(&props, ...) < 0) /* this is the unchanged return NULL; call */ if (serial->targetModel == ISA_SERIAL && virJSONValueObjectAdd(&props, "k:index", serial->target.port, NULL) < 0) return NULL; Michal

On Thu, Jan 13, 2022 at 03:43:12PM +0100, Michal Prívozník wrote:
switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: @@ -10750,11 +10752,24 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0)
There's no need to remove this code, especially when you're replacing it with itself. The pattern that we can use here is:
if (virJSONValueObjectAdd(&props, ...) < 0) /* this is the unchanged return NULL; call */
if (serial->targetModel == ISA_SERIAL && virJSONValueObjectAdd(&props, "k:index", serial->target.port, NULL) < 0) return NULL;
Ah yes, much better, thanks! regards john

VM XML accepts target.port but this does not get passed while building the qemu command line for this VM.
Signed-off-by: Divya Garg <divya.garg@nutanix.com> --- src/qemu/qemu_command.c | 25 +++++++++++++++---- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 +-- .../name-escape.x86_64-latest.args | 4 +-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 +-- .../serial-many-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 +-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev-verify.args | 4 +-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-chardev.args | 4 +-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 +-- .../serial-tcp-tlsx509-secret-chardev.args | 4 +-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 +-- .../serial-udp-chardev.x86_64-latest.args | 4 +-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 +-- .../serial-unix-chardev.x86_64-latest.args | 4 +-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 +-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 88 insertions(+), 73 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..4130df0ed9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10718,6 +10718,8 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); virQEMUCapsFlags caps; + const char *typestr; + int ret; This is a bit confusing. Usually, we use @ret for keeping return value from the function its defined in. In this specific case, @ret would hold
On 1/13/22 08:33, Divya Garg wrote: the retval of qemuBuildSerialChrDeviceProps() and thus would have to be type of virJSONValue*. If you want to keep an intermediary retval of a function called from within we use other names, like rc, rv, tmp. Sure ! I will keep these things in mind in future.
But fortunatelly, we can do without @ret and even without @typestr. Yeah earlier I was doing it in this manner only but just to increase the readibility I did this change. But understood how to even optimise the
On 13/01/22 8:13 pm, Michal Prívozník wrote: lines. Thankyou !!
switch ((virDomainChrSerialTargetModel) serial->targetModel) { case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: @@ -10750,11 +10752,24 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0)
There's no need to remove this code, especially when you're replacing it with itself. The pattern that we can use here is:
if (virJSONValueObjectAdd(&props, ...) < 0) /* this is the unchanged return NULL; call */
if (serial->targetModel == ISA_SERIAL && virJSONValueObjectAdd(&props, "k:index", serial->target.port, NULL) < 0) return NULL;
Michal
I was actually getting some extra NULL value while experimenting. I must be doing something wrong here for sure. Thanks for taking it Michal !!

On 1/13/22 08:33, Divya Garg wrote:
Issue
Divya Garg (2): Add the port allocation logic for isa-serial devices. qemu: add index for isa-serial device using target.port
61 files changed, 156 insertions(+), 90 deletions(-)
Hey, couple of points. Usually, when sending new version we do so in a new thread. And we don't CC random people. Us, developers, are subscribed to the list. Anyway, I'm raising only very basic nitpicks with your patches. I'll squash in the fixes I'm suggesting before pushing. Speaking of which, we are currently in freeze, preparing for tomorrow's release. so I'll push these tomorrow. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal

On Thu, Jan 13, 2022 at 20:13 Michal Prívozník <mprivozn@redhat.com> wrote:
Speaking of which, we are currently in freeze, preparing for tomorrow's release. so I'll push
On 1/13/22 08:33, Divya Garg wrote: these tomorrow.
Shouldn’t the bug fix patch have been part of tomorrows release? I thought bug fixes can be merged even when there is a code freeze. Just trying to understand the process here.

On Thu, Jan 13, 2022 at 21:27:24 +0530, Ani Sinha wrote:
On Thu, Jan 13, 2022 at 20:13 Michal Prívozník <mprivozn@redhat.com> wrote:
Speaking of which, we are currently in freeze, preparing for tomorrow's release. so I'll push
On 1/13/22 08:33, Divya Garg wrote: these tomorrow.
Shouldn’t the bug fix patch have been part of tomorrows release? I thought bug fixes can be merged even when there is a code freeze. Just trying to understand the process here.
No, this change is too invasive IMO and Michal seems to think the same. The boundaries are not exact and it's up to the person commiting/approving the code to make the ultimative decision. But the gist is that you don't push into a RC something which might break the release.

On 13/01/22 9:41 pm, Peter Krempa wrote:
On Thu, Jan 13, 2022 at 21:27:24 +0530, Ani Sinha wrote:
On Thu, Jan 13, 2022 at 20:13 Michal Prívozník<mprivozn@redhat.com> wrote:
Speaking of which, we are currently in freeze, preparing for tomorrow's release. so I'll push
On 1/13/22 08:33, Divya Garg wrote: these tomorrow.
Shouldn’t the bug fix patch have been part of tomorrows release? I thought bug fixes can be merged even when there is a code freeze. Just trying to understand the process here. No, this change is too invasive IMO and Michal seems to think the same. The boundaries are not exact and it's up to the person commiting/approving the code to make the ultimative decision. But the gist is that you don't push into a RC something which might break the release. Hi ! Thankyou so much. So will you like me to post a new iteration, since today has a code freeze anyway ? Or will it be okay to merge this change ?

On Thu, Jan 13, 2022 at 10:30 PM Divya Garg <divya.garg@nutanix.com> wrote:
On 13/01/22 9:41 pm, Peter Krempa wrote:
On Thu, Jan 13, 2022 at 21:27:24 +0530, Ani Sinha wrote:
On Thu, Jan 13, 2022 at 20:13 Michal Prívozník <mprivozn@redhat.com> <mprivozn@redhat.com> wrote:
On 1/13/22 08:33, Divya Garg wrote:
Speaking of which, we
are currently in freeze, preparing for tomorrow's release. so I'll push these tomorrow.
Shouldn’t the bug fix patch have been part of tomorrows release? I thought bug fixes can be merged even when there is a code freeze. Just trying to understand the process here.
No, this change is too invasive IMO and Michal seems to think the same. The boundaries are not exact and it's up to the person commiting/approving the code to make the ultimative decision. But the gist is that you don't push into a RC something which might break the release.
Hi ! Thankyou so much. So will you like me to post a new iteration, since today has a code freeze anyway ? Or will it be okay to merge this change ?
Michal has already said he will push your change after the release tomorrow. At the same time he will fix things he was suggesting. So you can relax and wait for him to push. No need to churn out a new iteration.

On 1/13/22 15:43, Michal Prívozník wrote:
On 1/13/22 08:33, Divya Garg wrote:
Issue
Divya Garg (2): Add the port allocation logic for isa-serial devices. qemu: add index for isa-serial device using target.port
61 files changed, 156 insertions(+), 90 deletions(-)
Hey, couple of points. Usually, when sending new version we do so in a new thread. And we don't CC random people. Us, developers, are subscribed to the list.
Anyway, I'm raising only very basic nitpicks with your patches. I'll squash in the fixes I'm suggesting before pushing. Speaking of which, we are currently in freeze, preparing for tomorrow's release. so I'll push these tomorrow.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This is now pushed. Congratulations on your first libvirt contribution! Michal

On 14/01/22 8:17 pm, Michal Prívozník wrote:
On 1/13/22 15:43, Michal Prívozník wrote:
On 1/13/22 08:33, Divya Garg wrote:
Issue Divya Garg (2): Add the port allocation logic for isa-serial devices. qemu: add index for isa-serial device using target.port
61 files changed, 156 insertions(+), 90 deletions(-)
Hey, couple of points. Usually, when sending new version we do so in a new thread. And we don't CC random people. Us, developers, are subscribed to the list.
Anyway, I'm raising only very basic nitpicks with your patches. I'll squash in the fixes I'm suggesting before pushing. Speaking of which, we are currently in freeze, preparing for tomorrow's release. so I'll push these tomorrow.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This is now pushed. Congratulations on your first libvirt contribution!
Michal Thankyou Michal !!

On 1/13/22 08:33, Divya Garg wrote:
Issue Divya Garg (2): Add the port allocation logic for isa-serial devices. qemu: add index for isa-serial device using target.port
61 files changed, 156 insertions(+), 90 deletions(-)
Hey, couple of points. Usually, when sending new version we do so in a new thread. And we don't CC random people. Us, developers, are subscribed to the list. Hi Michal ! Actually I was told to CC all those who commented on the patch atleast once ! Hence added them in CC. But in future I will take care of
On 13/01/22 8:13 pm, Michal Prívozník wrote: this. Thankyou !!
Anyway, I'm raising only very basic nitpicks with your patches. I'll squash in the fixes I'm suggesting before pushing. Speaking of which, we are currently in freeze, preparing for tomorrow's release. so I'll push these tomorrow.
Thankyou so much !!
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Michal

VM XML accepts target.port but this does not get passed while building the qemu command line for this VM. --- src/qemu/qemu_command.c | 22 ++++++++++++++----- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 ++-- .../name-escape.x86_64-latest.args | 4 ++-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 ++-- .../serial-many-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 ++-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-chardev-verify.args | 4 ++-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-chardev.args | 4 ++-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-secret-chardev.args | 4 ++-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 ++-- .../serial-udp-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 ++-- .../serial-unix-chardev.x86_64-latest.args | 4 ++-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 ++-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 85 insertions(+), 73 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..a1fd5443be 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10717,6 +10717,7 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, { g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); + const char *typestr; virQEMUCapsFlags caps; switch ((virDomainChrSerialTargetModel) serial->targetModel) { @@ -10750,11 +10751,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; } - if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + typestr = virDomainChrSerialTargetModelTypeToString(serial->targetModel); + + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL; if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args index 17a356b480..d2a1f1b884 100644 --- a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args index 336ea5f4d4..c330dd52f3 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -34,10 +34,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-foo=1,bar=2/.config \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -device '{"driver":"ccid-card-emulated","backend":"certificates","cert1":"cert1,foo","cert2":"cert2","cert3":"cert3","db":"/etc/pki/nssdb,foo","id":"smartcard0","bus":"ccid0.0"}' \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":1}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":0}' \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -audiodev '{"id":"audio1","driver":"spice"}' \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args index 512d1f7e9d..45e1584a5e 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","iobase":1016,"irq":4}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0,"iobase":1016,"irq":4}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args index cfa0f8ce02..746f6d34a1 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args index 9c7fd01f97..355599ca41 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args @@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args index f7f59bc542..2444e64345 100644 --- a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -add-fd set=0,fd=1750 \ -add-fd set=1,fd=1751 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on,logfile=/dev/fdset/1,logappend=on \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args index 1e0f0110bf..22268f8d1b 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args index f552782edf..e20e3c5cb6 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args @@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ -audiodev '{"id":"audio1","driver":"spice"}' \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args index 33e6215ebb..3b7d32b967 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args index 4433ce50f5..46e3878552 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args index f4c3ca4cbd..660d11d358 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args index 39d8c562c0..20a0872d68 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args index 39d8c562c0..20a0872d68 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args index 4f20639bcf..577ff2fbf6 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args @@ -32,11 +32,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"secret","id":"charserial1-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"passwordid":"charserial1-secret0"}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args index 95e6e6ed90..95e2dc98e6 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args index d15062b94f..f08dd46e63 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev vc,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -- 2.25.1

SOB line is missing. Patches are not accepted without SOB. On Mon, 10 Jan 2022, Divya Garg wrote:
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM. --- src/qemu/qemu_command.c | 22 ++++++++++++++----- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 ++-- .../name-escape.x86_64-latest.args | 4 ++-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 ++-- .../serial-many-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 ++-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-chardev-verify.args | 4 ++-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-chardev.args | 4 ++-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-secret-chardev.args | 4 ++-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 ++-- .../serial-udp-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 ++-- .../serial-unix-chardev.x86_64-latest.args | 4 ++-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 ++-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 85 insertions(+), 73 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..a1fd5443be 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10717,6 +10717,7 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, { g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); + const char *typestr; virQEMUCapsFlags caps;
switch ((virDomainChrSerialTargetModel) serial->targetModel) { @@ -10750,11 +10751,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + typestr = virDomainChrSerialTargetModelTypeToString(serial->targetModel); + + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args index 17a356b480..d2a1f1b884 100644 --- a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args index 336ea5f4d4..c330dd52f3 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -34,10 +34,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-foo=1,bar=2/.config \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -device '{"driver":"ccid-card-emulated","backend":"certificates","cert1":"cert1,foo","cert2":"cert2","cert3":"cert3","db":"/etc/pki/nssdb,foo","id":"smartcard0","bus":"ccid0.0"}' \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":1}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":0}' \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -audiodev '{"id":"audio1","driver":"spice"}' \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args index 512d1f7e9d..45e1584a5e 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","iobase":1016,"irq":4}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0,"iobase":1016,"irq":4}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args index cfa0f8ce02..746f6d34a1 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args index 9c7fd01f97..355599ca41 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args @@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args index f7f59bc542..2444e64345 100644 --- a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -add-fd set=0,fd=1750 \ -add-fd set=1,fd=1751 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on,logfile=/dev/fdset/1,logappend=on \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args index 1e0f0110bf..22268f8d1b 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args index f552782edf..e20e3c5cb6 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args @@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ -audiodev '{"id":"audio1","driver":"spice"}' \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args index 33e6215ebb..3b7d32b967 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args index 4433ce50f5..46e3878552 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args index f4c3ca4cbd..660d11d358 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args index 39d8c562c0..20a0872d68 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args index 39d8c562c0..20a0872d68 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args index 4f20639bcf..577ff2fbf6 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args @@ -32,11 +32,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"secret","id":"charserial1-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"passwordid":"charserial1-secret0"}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args index 95e6e6ed90..95e2dc98e6 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args index d15062b94f..f08dd46e63 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev vc,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -- 2.25.1

On 11/01/22 4:08 pm, Ani Sinha wrote:
SOB line is missing. Patches are not accepted without SOB.
I am extremely sorry I forgot to add it. Thankyou so much.
On Mon, 10 Jan 2022, Divya Garg wrote:
VM XML accepts target.port but this does not get passed while building the qemu command line for this VM. --- src/qemu/qemu_command.c | 22 ++++++++++++++----- tests/qemuxml2argvdata/bios.args | 2 +- .../qemuxml2argvdata/console-compat-auto.args | 2 +- .../console-compat-auto.x86_64-latest.args | 2 +- .../console-compat-chardev.args | 2 +- .../console-compat-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/console-compat.args | 2 +- .../console-compat.x86_64-latest.args | 2 +- .../qemuxml2argvdata/console-virtio-many.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- .../name-escape.x86_64-2.11.0.args | 4 ++-- .../name-escape.x86_64-latest.args | 4 ++-- .../q35-virt-manager-basic.args | 2 +- .../serial-dev-chardev-iobase.args | 2 +- ...rial-dev-chardev-iobase.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-dev-chardev.args | 2 +- .../serial-dev-chardev.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-file-chardev.args | 2 +- .../serial-file-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-file-log.args | 2 +- .../serial-file-log.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-many-chardev.args | 4 ++-- .../serial-many-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-pty-chardev.args | 2 +- .../serial-pty-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/serial-spiceport.args | 2 +- .../serial-spiceport.x86_64-latest.args | 2 +- .../qemuxml2argvdata/serial-tcp-chardev.args | 2 +- .../serial-tcp-chardev.x86_64-latest.args | 2 +- .../serial-tcp-telnet-chardev.args | 2 +- ...rial-tcp-telnet-chardev.x86_64-latest.args | 2 +- .../serial-tcp-tlsx509-chardev-notls.args | 4 ++-- ...p-tlsx509-chardev-notls.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-chardev-verify.args | 4 ++-- ...-tlsx509-chardev-verify.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-chardev.args | 4 ++-- ...ial-tcp-tlsx509-chardev.x86_64-latest.args | 4 ++-- .../serial-tcp-tlsx509-secret-chardev.args | 4 ++-- ...-tlsx509-secret-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-udp-chardev.args | 4 ++-- .../serial-udp-chardev.x86_64-latest.args | 4 ++-- .../qemuxml2argvdata/serial-unix-chardev.args | 4 ++-- .../serial-unix-chardev.x86_64-latest.args | 4 ++-- tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +- .../serial-vc-chardev.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 4 ++-- .../virtio-9p-createmode.x86_64-latest.args | 2 +- .../virtio-9p-multidevs.x86_64-latest.args | 2 +- .../x86_64-pc-graphics.x86_64-latest.args | 2 +- .../x86_64-pc-headless.x86_64-latest.args | 2 +- .../x86_64-q35-graphics.x86_64-latest.args | 2 +- .../x86_64-q35-headless.x86_64-latest.args | 2 +- 52 files changed, 85 insertions(+), 73 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..a1fd5443be 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10717,6 +10717,7 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, { g_autoptr(virJSONValue) props = NULL; g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias); + const char *typestr; virQEMUCapsFlags caps;
switch ((virDomainChrSerialTargetModel) serial->targetModel) { @@ -10750,11 +10751,22 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *def, return NULL; }
- if (virJSONValueObjectAdd(&props, - "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel), - "s:chardev", chardev, - "s:id", serial->info.alias, - NULL) < 0) + typestr = virDomainChrSerialTargetModelTypeToString(serial->targetModel); + + if (serial->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL) { + if (virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + "k:index", serial->target.port, + NULL) < 0) + return NULL; + } + else if (virJSONValueObjectAdd(&props, + "s:driver", typestr, + "s:chardev", chardev, + "s:id", serial->info.alias, + NULL) < 0) return NULL;
if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0) diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios.args index 0469b7419e..62ec87541d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.args b/tests/qemuxml2argvdata/console-compat-auto.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.args +++ b/tests/qemuxml2argvdata/console-compat-auto.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-auto.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat-chardev.args b/tests/qemuxml2argvdata/console-compat-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/console-compat.args b/tests/qemuxml2argvdata/console-compat.args index 9f37788586..709a82faad 100644 --- a/tests/qemuxml2argvdata/console-compat.args +++ b/tests/qemuxml2argvdata/console-compat.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args index 17a356b480..d2a1f1b884 100644 --- a/tests/qemuxml2argvdata/console-compat.x86_64-latest.args +++ b/tests/qemuxml2argvdata/console-compat.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/console-virtio-many.args b/tests/qemuxml2argvdata/console-virtio-many.args index dc1aca1129..b509cd55b5 100644 --- a/tests/qemuxml2argvdata/console-virtio-many.args +++ b/tests/qemuxml2argvdata/console-virtio-many.args @@ -31,7 +31,7 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charconsole1 \ -device virtconsole,chardev=charconsole1,id=console1 \ -chardev pty,id=charconsole2 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 51571a27bf..51fa04dfd8 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -37,7 +37,7 @@ QEMU_AUDIO_DRV=spice \ -chardev spicevmc,id=charsmartcard0,name=smartcard \ -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev spicevmc,id=charchannel0,name=vdagent \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args index 1ce91ff354..a57adedfa5 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-2.11.0.args @@ -32,9 +32,9 @@ QEMU_AUDIO_DRV=spice \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,write-cache=on \ -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=1 \ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=0 \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -vnc vnc=unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \ diff --git a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args index 336ea5f4d4..c330dd52f3 100644 --- a/tests/qemuxml2argvdata/name-escape.x86_64-latest.args +++ b/tests/qemuxml2argvdata/name-escape.x86_64-latest.args @@ -34,10 +34,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-foo=1,bar=2/.config \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -device '{"driver":"ccid-card-emulated","backend":"certificates","cert1":"cert1,foo","cert2":"cert2","cert3":"cert3","db":"/etc/pki/nssdb,foo","id":"smartcard0","bus":"ccid0.0"}' \ -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":1}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":0}' \ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \ -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \ -audiodev '{"id":"audio1","driver":"spice"}' \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.args index 6e84c9ca2a..a33a74e355 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.args @@ -40,7 +40,7 @@ QEMU_AUDIO_DRV=spice \ -netdev user,id=hostnet0 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9a:e6:c6,bus=pci.1,addr=0x0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charchannel0,path=/tmp/channel/domain--1-virt-manager-basic/org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -chardev spicevmc,id=charchannel1,name=vdagent \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args index dfa6785795..1f358b6469 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0,iobase=1016,irq=4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args index 512d1f7e9d..45e1584a5e 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","iobase":1016,"irq":4}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0,"iobase":1016,"irq":4}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.args b/tests/qemuxml2argvdata/serial-dev-chardev.args index c325f21e0c..47da5b8454 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args index cfa0f8ce02..746f6d34a1 100644 --- a/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev tty,id=charserial0,path=/dev/ttyS2 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-chardev.args b/tests/qemuxml2argvdata/serial-file-chardev.args index 4cbd0edf1c..5b8f3be45a 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,append=on \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args index 9c7fd01f97..355599ca41 100644 --- a/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-chardev.x86_64-latest.args @@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-file-log.args b/tests/qemuxml2argvdata/serial-file-log.args index c4c6106200..9ee066ef49 100644 --- a/tests/qemuxml2argvdata/serial-file-log.args +++ b/tests/qemuxml2argvdata/serial-file-log.args @@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev file,id=charserial0,path=/tmp/serial.log,logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args index f7f59bc542..2444e64345 100644 --- a/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-file-log.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -add-fd set=0,fd=1750 \ -add-fd set=1,fd=1751 \ -chardev file,id=charserial0,path=/dev/fdset/0,append=on,logfile=/dev/fdset/1,logappend=on \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.args b/tests/qemuxml2argvdata/serial-many-chardev.args index 2c548c9e4b..da0d0b21c3 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev file,id=charserial1,path=/tmp/serial.log \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args index 1e0f0110bf..22268f8d1b 100644 --- a/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-many-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -add-fd set=0,fd=1750 \ -chardev file,id=charserial1,path=/dev/fdset/0,append=on \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.args b/tests/qemuxml2argvdata/serial-pty-chardev.args index 5285d0749a..9c459b641b 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args index 7b31c86820..bf25c0b771 100644 --- a/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-pty-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.args b/tests/qemuxml2argvdata/serial-spiceport.args index 43e65a0679..704e6d1820 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.args +++ b/tests/qemuxml2argvdata/serial-spiceport.args @@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=spice \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \ diff --git a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args index f552782edf..e20e3c5cb6 100644 --- a/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-spiceport.x86_64-latest.args @@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ -audiodev '{"id":"audio1","driver":"spice"}' \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.args b/tests/qemuxml2argvdata/serial-tcp-chardev.args index aec7093d03..263add4409 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args index 33e6215ebb..3b7d32b967 100644 --- a/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args index 72f81d7938..13e092c4c7 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args index 4433ce50f5..46e3878552 100644 --- a/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-telnet-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev socket,id=charserial0,host=127.0.0.1,port=9999,telnet=on,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args index 7db40862e9..8bf070d820 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args index f4c3ca4cbd..660d11d358 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args index 39d8c562c0..20a0872d68 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev-verify.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args index f3dc5f5019..374d24ec00 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.args @@ -30,9 +30,9 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args index 39d8c562c0..20a0872d68 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-chardev.x86_64-latest.args @@ -32,10 +32,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args index 151629458b..2defeb28da 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.args @@ -30,10 +30,10 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -object secret,id=charserial1-secret0,data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \ -object tls-creds-x509,id=objcharserial1_tls0,dir=/etc/pki/libvirt-chardev,endpoint=client,verify-peer=on,passwordid=charserial1-secret0 \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args index 4f20639bcf..577ff2fbf6 100644 --- a/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args @@ -32,11 +32,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -object '{"qom-type":"secret","id":"charserial1-secret0","data":"9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1","keyid":"masterKey0","iv":"AAECAwQFBgcICQoLDA0ODw==","format":"base64"}' \ -object '{"qom-type":"tls-creds-x509","id":"objcharserial1_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true,"passwordid":"charserial1-secret0"}' \ -chardev socket,id=charserial1,host=127.0.0.1,port=5555,tls-creds=objcharserial1_tls0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.args b/tests/qemuxml2argvdata/serial-udp-chardev.args index 9d2f2e03e9..de6621f0e2 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.args @@ -30,8 +30,8 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args index 95e6e6ed90..95e2dc98e6 100644 --- a/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-udp-chardev.x86_64-latest.args @@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev udp,id=charserial0,host=127.0.0.1,port=9998,localaddr=127.0.0.1,localport=9999 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev udp,id=charserial1,host=,port=9999,localaddr=,localport=0 \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args index 19731b02b2..1e2444f824 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.args @@ -28,8 +28,8 @@ QEMU_AUDIO_DRV=none \ -boot strict=on \ -usb \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev socket,id=charserial1,path=/tmp/serial-server.sock,server=on,wait=off \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args index 1e3d5772b4..1387fc9a1d 100644 --- a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args @@ -29,9 +29,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -chardev socket,id=charserial0,path=/tmp/serial.sock \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charserial1,fd=1729,server=on,wait=off \ --device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1"}' \ +-device '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.args b/tests/qemuxml2argvdata/serial-vc-chardev.args index d28a3eee47..09b33a15ee 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.args @@ -30,6 +30,6 @@ QEMU_AUDIO_DRV=none \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -chardev vc,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args index d15062b94f..f08dd46e63 100644 --- a/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args +++ b/tests/qemuxml2argvdata/serial-vc-chardev.x86_64-latest.args @@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -chardev vc,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvdata/user-aliases.args index 486473a566..8608144b5e 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -55,9 +55,9 @@ QEMU_AUDIO_DRV=none \ -device rtl8139,netdev=hostua-AndAlsoClientMode,id=ua-AndAlsoClientMode,mac=52:54:00:8c:b1:f8,bus=pci.0,addr=0xa \ -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ua-myCCID.0 \ -chardev pty,id=charserial0 \ --device isa-serial,chardev=charserial0,id=serial0 \ +-device isa-serial,chardev=charserial0,id=serial0,index=0 \ -chardev pty,id=charserial1 \ --device isa-serial,chardev=charserial1,id=serial1 \ +-device isa-serial,chardev=charserial1,id=serial1,index=1 \ -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/gentoo.org.qemu.guest_agent.0,server=on,wait=off \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -vnc 127.0.0.1:0 \ diff --git a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args index 01fe01e3c6..d306b37b53 100644 --- a/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-createmode.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,id=fsdev-fs3,path=/export/fs3 \ -device '{"driver":"virtio-9p-pci","id":"fs3","fsdev":"fsdev-fs3","mount_tag":"fs3","bus":"pci.0","addr":"0x5"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args index 8b325bb7ec..0752f09fe9 100644 --- a/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-9p-multidevs.x86_64-latest.args @@ -35,7 +35,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -fsdev local,security_model=mapped,multidevs=warn,id=fsdev-fs2,path=/export/fs2 \ -device '{"driver":"virtio-9p-pci","id":"fs2","fsdev":"fsdev-fs2","mount_tag":"fs2","bus":"pci.0","addr":"0x4"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0xc"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args index 3cae9fafa0..8cad1d9f38 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -37,7 +37,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86","bus":"pci.0","addr":"0x3"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args index fbfb823d83..3c4688a89e 100644 --- a/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args @@ -38,7 +38,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args index ca0e00f468..9e4c361ec9 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -44,7 +44,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:d2:70:0b","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ diff --git a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args index c6970e349d..b4d90dff5e 100644 --- a/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args +++ b/tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args @@ -45,7 +45,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -netdev user,id=hostnet0 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ -chardev pty,id=charserial0 \ --device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0"}' \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -- 2.25.1
participants (9)
-
Ani Sinha
-
Daniel P. Berrangé
-
divya
-
Divya Garg
-
John Levon
-
John Levon
-
Michal Prívozník
-
Peter Krempa
-
“Divya