Upcoming qemu-9.2 will deprecate 'reconnect' in favor of 'reconnect-ms'. Add pinned versions so that we test also the old syntax. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- .../chardev-backends-json.x86_64-9.1.0.args | 79 ++++++++++ .../chardev-backends-json.x86_64-9.1.0.xml | 149 ++++++++++++++++++ .../chardev-backends.x86_64-9.1.0.args | 79 ++++++++++ .../chardev-backends.x86_64-9.1.0.xml | 149 ++++++++++++++++++ .../chardev-reconnect.x86_64-9.1.0.args | 46 ++++++ .../chardev-reconnect.x86_64-9.1.0.xml | 72 +++++++++ tests/qemuxmlconftest.c | 5 + 7 files changed, 579 insertions(+) create mode 100644 tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.args create mode 100644 tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.args create mode 100644 tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.args create mode 100644 tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.xml diff --git a/tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.args b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.args new file mode 100644 index 0000000000..98929ab39f --- /dev/null +++ b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.args @@ -0,0 +1,79 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-no-user-config \ +-nodefaults \ +-chardev '{"id":"charmonitor","backend":{"type":"socket","data":{"addr":{"type":"fd","data":{"str":"1729"}},"server":true,"wait":false}}}' \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x3"}' \ +-chardev '{"id":"charparallel0","backend":{"type":"parallel","data":{"device":"/dev/parport0"}}}' \ +-device '{"driver":"isa-parallel","chardev":"charparallel0","id":"parallel0"}' \ +-add-fd set=0,fd=1751,opaque=channel0-log \ +-chardev '{"id":"charchannel0","backend":{"type":"null","data":{"logfile":"/dev/fdset/0","logappend":true}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"chardev-null"}' \ +-add-fd set=1,fd=1751,opaque=channel1-log \ +-chardev '{"id":"charchannel1","backend":{"type":"vc","data":{"logfile":"/dev/fdset/1","logappend":true}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":2,"chardev":"charchannel1","id":"channel1","name":"chardev-vc"}' \ +-chardev '{"id":"charchannel2","backend":{"type":"pty","data":{}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":3,"chardev":"charchannel2","id":"channel2","name":"chardev-pty"}' \ +-chardev '{"id":"charchannel3","backend":{"type":"stdio","data":{}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":4,"chardev":"charchannel3","id":"channel3","name":"chardev-stdio"}' \ +-add-fd set=2,fd=1750,opaque=channel4-source \ +-chardev '{"id":"charchannel4","backend":{"type":"file","data":{"out":"/dev/fdset/2","append":true}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":5,"chardev":"charchannel4","id":"channel4","name":"chardev-file"}' \ +-chardev '{"id":"charchannel5","backend":{"type":"pipe","data":{"device":"/path/to/pipe"}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":6,"chardev":"charchannel5","id":"channel5","name":"chardev-pipe"}' \ +-chardev '{"id":"charchannel6","backend":{"type":"serial","data":{"device":"/path/to/device"}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":7,"chardev":"charchannel6","id":"channel6","name":"chardev-dev"}' \ +-chardev '{"id":"charchannel7","backend":{"type":"socket","data":{"addr":{"type":"fd","data":{"str":"1729"}},"server":true,"wait":false}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":8,"chardev":"charchannel7","id":"channel7","name":"chardev-unix-listen"}' \ +-chardev '{"id":"charchannel8","backend":{"type":"socket","data":{"addr":{"type":"unix","data":{"path":"/path/to/unix-listen"}},"server":false,"reconnect":2}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":9,"chardev":"charchannel8","id":"channel8","name":"chardev-unix-connect"}' \ +-chardev '{"id":"charchannel9","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"1.2.3.4","port":"5678"}},"telnet":false,"server":true,"wait":false}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":10,"chardev":"charchannel9","id":"channel9","name":"chardev-tcp-listen-raw"}' \ +-chardev '{"id":"charchannel10","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"1.2.3.4","port":"5679"}},"telnet":true,"server":true,"wait":false}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":11,"chardev":"charchannel10","id":"channel10","name":"chardev-tcp-listen-telnet"}' \ +-object '{"qom-type":"tls-creds-x509","id":"objcharchannel11_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ +-chardev '{"id":"charchannel11","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"1.2.3.4","port":"5678"}},"telnet":false,"server":false,"reconnect":2,"tls-creds":"objcharchannel11_tls0"}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":12,"chardev":"charchannel11","id":"channel11","name":"chardev-tcp-connect-raw"}' \ +-object '{"qom-type":"tls-creds-x509","id":"objcharchannel12_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ +-chardev '{"id":"charchannel12","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"hostname.global.","port":"5679"}},"telnet":true,"server":false,"reconnect":2,"tls-creds":"objcharchannel12_tls0"}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":13,"chardev":"charchannel12","id":"channel12","name":"chardev-tcp-connect-telnet"}' \ +-chardev '{"id":"charchannel13","backend":{"type":"udp","data":{"remote":{"type":"inet","data":{"host":"127.0.0.1","port":"2222"}}}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":14,"chardev":"charchannel13","id":"channel13","name":"chardev-udp-nobind"}' \ +-chardev '{"id":"charchannel14","backend":{"type":"udp","data":{"remote":{"type":"inet","data":{"host":"127.0.0.1","port":"2222"}},"local":{"type":"inet","data":{"host":"127.0.0.1","port":"1111"}}}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":15,"chardev":"charchannel14","id":"channel14","name":"chardev-udp-bind"}' \ +-chardev '{"id":"charchannel15","backend":{"type":"spicevmc","data":{"type":"vdagent"}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":16,"chardev":"charchannel15","id":"channel15","name":"com.redhat.spice.0"}' \ +-chardev '{"id":"charchannel16","backend":{"type":"qemu-vdagent","data":{"clipboard":false,"mouse":false}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":17,"chardev":"charchannel16","id":"channel16","name":"chardev-vdagent"}' \ +-chardev '{"id":"charchannel17","backend":{"type":"dbus","data":{"name":"test.channel.0"}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":18,"chardev":"charchannel17","id":"channel17","name":"chardev-dbus"}' \ +-chardev '{"id":"charchannel18","backend":{"type":"spiceport","data":{"fqdn":"test.channel.0"}}}' \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":19,"chardev":"charchannel18","id":"channel18","name":"chardev-spiceport"}' \ +-audiodev '{"id":"audio1","driver":"spice"}' \ +-spice port=5901,addr=0.0.0.0,seamless-migration=on \ +-device '{"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.xml b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.xml new file mode 100644 index 0000000000..57a16b5b7c --- /dev/null +++ b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-9.1.0.xml @@ -0,0 +1,149 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </controller> + <parallel type='dev'> + <source path='/dev/parport0'/> + <target port='0'/> + </parallel> + <channel type='null'> + <log file='/path/to/null.log' append='off'/> + <target type='virtio' name='chardev-null'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <channel type='vc'> + <log file='/path/to/vc.log' append='on'/> + <target type='virtio' name='chardev-vc'/> + <address type='virtio-serial' controller='0' bus='0' port='2'/> + </channel> + <channel type='pty'> + <target type='virtio' name='chardev-pty'/> + <address type='virtio-serial' controller='0' bus='0' port='3'/> + </channel> + <channel type='stdio'> + <target type='virtio' name='chardev-stdio'/> + <address type='virtio-serial' controller='0' bus='0' port='4'/> + </channel> + <channel type='file'> + <source path='/path/to/fileout'/> + <target type='virtio' name='chardev-file'/> + <address type='virtio-serial' controller='0' bus='0' port='5'/> + </channel> + <channel type='pipe'> + <source path='/path/to/pipe'/> + <target type='virtio' name='chardev-pipe'/> + <address type='virtio-serial' controller='0' bus='0' port='6'/> + </channel> + <channel type='dev'> + <source path='/path/to/device'/> + <target type='virtio' name='chardev-dev'/> + <address type='virtio-serial' controller='0' bus='0' port='7'/> + </channel> + <channel type='unix'> + <source mode='bind' path='/path/to/unix-listen'/> + <target type='virtio' name='chardev-unix-listen'/> + <address type='virtio-serial' controller='0' bus='0' port='8'/> + </channel> + <channel type='unix'> + <source mode='connect' path='/path/to/unix-listen'> + <reconnect enabled='yes' timeout='2'/> + </source> + <target type='virtio' name='chardev-unix-connect'/> + <address type='virtio-serial' controller='0' bus='0' port='9'/> + </channel> + <channel type='tcp'> + <source mode='bind' host='1.2.3.4' service='5678'/> + <protocol type='raw'/> + <target type='virtio' name='chardev-tcp-listen-raw'/> + <address type='virtio-serial' controller='0' bus='0' port='10'/> + </channel> + <channel type='tcp'> + <source mode='bind' host='1.2.3.4' service='5679'/> + <protocol type='telnet'/> + <target type='virtio' name='chardev-tcp-listen-telnet'/> + <address type='virtio-serial' controller='0' bus='0' port='11'/> + </channel> + <channel type='tcp'> + <source mode='connect' host='1.2.3.4' service='5678' tls='yes'> + <reconnect enabled='yes' timeout='2'/> + </source> + <protocol type='raw'/> + <target type='virtio' name='chardev-tcp-connect-raw'/> + <address type='virtio-serial' controller='0' bus='0' port='12'/> + </channel> + <channel type='tcp'> + <source mode='connect' host='hostname.global.' service='5679' tls='yes'> + <reconnect enabled='yes' timeout='2'/> + </source> + <protocol type='telnet'/> + <target type='virtio' name='chardev-tcp-connect-telnet'/> + <address type='virtio-serial' controller='0' bus='0' port='13'/> + </channel> + <channel type='udp'> + <source mode='connect' host='127.0.0.1' service='2222'/> + <target type='virtio' name='chardev-udp-nobind'/> + <address type='virtio-serial' controller='0' bus='0' port='14'/> + </channel> + <channel type='udp'> + <source mode='bind' host='127.0.0.1' service='1111'/> + <source mode='connect' host='127.0.0.1' service='2222'/> + <target type='virtio' name='chardev-udp-bind'/> + <address type='virtio-serial' controller='0' bus='0' port='15'/> + </channel> + <channel type='spicevmc'> + <target type='virtio' name='com.redhat.spice.0'/> + <address type='virtio-serial' controller='0' bus='0' port='16'/> + </channel> + <channel type='qemu-vdagent'> + <source> + <clipboard copypaste='no'/> + <mouse mode='server'/> + </source> + <target type='virtio' name='chardev-vdagent'/> + <address type='virtio-serial' controller='0' bus='0' port='17'/> + </channel> + <channel type='dbus'> + <source channel='test.channel.0'/> + <target type='virtio' name='chardev-dbus'/> + <address type='virtio-serial' controller='0' bus='0' port='18'/> + </channel> + <channel type='spiceport'> + <source channel='test.channel.0'/> + <target type='virtio' name='chardev-spiceport'/> + <address type='virtio-serial' controller='0' bus='0' port='19'/> + </channel> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='spice' autoport='yes' listen='0.0.0.0'> + <listen type='address' address='0.0.0.0'/> + </graphics> + <audio id='1' type='spice'/> + <video> + <model type='cirrus' vram='16384' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.args b/tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.args new file mode 100644 index 0000000000..4e6e17587e --- /dev/null +++ b/tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.args @@ -0,0 +1,79 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x3"}' \ +-chardev parallel,id=charparallel0,path=/dev/parport0 \ +-device '{"driver":"isa-parallel","chardev":"charparallel0","id":"parallel0"}' \ +-add-fd set=0,fd=1751,opaque=channel0-log \ +-chardev null,id=charchannel0,logfile=/dev/fdset/0,logappend=on \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"chardev-null"}' \ +-add-fd set=1,fd=1751,opaque=channel1-log \ +-chardev vc,id=charchannel1,logfile=/dev/fdset/1,logappend=on \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":2,"chardev":"charchannel1","id":"channel1","name":"chardev-vc"}' \ +-chardev pty,id=charchannel2 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":3,"chardev":"charchannel2","id":"channel2","name":"chardev-pty"}' \ +-chardev stdio,id=charchannel3 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":4,"chardev":"charchannel3","id":"channel3","name":"chardev-stdio"}' \ +-add-fd set=2,fd=1750,opaque=channel4-source \ +-chardev file,id=charchannel4,path=/dev/fdset/2,append=on \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":5,"chardev":"charchannel4","id":"channel4","name":"chardev-file"}' \ +-chardev pipe,id=charchannel5,path=/path/to/pipe \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":6,"chardev":"charchannel5","id":"channel5","name":"chardev-pipe"}' \ +-chardev serial,id=charchannel6,path=/path/to/device \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":7,"chardev":"charchannel6","id":"channel6","name":"chardev-dev"}' \ +-chardev socket,id=charchannel7,fd=1729,server=on,wait=off \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":8,"chardev":"charchannel7","id":"channel7","name":"chardev-unix-listen"}' \ +-chardev socket,id=charchannel8,path=/path/to/unix-listen,reconnect=2 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":9,"chardev":"charchannel8","id":"channel8","name":"chardev-unix-connect"}' \ +-chardev socket,id=charchannel9,host=1.2.3.4,port=5678,server=on,wait=off \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":10,"chardev":"charchannel9","id":"channel9","name":"chardev-tcp-listen-raw"}' \ +-chardev socket,id=charchannel10,host=1.2.3.4,port=5679,telnet=on,server=on,wait=off \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":11,"chardev":"charchannel10","id":"channel10","name":"chardev-tcp-listen-telnet"}' \ +-object '{"qom-type":"tls-creds-x509","id":"objcharchannel11_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ +-chardev socket,id=charchannel11,host=1.2.3.4,port=5678,reconnect=2,tls-creds=objcharchannel11_tls0 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":12,"chardev":"charchannel11","id":"channel11","name":"chardev-tcp-connect-raw"}' \ +-object '{"qom-type":"tls-creds-x509","id":"objcharchannel12_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}' \ +-chardev socket,id=charchannel12,host=hostname.global.,port=5679,telnet=on,reconnect=2,tls-creds=objcharchannel12_tls0 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":13,"chardev":"charchannel12","id":"channel12","name":"chardev-tcp-connect-telnet"}' \ +-chardev udp,id=charchannel13,host=127.0.0.1,port=2222,localaddr=,localport=0 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":14,"chardev":"charchannel13","id":"channel13","name":"chardev-udp-nobind"}' \ +-chardev udp,id=charchannel14,host=127.0.0.1,port=2222,localaddr=127.0.0.1,localport=1111 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":15,"chardev":"charchannel14","id":"channel14","name":"chardev-udp-bind"}' \ +-chardev spicevmc,id=charchannel15,name=vdagent \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":16,"chardev":"charchannel15","id":"channel15","name":"com.redhat.spice.0"}' \ +-chardev qemu-vdagent,id=charchannel16,name=vdagent,clipboard=off,mouse=off \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":17,"chardev":"charchannel16","id":"channel16","name":"chardev-vdagent"}' \ +-chardev dbus,id=charchannel17,name=test.channel.0 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":18,"chardev":"charchannel17","id":"channel17","name":"chardev-dbus"}' \ +-chardev spiceport,id=charchannel18,name=test.channel.0 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":19,"chardev":"charchannel18","id":"channel18","name":"chardev-spiceport"}' \ +-audiodev '{"id":"audio1","driver":"spice"}' \ +-spice port=5901,addr=0.0.0.0,seamless-migration=on \ +-device '{"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.xml b/tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.xml new file mode 100644 index 0000000000..57a16b5b7c --- /dev/null +++ b/tests/qemuxmlconfdata/chardev-backends.x86_64-9.1.0.xml @@ -0,0 +1,149 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </controller> + <parallel type='dev'> + <source path='/dev/parport0'/> + <target port='0'/> + </parallel> + <channel type='null'> + <log file='/path/to/null.log' append='off'/> + <target type='virtio' name='chardev-null'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <channel type='vc'> + <log file='/path/to/vc.log' append='on'/> + <target type='virtio' name='chardev-vc'/> + <address type='virtio-serial' controller='0' bus='0' port='2'/> + </channel> + <channel type='pty'> + <target type='virtio' name='chardev-pty'/> + <address type='virtio-serial' controller='0' bus='0' port='3'/> + </channel> + <channel type='stdio'> + <target type='virtio' name='chardev-stdio'/> + <address type='virtio-serial' controller='0' bus='0' port='4'/> + </channel> + <channel type='file'> + <source path='/path/to/fileout'/> + <target type='virtio' name='chardev-file'/> + <address type='virtio-serial' controller='0' bus='0' port='5'/> + </channel> + <channel type='pipe'> + <source path='/path/to/pipe'/> + <target type='virtio' name='chardev-pipe'/> + <address type='virtio-serial' controller='0' bus='0' port='6'/> + </channel> + <channel type='dev'> + <source path='/path/to/device'/> + <target type='virtio' name='chardev-dev'/> + <address type='virtio-serial' controller='0' bus='0' port='7'/> + </channel> + <channel type='unix'> + <source mode='bind' path='/path/to/unix-listen'/> + <target type='virtio' name='chardev-unix-listen'/> + <address type='virtio-serial' controller='0' bus='0' port='8'/> + </channel> + <channel type='unix'> + <source mode='connect' path='/path/to/unix-listen'> + <reconnect enabled='yes' timeout='2'/> + </source> + <target type='virtio' name='chardev-unix-connect'/> + <address type='virtio-serial' controller='0' bus='0' port='9'/> + </channel> + <channel type='tcp'> + <source mode='bind' host='1.2.3.4' service='5678'/> + <protocol type='raw'/> + <target type='virtio' name='chardev-tcp-listen-raw'/> + <address type='virtio-serial' controller='0' bus='0' port='10'/> + </channel> + <channel type='tcp'> + <source mode='bind' host='1.2.3.4' service='5679'/> + <protocol type='telnet'/> + <target type='virtio' name='chardev-tcp-listen-telnet'/> + <address type='virtio-serial' controller='0' bus='0' port='11'/> + </channel> + <channel type='tcp'> + <source mode='connect' host='1.2.3.4' service='5678' tls='yes'> + <reconnect enabled='yes' timeout='2'/> + </source> + <protocol type='raw'/> + <target type='virtio' name='chardev-tcp-connect-raw'/> + <address type='virtio-serial' controller='0' bus='0' port='12'/> + </channel> + <channel type='tcp'> + <source mode='connect' host='hostname.global.' service='5679' tls='yes'> + <reconnect enabled='yes' timeout='2'/> + </source> + <protocol type='telnet'/> + <target type='virtio' name='chardev-tcp-connect-telnet'/> + <address type='virtio-serial' controller='0' bus='0' port='13'/> + </channel> + <channel type='udp'> + <source mode='connect' host='127.0.0.1' service='2222'/> + <target type='virtio' name='chardev-udp-nobind'/> + <address type='virtio-serial' controller='0' bus='0' port='14'/> + </channel> + <channel type='udp'> + <source mode='bind' host='127.0.0.1' service='1111'/> + <source mode='connect' host='127.0.0.1' service='2222'/> + <target type='virtio' name='chardev-udp-bind'/> + <address type='virtio-serial' controller='0' bus='0' port='15'/> + </channel> + <channel type='spicevmc'> + <target type='virtio' name='com.redhat.spice.0'/> + <address type='virtio-serial' controller='0' bus='0' port='16'/> + </channel> + <channel type='qemu-vdagent'> + <source> + <clipboard copypaste='no'/> + <mouse mode='server'/> + </source> + <target type='virtio' name='chardev-vdagent'/> + <address type='virtio-serial' controller='0' bus='0' port='17'/> + </channel> + <channel type='dbus'> + <source channel='test.channel.0'/> + <target type='virtio' name='chardev-dbus'/> + <address type='virtio-serial' controller='0' bus='0' port='18'/> + </channel> + <channel type='spiceport'> + <source channel='test.channel.0'/> + <target type='virtio' name='chardev-spiceport'/> + <address type='virtio-serial' controller='0' bus='0' port='19'/> + </channel> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <graphics type='spice' autoport='yes' listen='0.0.0.0'> + <listen type='address' address='0.0.0.0'/> + </graphics> + <audio id='1' type='spice'/> + <video> + <model type='cirrus' vram='16384' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.args b/tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.args new file mode 100644 index 0000000000..b86eba21a2 --- /dev/null +++ b/tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.args @@ -0,0 +1,46 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-serial-pci","id":"virtio-serial1","bus":"pci.0","addr":"0xa"}' \ +-device '{"driver":"usb-ccid","id":"ccid0","bus":"usb.0","port":"1"}' \ +-chardev socket,id=charsmartcard0,path=/var/lib/libvirt/qemu/channel/target/asdf,reconnect=20 \ +-device '{"driver":"ccid-card-passthru","chardev":"charsmartcard0","id":"smartcard0","bus":"ccid0.0"}' \ +-chardev socket,id=charchannel0,host=localhost,port=1234,reconnect=10 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"asdf"}' \ +-chardev socket,id=charchannel1,path=/var/lib/libvirt/qemu/channel/target/fdsa,reconnect=0 \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":2,"chardev":"charchannel1","id":"channel1","name":"fdsa"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-chardev socket,id=charredir0,host=localhost,port=3456,reconnect=15 \ +-device '{"driver":"usb-redir","chardev":"charredir0","id":"redir0","bus":"usb.0","port":"2"}' \ +-chardev socket,id=charrng0,host=localhost,port=2345,reconnect=5 \ +-object '{"qom-type":"rng-egd","id":"objrng0","chardev":"charrng0"}' \ +-device '{"driver":"virtio-rng-pci","rng":"objrng0","id":"rng0","bus":"pci.0","addr":"0x3"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.xml b/tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.xml new file mode 100644 index 0000000000..1458da0cc2 --- /dev/null +++ b/tests/qemuxmlconfdata/chardev-reconnect.x86_64-9.1.0.xml @@ -0,0 +1,72 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </controller> + <controller type='virtio-serial' index='1'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='ccid' index='0'/> + <smartcard mode='passthrough' type='unix'> + <source mode='connect' path='/var/lib/libvirt/qemu/channel/target/asdf'> + <reconnect enabled='yes' timeout='20'/> + </source> + <address type='ccid' controller='0' slot='0'/> + </smartcard> + <channel type='tcp'> + <source mode='connect' host='localhost' service='1234'> + <reconnect enabled='yes' timeout='10'/> + </source> + <protocol type='raw'/> + <target type='virtio' name='asdf'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <channel type='unix'> + <source mode='connect' path='/var/lib/libvirt/qemu/channel/target/fdsa'> + <reconnect enabled='no'/> + </source> + <target type='virtio' name='fdsa'/> + <address type='virtio-serial' controller='0' bus='0' port='2'/> + </channel> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <redirdev bus='usb' type='tcp'> + <source mode='connect' host='localhost' service='3456'> + <reconnect enabled='yes' timeout='15'/> + </source> + <protocol type='raw'/> + </redirdev> + <memballoon model='none'/> + <rng model='virtio'> + <backend model='egd' type='tcp'> + <source mode='connect' host='localhost' service='2345'> + <reconnect enabled='yes' timeout='5'/> + </source> + <protocol type='raw'/> + </backend> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </rng> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 91daf955f5..9bcd937447 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1832,10 +1832,13 @@ mymain(void) DO_TEST_CAPS_LATEST("console-compat-auto"); DO_TEST_CAPS_LATEST("console-compat-crash"); + /* 'qemu-9.2' deprecated 'reconnect' in favor of 'reconnect-ms' */ + DO_TEST_CAPS_VER("chardev-backends", "9.1.0"); DO_TEST_CAPS_LATEST("chardev-backends"); /* As qemu doesn't yet support JSON syntax for -chardev we use the * QEMU_CAPS_CHARDEV_JSON capability just in the tests to have QMP schema * validation also for the QMP mode of the -chardev props generator */ + DO_TEST_CAPS_ARCH_VER_FULL("chardev-backends-json", "x86_64", "9.1.0", ARG_QEMU_CAPS, QEMU_CAPS_CHARDEV_JSON, QEMU_CAPS_LAST); DO_TEST_CAPS_ARCH_LATEST_FULL("chardev-backends-json", "x86_64", ARG_QEMU_CAPS, QEMU_CAPS_CHARDEV_JSON, QEMU_CAPS_LAST); DO_TEST_CAPS_LATEST("serial-vc-chardev"); @@ -1894,6 +1897,8 @@ mymain(void) DO_TEST_CAPS_LATEST("smartcard-controller"); DO_TEST_CAPS_LATEST("smartcard-passthrough-unix"); + /* 'qemu-9.2' deprecated 'reconnect' in favor of 'reconnect-ms' */ + DO_TEST_CAPS_VER("chardev-reconnect", "9.1.0"); DO_TEST_CAPS_LATEST("chardev-reconnect"); DO_TEST_CAPS_LATEST_PARSE_ERROR("chardev-reconnect-invalid-timeout"); DO_TEST_CAPS_LATEST_PARSE_ERROR("chardev-reconnect-generated-path"); -- 2.46.2