]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Don't use deprecated chardev backend drivers 'tty' and 'parport'
authorPeter Krempa <pkrempa@redhat.com>
Mon, 29 Aug 2022 13:34:56 +0000 (15:34 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 1 Sep 2022 11:11:10 +0000 (13:11 +0200)
The replacement is 'serial' and 'parallel' respectively introduced at
least in qemu-2.9 and the old versions are deprecated since qemu-6.0
(qemu commit 5965243641d797b22 ).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/name-escape.x86_64-latest.args
tests/qemuxml2argvdata/parallel-parport-chardev.args
tests/qemuxml2argvdata/parallel-parport-chardev.x86_64-latest.args
tests/qemuxml2argvdata/pci-serial-dev-chardev.args
tests/qemuxml2argvdata/pci-serial-dev-chardev.x86_64-latest.args
tests/qemuxml2argvdata/serial-dev-chardev-iobase.args
tests/qemuxml2argvdata/serial-dev-chardev-iobase.x86_64-latest.args
tests/qemuxml2argvdata/serial-dev-chardev.args
tests/qemuxml2argvdata/serial-dev-chardev.x86_64-latest.args

index 089d0493d95c6bd3751a92da8b94f53a0f57a071..58d29d83488ba420aecffa97e0a0d307cf084ed2 100644 (file)
@@ -1295,12 +1295,16 @@ qemuBuildChardevStr(const virDomainChrSourceDef *dev,
         virBufferAsprintf(&buf, "pty,id=%s", charAlias);
         break;
 
-    case VIR_DOMAIN_CHR_TYPE_DEV:
-        virBufferAsprintf(&buf, "%s,id=%s,path=",
-                          STRPREFIX(charAlias, "charparallel") ? "parport" : "tty",
-                          charAlias);
+    case VIR_DOMAIN_CHR_TYPE_DEV: {
+        const char *backend = "serial";
+
+        if (STRPREFIX(charAlias, "charparallel"))
+            backend = "parallel";
+
+        virBufferAsprintf(&buf, "%s,id=%s,path=", backend, charAlias);
         virQEMUBuildBufferEscapeComma(&buf, dev->data.file.path);
         break;
+    }
 
     case VIR_DOMAIN_CHR_TYPE_FILE:
         virBufferAsprintf(&buf, "file,id=%s", charAlias);
index b8ac17eee65aa280e11c4f5f698b55c239514c70..42b0ad32308c1ad0961411f8551301d683afc759 100644 (file)
@@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-foo=1,bar=2/.config \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
 -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 \
+-chardev serial,id=charserial0,path=/dev/ttyS2,,foo \
 -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":1}' \
 -add-fd set=0,fd=1750,opaque=serial1-source \
 -chardev file,id=charserial1,path=/dev/fdset/0,append=on \
index e3d3d6f3dbc9b0534aad18522ddd3ee254466c1e..66b398fe640fd19ebbdd214673b07f25d237bed9 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 parport,id=charparallel0,path=/dev/parport0 \
+-chardev parallel,id=charparallel0,path=/dev/parport0 \
 -device isa-parallel,chardev=charparallel0,id=parallel0 \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
index 2ce2e381bbd5e77b141bc5f1aabc16fdf1344289..6200251f1ef261f4998a55c832e45c88426ee133 100644 (file)
@@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 parport,id=charparallel0,path=/dev/parport0 \
+-chardev parallel,id=charparallel0,path=/dev/parport0 \
 -device '{"driver":"isa-parallel","chardev":"charparallel0","id":"parallel0"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
index 651b2732f5f21885d1c8a3bdaf4b796a90269f86..0cc0ef2c143474355d3919fed5e62cb9ae6dd1d1 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 \
+-chardev serial,id=charserial0,path=/dev/ttyS2 \
 -device pci-serial,chardev=charserial0,id=serial0,bus=pci.0,addr=0x4 \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
index c513ae03165d6f8fa59d702ecda39bf9a688f5ad..94d90b215cbc5017e420a544952745ae566ea5a1 100644 (file)
@@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 \
+-chardev serial,id=charserial0,path=/dev/ttyS2 \
 -device '{"driver":"pci-serial","chardev":"charserial0","id":"serial0","bus":"pci.0","addr":"0x4"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
index 735dcd053ac77623ec91cf678427089925ded676..32218842efc61a34aac06fc9bcc297f09997f9fa 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 \
+-chardev serial,id=charserial0,path=/dev/ttyS2 \
 -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 \
index a22237b68099513b5515842e172fdd777aafa6e6..3b5ce0a59b7a217b34d0748263cb67d6b223d60c 100644 (file)
@@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 \
+-chardev serial,id=charserial0,path=/dev/ttyS2 \
 -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"}' \
index 52f9c3d0bbfe7b56b5b5ef276ad4ff5da16c787e..ba8832f64fdffa245ab969d6c098eb48f46dd610 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 \
+-chardev serial,id=charserial0,path=/dev/ttyS2 \
 -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 \
index a19d3bb20969165efe6f6dcda5bb05fd5783fa22..ffa9bac1362cc8d4b5758de142f3450e980678ab 100644 (file)
@@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -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 \
+-chardev serial,id=charserial0,path=/dev/ttyS2 \
 -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"}' \