From nobody Wed May 15 00:40:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1657631646; cv=none; d=zohomail.com; s=zohoarc; b=B0TJ2LT1xRZ4/GZNSUDJziBmN52dVlsQxktl8+JRvAvpeVOdfB4Ux21cn7LQlgmJ4i9xP1Nsg2GpTKlCWXSkXyi7IXSUcqZyVJVoIjgo/lhG28ossGHBrfogFg/fWsfkIsajgAgIulvnEqB5i45CZ6AaDlxVR0RXB/CSRRdBrZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657631646; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ob+wbZg9xVllT99uYJaVjt+zKIoG2ziFwY29Io9f2XM=; b=QjLLmzRyf20eHyyEGhYRI9mQlIg41FODke45ICAbY79fLNrxf1BjTCpZsl7AQxyXaO8Vnpx+0r9WMrx9pKzUX5S3UMXBquqUC16HGkfcZGwHv0jyEEm2uagehJDmQDrUaqzPFhXCyjVzMMJToy500W9K6g7YwwJEoBa3+1fTHPI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1657631646403356.49895804924563; Tue, 12 Jul 2022 06:14:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-1XfHQ_TZNrCLt_T7tQhDQA-1; Tue, 12 Jul 2022 09:13:42 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 213C0805F47; Tue, 12 Jul 2022 13:13:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BE5C2027EB4; Tue, 12 Jul 2022 13:13:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D9F44194705E; Tue, 12 Jul 2022 13:13:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1A1F194707F for ; Tue, 12 Jul 2022 13:13:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8D3922026D07; Tue, 12 Jul 2022 13:13:36 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 024C42026D64 for ; Tue, 12 Jul 2022 13:13:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657631645; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ob+wbZg9xVllT99uYJaVjt+zKIoG2ziFwY29Io9f2XM=; b=egEiOoPdFBzMslLrHBGNjNLFplOUAiF7U9emPqvY0SA+TqE3Yyq0c1t5Reo94kdIv6sBMz Fw04YYHJjoXDE5j2/KJ5uNtRs2oOtOENnZ3lxXfFlZ0ZGDtn5oRYlBpUqis67xz+yeLWwN yAFVLwwnwSykKW+R5SFxLb1TiJYWnQg= X-MC-Unique: 1XfHQ_TZNrCLt_T7tQhDQA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/5] tests: Update hostdev-usb-* hostdev-pci-* xml2xml and xml2argv tests Date: Tue, 12 Jul 2022 15:13:30 +0200 Message-Id: <6e989f371cbb3f8a3644230d684e1d6e8864fc9b.1657631390.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1657631647936100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Currently, we have bunch of PCI/USB tests cases for qemuxml2argvtest and qemuxml2xmltest but all of them run without any capabilities. This makes is needlessly complicated when trying to extend them. Switch to DO_TEST_CAPS_LATEST(). Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- .../hostdev-pci-address-device.args | 34 ----------------- ...tdev-pci-address-device.x86_64-latest.args | 38 +++++++++++++++++++ .../hostdev-pci-address-device.xml | 2 +- .../qemuxml2argvdata/hostdev-pci-address.args | 33 ---------------- .../hostdev-pci-address.x86_64-latest.args | 37 ++++++++++++++++++ .../qemuxml2argvdata/hostdev-pci-address.xml | 2 +- .../hostdev-usb-address-device-boot.args | 34 ----------------- ...usb-address-device-boot.x86_64-latest.args | 38 +++++++++++++++++++ .../hostdev-usb-address-device-boot.xml | 2 +- .../hostdev-usb-address-device.args | 34 ----------------- ...tdev-usb-address-device.x86_64-latest.args | 38 +++++++++++++++++++ .../hostdev-usb-address-device.xml | 2 +- .../qemuxml2argvdata/hostdev-usb-address.args | 33 ---------------- .../hostdev-usb-address.x86_64-latest.args | 37 ++++++++++++++++++ .../qemuxml2argvdata/hostdev-usb-address.xml | 2 +- tests/qemuxml2argvtest.c | 10 ++--- ... =3D> hostdev-pci-address.x86_64-latest.xml} | 7 +++- ... =3D> hostdev-usb-address.x86_64-latest.xml} | 7 +++- tests/qemuxml2xmltest.c | 4 +- 19 files changed, 210 insertions(+), 184 deletions(-) delete mode 100644 tests/qemuxml2argvdata/hostdev-pci-address-device.args create mode 100644 tests/qemuxml2argvdata/hostdev-pci-address-device.x86_6= 4-latest.args delete mode 100644 tests/qemuxml2argvdata/hostdev-pci-address.args create mode 100644 tests/qemuxml2argvdata/hostdev-pci-address.x86_64-lates= t.args delete mode 100644 tests/qemuxml2argvdata/hostdev-usb-address-device-boot.= args create mode 100644 tests/qemuxml2argvdata/hostdev-usb-address-device-boot.= x86_64-latest.args delete mode 100644 tests/qemuxml2argvdata/hostdev-usb-address-device.args create mode 100644 tests/qemuxml2argvdata/hostdev-usb-address-device.x86_6= 4-latest.args delete mode 100644 tests/qemuxml2argvdata/hostdev-usb-address.args create mode 100644 tests/qemuxml2argvdata/hostdev-usb-address.x86_64-lates= t.args rename tests/qemuxml2xmloutdata/{hostdev-pci-address.xml =3D> hostdev-pci-= address.x86_64-latest.xml} (86%) rename tests/qemuxml2xmloutdata/{hostdev-usb-address.xml =3D> hostdev-usb-= address.x86_64-latest.xml} (85%) diff --git a/tests/qemuxml2argvdata/hostdev-pci-address-device.args b/tests= /qemuxml2argvdata/hostdev-pci-address-device.args deleted file mode 100644 index 4c39457ae5..0000000000 --- a/tests/qemuxml2argvdata/hostdev-pci-address-device.args +++ /dev/null @@ -1,34 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/tmp/lib/domain--1-QEMUGuest2 \ -USER=3Dtest \ -LOGNAME=3Dtest \ -XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.local/share \ -XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.cache \ -XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.config \ -QEMU_AUDIO_DRV=3Dnone \ -/usr/bin/qemu-system-i386 \ --name guest=3DQEMUGuest2,debug-threads=3Don \ --S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest2/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ --accel tcg \ --m 214 \ --overcommit mem-lock=3Doff \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --no-acpi \ --boot strict=3Don \ --usb \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device vfio-pci,host=3D0000:06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x2 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-pci-address-device.x86_64-lates= t.args b/tests/qemuxml2argvdata/hostdev-pci-address-device.x86_64-latest.ar= gs new file mode 100644 index 0000000000..a0b6777ce2 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-pci-address-device.x86_64-latest.args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest2 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest2,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest2/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-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-form= at","id":"ide0-0-0","bootindex":1}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"vfio-pci","host":"0000:06:12.5","id":"hostdev0","bus":= "pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x3"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-pci-address-device.xml b/tests/= qemuxml2argvdata/hostdev-pci-address-device.xml index 7a99fc8444..3fc4d12f7e 100644 --- a/tests/qemuxml2argvdata/hostdev-pci-address-device.xml +++ b/tests/qemuxml2argvdata/hostdev-pci-address-device.xml @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvdata/hostdev-pci-address.args b/tests/qemuxm= l2argvdata/hostdev-pci-address.args deleted file mode 100644 index a985ff9dc1..0000000000 --- a/tests/qemuxml2argvdata/hostdev-pci-address.args +++ /dev/null @@ -1,33 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/tmp/lib/domain--1-QEMUGuest2 \ -USER=3Dtest \ -LOGNAME=3Dtest \ -XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.local/share \ -XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.cache \ -XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.config \ -QEMU_AUDIO_DRV=3Dnone \ -/usr/bin/qemu-system-i386 \ --name guest=3DQEMUGuest2,debug-threads=3Don \ --S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest2/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ --accel tcg \ --m 214 \ --overcommit mem-lock=3Doff \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --no-acpi \ --boot strict=3Don \ --usb \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device vfio-pci,host=3D0000:06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x2 \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-pci-address.x86_64-latest.args = b/tests/qemuxml2argvdata/hostdev-pci-address.x86_64-latest.args new file mode 100644 index 0000000000..fe011d5f8a --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-pci-address.x86_64-latest.args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest2 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest2,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest2/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-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-form= at","id":"ide0-0-0","bootindex":1}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"vfio-pci","host":"0000:06:12.5","id":"hostdev0","bus":= "pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-pci-address.xml b/tests/qemuxml= 2argvdata/hostdev-pci-address.xml index 5f8090336f..f35b8394f7 100644 --- a/tests/qemuxml2argvdata/hostdev-pci-address.xml +++ b/tests/qemuxml2argvdata/hostdev-pci-address.xml @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.args b/= tests/qemuxml2argvdata/hostdev-usb-address-device-boot.args deleted file mode 100644 index 7e72951fd1..0000000000 --- a/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.args +++ /dev/null @@ -1,34 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ -USER=3Dtest \ -LOGNAME=3Dtest \ -XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ -XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ -XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -QEMU_AUDIO_DRV=3Dnone \ -/usr/bin/qemu-system-i386 \ --name guest=3DQEMUGuest1,debug-threads=3Don \ --S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ --accel tcg \ --m 214 \ --overcommit mem-lock=3Doff \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --no-acpi \ --boot strict=3Don \ --usb \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0 \ --device usb-host,hostbus=3D14,hostaddr=3D6,id=3Dhostdev0,bootindex=3D1,bus= =3Dusb.0,port=3D1 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.x86_64-= latest.args b/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.x86_64= -latest.args new file mode 100644 index 0000000000..2a5a085231 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.x86_64-latest.= args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-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-form= at","id":"ide0-0-0"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"usb-host","hostdevice":"/dev/bus/usb/014/006","id":"ho= stdev0","bootindex":1,"bus":"usb.0","port":"1"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.xml b/t= ests/qemuxml2argvdata/hostdev-usb-address-device-boot.xml index ac1360f87f..a3c0618e37 100644 --- a/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.xml +++ b/tests/qemuxml2argvdata/hostdev-usb-address-device-boot.xml @@ -12,7 +12,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvdata/hostdev-usb-address-device.args b/tests= /qemuxml2argvdata/hostdev-usb-address-device.args deleted file mode 100644 index c4003864c4..0000000000 --- a/tests/qemuxml2argvdata/hostdev-usb-address-device.args +++ /dev/null @@ -1,34 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ -USER=3Dtest \ -LOGNAME=3Dtest \ -XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ -XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ -XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -QEMU_AUDIO_DRV=3Dnone \ -/usr/bin/qemu-system-i386 \ --name guest=3DQEMUGuest1,debug-threads=3Don \ --S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ --accel tcg \ --m 214 \ --overcommit mem-lock=3Doff \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --no-acpi \ --boot strict=3Don \ --usb \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device usb-host,hostbus=3D14,hostaddr=3D6,id=3Dhostdev0,bus=3Dusb.0,port= =3D1 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-usb-address-device.x86_64-lates= t.args b/tests/qemuxml2argvdata/hostdev-usb-address-device.x86_64-latest.ar= gs new file mode 100644 index 0000000000..30809a076c --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-usb-address-device.x86_64-latest.args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-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-form= at","id":"ide0-0-0","bootindex":1}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"usb-host","hostdevice":"/dev/bus/usb/014/006","id":"ho= stdev0","bus":"usb.0","port":"1"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-usb-address-device.xml b/tests/= qemuxml2argvdata/hostdev-usb-address-device.xml index 9027564584..f63ad30950 100644 --- a/tests/qemuxml2argvdata/hostdev-usb-address-device.xml +++ b/tests/qemuxml2argvdata/hostdev-usb-address-device.xml @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvdata/hostdev-usb-address.args b/tests/qemuxm= l2argvdata/hostdev-usb-address.args deleted file mode 100644 index a5bf6263d4..0000000000 --- a/tests/qemuxml2argvdata/hostdev-usb-address.args +++ /dev/null @@ -1,33 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ -USER=3Dtest \ -LOGNAME=3Dtest \ -XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ -XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ -XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -QEMU_AUDIO_DRV=3Dnone \ -/usr/bin/qemu-system-i386 \ --name guest=3DQEMUGuest1,debug-threads=3Don \ --S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ --accel tcg \ --m 214 \ --overcommit mem-lock=3Doff \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --no-acpi \ --boot strict=3Don \ --usb \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device usb-host,hostbus=3D14,hostaddr=3D6,id=3Dhostdev0,bus=3Dusb.0,port= =3D1 \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-usb-address.x86_64-latest.args = b/tests/qemuxml2argvdata/hostdev-usb-address.x86_64-latest.args new file mode 100644 index 0000000000..f59c463f5e --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-usb-address.x86_64-latest.args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-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-form= at","id":"ide0-0-0","bootindex":1}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"usb-host","hostdevice":"/dev/bus/usb/014/006","id":"ho= stdev0","bus":"usb.0","port":"1"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-usb-address.xml b/tests/qemuxml= 2argvdata/hostdev-usb-address.xml index 7d0c338311..03c802a532 100644 --- a/tests/qemuxml2argvdata/hostdev-usb-address.xml +++ b/tests/qemuxml2argvdata/hostdev-usb-address.xml @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a99b44bf2d..5b40a0d7f5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1914,12 +1914,12 @@ mymain(void) DO_TEST_CAPS_LATEST("fs9p"); DO_TEST_CAPS_ARCH_LATEST("fs9p-ccw", "s390x"); =20 - DO_TEST_NOCAPS("hostdev-usb-address"); - DO_TEST_NOCAPS("hostdev-usb-address-device"); - DO_TEST_NOCAPS("hostdev-usb-address-device-boot"); + DO_TEST_CAPS_LATEST("hostdev-usb-address"); + DO_TEST_CAPS_LATEST("hostdev-usb-address-device"); + DO_TEST_CAPS_LATEST("hostdev-usb-address-device-boot"); DO_TEST_PARSE_ERROR_NOCAPS("hostdev-usb-duplicate"); - DO_TEST("hostdev-pci-address", QEMU_CAPS_DEVICE_VFIO_PCI); - DO_TEST("hostdev-pci-address-device", QEMU_CAPS_DEVICE_VFIO_PCI); + DO_TEST_CAPS_LATEST("hostdev-pci-address"); + DO_TEST_CAPS_LATEST("hostdev-pci-address-device"); DO_TEST_PARSE_ERROR("hostdev-pci-duplicate", QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST("hostdev-vfio", diff --git a/tests/qemuxml2xmloutdata/hostdev-pci-address.xml b/tests/qemux= ml2xmloutdata/hostdev-pci-address.x86_64-latest.xml similarity index 86% rename from tests/qemuxml2xmloutdata/hostdev-pci-address.xml rename to tests/qemuxml2xmloutdata/hostdev-pci-address.x86_64-latest.xml index 9ba3dfac45..84d9660316 100644 --- a/tests/qemuxml2xmloutdata/hostdev-pci-address.xml +++ b/tests/qemuxml2xmloutdata/hostdev-pci-address.x86_64-latest.xml @@ -8,19 +8,22 @@ hvm + + qemu64 + destroy restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64
- +
diff --git a/tests/qemuxml2xmloutdata/hostdev-usb-address.xml b/tests/qemux= ml2xmloutdata/hostdev-usb-address.x86_64-latest.xml similarity index 85% rename from tests/qemuxml2xmloutdata/hostdev-usb-address.xml rename to tests/qemuxml2xmloutdata/hostdev-usb-address.x86_64-latest.xml index e4a1f798b2..e5e3620971 100644 --- a/tests/qemuxml2xmloutdata/hostdev-usb-address.xml +++ b/tests/qemuxml2xmloutdata/hostdev-usb-address.x86_64-latest.xml @@ -8,19 +8,22 @@ hvm + + qemu64 + destroy restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64
- +
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 71bce98c17..58929b68c1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -526,8 +526,8 @@ mymain(void) =20 DO_TEST_NOCAPS("channel-unix-source-path"); =20 - DO_TEST_NOCAPS("hostdev-usb-address"); - DO_TEST_NOCAPS("hostdev-pci-address"); + DO_TEST_CAPS_LATEST("hostdev-usb-address"); + DO_TEST_CAPS_LATEST("hostdev-pci-address"); DO_TEST("hostdev-pci-address-unassigned", QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST("hostdev-pci-multifunction", QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST("hostdev-vfio", QEMU_CAPS_DEVICE_VFIO_PCI); --=20 2.35.1 From nobody Wed May 15 00:40:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1657631776; cv=none; d=zohomail.com; s=zohoarc; b=HhfgVd30LJ07SqAHI8HVb0uRWblKmB7fq11+bJpzeBY/SDq9rwzhRDbk94wnhxX105hnW6VqOmVN5bF87SXuFver1jaz50GcBaIHy0wzZgRbtjuKJN6uvRcOYpLdXwaPlhcHesL7tIo4RdSjZKl8v+8Xz+SCO3tIBCEfXg6gF2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657631776; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GFXxJfqUx+dxjEF4XxtKNWsbpSmXmMQwVqcVWyCrXGc=; b=SelPKnjs428Z7Q9VAc6xnZXXlyJu3spPO5AHSutddBo/l4UyjcTscIRz+SALHf619MuBUARhDIjdWH8bVX+a2hK2lRdunu6rsuq0eLA5s/BIMj3RqDLsUAhR22sAXEB5l1I6ROcWTalNKpsRDqAKKGmP/AJb70ztuyqNNCgaI7k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1657631776357198.06649701795516; Tue, 12 Jul 2022 06:16:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-240-JXTeIF0zO06MiMTuHFZQuQ-1; Tue, 12 Jul 2022 09:13:43 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EDEBB85A58B; Tue, 12 Jul 2022 13:13:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7C19492C3B; Tue, 12 Jul 2022 13:13:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8FFAA1947060; Tue, 12 Jul 2022 13:13:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 394991947058 for ; Tue, 12 Jul 2022 13:13:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2448E2026D64; Tue, 12 Jul 2022 13:13:37 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3C6A2026D07 for ; Tue, 12 Jul 2022 13:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657631775; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GFXxJfqUx+dxjEF4XxtKNWsbpSmXmMQwVqcVWyCrXGc=; b=DEMlYGzexKpbTELbeMS0IyA1YTXuC1Lze8Lc+Lj1bjt9BmHxd/ebRq2VyKDbcyr1BPCm/h qmScymsuDHTNTNm7Pr7efT4+fqIWhUeoNSYZfSscByfEu2W/KFiKpdacUX2Nd/2PJ+aBDZ BnGAErENOt15I+gTtVJWyRROSxvtXVE= X-MC-Unique: JXTeIF0zO06MiMTuHFZQuQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/5] conf: Introduce @guestReset to hostdev's Date: Tue, 12 Jul 2022 15:13:31 +0200 Message-Id: <32dfa9ec0598eb84267672a34442b1592524baa6.1657631390.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1657631777060100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Some USB devices have a buggy firmware that either crashes on device reset, or make the device unusable in some other way. Fortunately, QEMU offers a way to skip device reset either completely, or if device is not initialized yet. Expose this ability to users under: Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- docs/formatdomain.rst | 15 ++++++++++++++- src/conf/domain_conf.c | 18 ++++++++++++++++++ src/conf/domain_conf.h | 13 +++++++++++++ src/conf/schemas/domaincommon.rng | 9 +++++++++ tests/qemuxml2argvdata/hostdev-usb-address.xml | 2 +- .../hostdev-usb-address.x86_64-latest.xml | 2 +- 6 files changed, 56 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 89b627f4bd..3ea094e64c 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4051,7 +4051,7 @@ for PCI (KVM only) and 1.0.6 for SCSI (KVM only)` : ... - + @@ -4231,6 +4231,19 @@ or: optional drop if missing at any start attempt =3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =20 + :since:`Since 8.6.0`, the ``source`` element can contain ``guestRese= t`` + attribute with the following value: + + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + off all guest initiated device reset requests are ignored + uninitialized device request is ignored if device is initialized, + otherwise reset is performed + on device is reset on every guest initiated request + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + This attribute can be helpful when assigning an USB device with a + firmware that crashes on reset. + ``pci`` PCI devices can only be described by their ``address``. :since:`Since 6.8.0 (Xen only)` , the ``source`` element of a PCI de= vice diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b639022396..ced25286bd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1042,6 +1042,14 @@ VIR_ENUM_IMPL(virDomainHostdevSubsysSCSIProtocol, "iscsi", ); =20 +VIR_ENUM_IMPL(virDomainHostdevSubsysUSBGuestReset, + VIR_DOMAIN_HOSTDEV_USB_GUEST_RESET_LAST, + "default", + "off", + "uninitialized", + "on", +); + VIR_ENUM_IMPL(virDomainHostdevSubsysSCSIHostProtocol, VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_LAST, "none", @@ -5489,6 +5497,11 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node, return -1; virTristateBoolToBool(autoAddress, &usbsrc->autoAddress); =20 + if (virXMLPropEnum(node, "guestReset", + virDomainHostdevSubsysUSBGuestResetTypeFromString, + VIR_XML_PROP_NONZERO, &usbsrc->guestReset) < 0) + return -1; + /* Product can validly be 0, so we need some extra help to determine * if it is uninitialized */ vendorNode =3D virXPathNode("./vendor", ctxt); @@ -22989,6 +23002,11 @@ virDomainHostdevDefFormatSubsysUSB(virBuffer *buf, if (def->missing && !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) virBufferAddLit(&sourceAttrBuf, " missing=3D'yes'"); =20 + if (usbsrc->guestReset) { + virBufferAsprintf(&sourceAttrBuf, " guestReset=3D'%s'", + virDomainHostdevSubsysUSBGuestResetTypeToString(= usbsrc->guestReset)); + } + if (usbsrc->vendor) { virBufferAsprintf(&sourceChildBuf, "\n", us= bsrc->vendor); virBufferAsprintf(&sourceChildBuf, "\n", u= sbsrc->product); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c56b84683c..90de50c12f 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -233,6 +233,17 @@ typedef enum { =20 VIR_ENUM_DECL(virDomainHostdevSubsysSCSIProtocol); =20 +typedef enum { + VIR_DOMAIN_HOSTDEV_USB_GUEST_RESET_DEFAULT =3D 0, + VIR_DOMAIN_HOSTDEV_USB_GUEST_RESET_OFF, /* reset forbidden */ + VIR_DOMAIN_HOSTDEV_USB_GUEST_RESET_UNINITIALIZED, /* reset iff uniniti= alized */ + VIR_DOMAIN_HOSTDEV_USB_GUEST_RESET_ON, /* reset allowed */ + + VIR_DOMAIN_HOSTDEV_USB_GUEST_RESET_LAST +} virDomainHostdevSubsysUSBGuestReset; + +VIR_ENUM_DECL(virDomainHostdevSubsysUSBGuestReset); + struct _virDomainHostdevSubsysUSB { bool autoAddress; /* bus/device were filled automatically based on vendor/product */ @@ -241,6 +252,8 @@ struct _virDomainHostdevSubsysUSB { =20 unsigned vendor; unsigned product; + + virDomainHostdevSubsysUSBGuestReset guestReset; }; =20 struct _virDomainHostdevSubsysPCI { diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index da2fb0d5cb..faa2561665 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -5936,6 +5936,15 @@ + + + + off + uninitialized + on + + + diff --git a/tests/qemuxml2argvdata/hostdev-usb-address.xml b/tests/qemuxml= 2argvdata/hostdev-usb-address.xml index 03c802a532..50c02f9b0e 100644 --- a/tests/qemuxml2argvdata/hostdev-usb-address.xml +++ b/tests/qemuxml2argvdata/hostdev-usb-address.xml @@ -26,7 +26,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/hostdev-usb-address.x86_64-latest.xml= b/tests/qemuxml2xmloutdata/hostdev-usb-address.x86_64-latest.xml index e5e3620971..2e927252a8 100644 --- a/tests/qemuxml2xmloutdata/hostdev-usb-address.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/hostdev-usb-address.x86_64-latest.xml @@ -34,7 +34,7 @@