From nobody Sun Apr 28 23:05:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524239227286513.2961801426707; Fri, 20 Apr 2018 08:47:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 17307308210B; Fri, 20 Apr 2018 15:47:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57D625D9CD; Fri, 20 Apr 2018 15:47:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6B02418033EB; Fri, 20 Apr 2018 15:47:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3KFicaw001412 for ; Fri, 20 Apr 2018 11:44:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id EDCDA11701C2; Fri, 20 Apr 2018 15:44:37 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 912CC10AF9CA for ; Fri, 20 Apr 2018 15:44:37 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 20 Apr 2018 17:44:29 +0200 Message-Id: <20180420154431.31536-2-abologna@redhat.com> In-Reply-To: <20180420154431.31536-1-abologna@redhat.com> References: <20180420154431.31536-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] conf: Add rom.enabled attribute for PCI devices X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 20 Apr 2018 15:47:06 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The attribute can be used to disable ROM loading completely for a device. Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 3 +++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/device_conf.h | 1 + src/conf/domain_conf.c | 26 +++++++++++++++++++++++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index ada0df227f..0afc310e25 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4476,6 +4476,9 @@ virtual function of an sr-iov capable ethernet device (which has no boot ROMs for the VFs). Since 0.9.10 (QEMU and KVM only). + The optional enabled attribute can be set to + no to disable PCI ROM loading completely for the devi= ce. + Since 4.3.0 (QEMU and KVM only).
address
The address element for USB devices has a diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4cab55f05d..3569b92127 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5108,6 +5108,11 @@ =20 + + + + + diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index f87d6f1fc6..a31ce9c376 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -153,6 +153,7 @@ struct _virDomainDeviceInfo { } master; /* rombar and romfile are only used for pci hostdev and network * devices. */ + int romenabled; /* enum virTristateBool */ int rombar; /* enum virTristateSwitch */ char *romfile; /* bootIndex is only used for disk, network interface, hostdev diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 35666c1347..3c152441df 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6095,9 +6095,17 @@ virDomainDeviceInfoFormat(virBufferPtr buf, } =20 if ((flags & VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM) && - (info->rombar !=3D VIR_TRISTATE_SWITCH_ABSENT || info->romfile)) { + (info->romenabled !=3D VIR_TRISTATE_BOOL_ABSENT || + info->rombar !=3D VIR_TRISTATE_SWITCH_ABSENT || + info->romfile)) { =20 virBufferAddLit(buf, "romenabled !=3D VIR_TRISTATE_BOOL_ABSENT) { + const char *romenabled =3D virTristateBoolTypeToString(info->r= omenabled); + + if (romenabled) + virBufferAsprintf(buf, " enabled=3D'%s'", romenabled); + } if (info->rombar !=3D VIR_TRISTATE_SWITCH_ABSENT) { const char *rombar =3D virTristateSwitchTypeToString(info->rom= bar); =20 @@ -6738,6 +6746,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xml= opt ATTRIBUTE_UNUSED, xmlNodePtr boot =3D NULL; xmlNodePtr rom =3D NULL; char *type =3D NULL; + char *romenabled =3D NULL; char *rombar =3D NULL; char *aliasStr =3D NULL; int ret =3D -1; @@ -6791,6 +6800,12 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xm= lopt ATTRIBUTE_UNUSED, } =20 if (rom) { + if ((romenabled =3D virXMLPropString(rom, "enabled")) && + ((info->romenabled =3D virTristateBoolTypeFromString(romenable= d)) <=3D 0)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown rom enabled value '%s'"), romenabled= ); + goto cleanup; + } if ((rombar =3D virXMLPropString(rom, "bar")) && ((info->rombar =3D virTristateSwitchTypeFromString(rombar)) <= =3D 0)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -6798,6 +6813,14 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xm= lopt ATTRIBUTE_UNUSED, goto cleanup; } info->romfile =3D virXMLPropString(rom, "file"); + + if (info->romenabled =3D=3D VIR_TRISTATE_BOOL_NO && + (info->rombar !=3D VIR_TRISTATE_SWITCH_ABSENT || info->romfile= )) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", + _("ROM tuning is not supported when ROM is disa= bled")); + goto cleanup; + } } =20 if (address && @@ -6811,6 +6834,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xml= opt ATTRIBUTE_UNUSED, virDomainDeviceInfoClear(info); VIR_FREE(type); VIR_FREE(rombar); + VIR_FREE(romenabled); VIR_FREE(aliasStr); return ret; } --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 23:05:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524239325151584.2156231419751; Fri, 20 Apr 2018 08:48:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2D0BC057F87; Fri, 20 Apr 2018 15:48:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A95268872F; Fri, 20 Apr 2018 15:48:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D01801805971; Fri, 20 Apr 2018 15:48:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3KFicKg001421 for ; Fri, 20 Apr 2018 11:44:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9174111701C2; Fri, 20 Apr 2018 15:44:38 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3467711701C3 for ; Fri, 20 Apr 2018 15:44:38 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 20 Apr 2018 17:44:30 +0200 Message-Id: <20180420154431.31536-3-abologna@redhat.com> In-Reply-To: <20180420154431.31536-1-abologna@redhat.com> References: <20180420154431.31536-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] qemu: Format rom.enabled attribute for PCI devices X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 20 Apr 2018 15:48:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The attribute can be used to disable ROM loading completely for a device. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1425058 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 13 ++++++++++-- tests/qemuxml2argvdata/pci-rom-disabled.args | 26 ++++++++++++++++++++++++ tests/qemuxml2argvdata/pci-rom-disabled.xml | 20 ++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmloutdata/pci-rom-disabled.xml | 29 +++++++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 1 + 6 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxml2argvdata/pci-rom-disabled.args create mode 100644 tests/qemuxml2argvdata/pci-rom-disabled.xml create mode 100644 tests/qemuxml2xmloutdata/pci-rom-disabled.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b666f3715f..84c4e1e350 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -442,13 +442,20 @@ static int qemuBuildRomStr(virBufferPtr buf, virDomainDeviceInfoPtr info) { - if (info->rombar || info->romfile) { + if (info->romenabled || info->rombar || info->romfile) { if (info->type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("rombar and romfile are supported only = for PCI devices")); + "%s", _("ROM tuning is only supported for PCI d= evices")); return -1; } =20 + /* Passing an empty romfile=3D tells QEMU to disable ROM entirely = for + * this device, and makes other settings irrelevant */ + if (info->romenabled =3D=3D VIR_TRISTATE_BOOL_NO) { + virBufferAddLit(buf, ",romfile=3D"); + goto done; + } + switch (info->rombar) { case VIR_TRISTATE_SWITCH_OFF: virBufferAddLit(buf, ",rombar=3D0"); @@ -464,6 +471,8 @@ qemuBuildRomStr(virBufferPtr buf, virQEMUBuildBufferEscapeComma(buf, info->romfile); } } + + done: return 0; } =20 diff --git a/tests/qemuxml2argvdata/pci-rom-disabled.args b/tests/qemuxml2a= rgvdata/pci-rom-disabled.args new file mode 100644 index 0000000000..8c9dc2fb80 --- /dev/null +++ b/tests/qemuxml2argvdata/pci-rom-disabled.args @@ -0,0 +1,26 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest \ +-S \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot c \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:24:a5:9f= ,bus=3Dpci.0,\ +addr=3D0x3,romfile=3D diff --git a/tests/qemuxml2argvdata/pci-rom-disabled.xml b/tests/qemuxml2ar= gvdata/pci-rom-disabled.xml new file mode 100644 index 0000000000..1c12052382 --- /dev/null +++ b/tests/qemuxml2argvdata/pci-rom-disabled.xml @@ -0,0 +1,20 @@ + + guest + c7a5fdbd-edaf-9466-926a-d65c16db1809 + 219100 + 1 + + hvm + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 74d930ebe2..ae9893a84e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1554,6 +1554,7 @@ mymain(void) DO_TEST_PARSE_ERROR("hostdev-mdev-invalid-target-address", QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST("pci-rom", NONE); + DO_TEST("pci-rom-disabled", NONE); =20 DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, NONE); DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, GIC_NONE, NONE); diff --git a/tests/qemuxml2xmloutdata/pci-rom-disabled.xml b/tests/qemuxml2= xmloutdata/pci-rom-disabled.xml new file mode 100644 index 0000000000..6a95064ebf --- /dev/null +++ b/tests/qemuxml2xmloutdata/pci-rom-disabled.xml @@ -0,0 +1,29 @@ + + guest + c7a5fdbd-edaf-9466-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + +
+ + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 9e77b9fb13..6c1f0b0fa6 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -474,6 +474,7 @@ mymain(void) DO_TEST("hostdev-vfio", NONE); DO_TEST("hostdev-mdev-precreated", NONE); DO_TEST("pci-rom", NONE); + DO_TEST("pci-rom-disabled", NONE); DO_TEST("pci-serial-dev-chardev", NONE); =20 DO_TEST("encrypted-disk", NONE); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 23:05:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524239332188150.1327044773849; Fri, 20 Apr 2018 08:48:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B132F3132593; Fri, 20 Apr 2018 15:48:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74A2B8572D; Fri, 20 Apr 2018 15:48:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 229314CAA6; Fri, 20 Apr 2018 15:48:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3KFidFJ001429 for ; Fri, 20 Apr 2018 11:44:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 34C0510AF9CA; Fri, 20 Apr 2018 15:44:39 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD49810B008B for ; Fri, 20 Apr 2018 15:44:38 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 20 Apr 2018 17:44:31 +0200 Message-Id: <20180420154431.31536-4-abologna@redhat.com> In-Reply-To: <20180420154431.31536-1-abologna@redhat.com> References: <20180420154431.31536-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] news: Document rom.enabled attribute for PCI devices X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 20 Apr 2018 15:48:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- docs/news.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index dec3f134ce..de95d919a2 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -56,6 +56,16 @@ host-passthrough CPU model. + + + qemu: Optionally disable ROM loading for PCI devices + + + The enabled attribute of the rom + sub-element, usable for PCI devices, can be used for situations + where loading a PCI ROM is not desiderable. + +
--=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 23:05:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152448453970769.64435344844696; Mon, 23 Apr 2018 04:55:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9344F80468; Mon, 23 Apr 2018 11:55:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A14EC177ED; Mon, 23 Apr 2018 11:55:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1C47D180596E; Mon, 23 Apr 2018 11:55:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3NBsfB7030895 for ; Mon, 23 Apr 2018 07:54:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1BD0A7C28; Mon, 23 Apr 2018 11:54:41 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-216.brq.redhat.com [10.40.204.216]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7494083B8B for ; Mon, 23 Apr 2018 11:54:37 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Mon, 23 Apr 2018 13:54:34 +0200 Message-Id: <20180423115434.23835-1-abologna@redhat.com> In-Reply-To: <20180420154431.31536-1-abologna@redhat.com> References: <20180420154431.31536-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/3] tests: Make sure rom.file='' for PCI devices keeps working X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 23 Apr 2018 11:55:38 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Even though we just introduced the rom.enabled attribute to properly cover the use case, there might be guests out there that use the only previously available way of disabling PCI ROM loading by not opting in to schema validation. To make sure such guests will keep working going forward, introduce a test case covering the legacy workaround. Signed-off-by: Andrea Bolognani --- .../qemuxml2argvdata/pci-rom-disabled-invalid.args | 1 + .../qemuxml2argvdata/pci-rom-disabled-invalid.xml | 25 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + .../pci-rom-disabled-invalid.xml | 29 ++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 57 insertions(+) create mode 120000 tests/qemuxml2argvdata/pci-rom-disabled-invalid.args create mode 100644 tests/qemuxml2argvdata/pci-rom-disabled-invalid.xml create mode 100644 tests/qemuxml2xmloutdata/pci-rom-disabled-invalid.xml diff --git a/tests/qemuxml2argvdata/pci-rom-disabled-invalid.args b/tests/q= emuxml2argvdata/pci-rom-disabled-invalid.args new file mode 120000 index 0000000000..0dffe3c624 --- /dev/null +++ b/tests/qemuxml2argvdata/pci-rom-disabled-invalid.args @@ -0,0 +1 @@ +pci-rom-disabled.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/pci-rom-disabled-invalid.xml b/tests/qe= muxml2argvdata/pci-rom-disabled-invalid.xml new file mode 100644 index 0000000000..5ef58d03ae --- /dev/null +++ b/tests/qemuxml2argvdata/pci-rom-disabled-invalid.xml @@ -0,0 +1,25 @@ + + guest + c7a5fdbd-edaf-9466-926a-d65c16db1809 + 219100 + 1 + + hvm + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ae9893a84e..5b3bd4a996 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1555,6 +1555,7 @@ mymain(void) QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST("pci-rom", NONE); DO_TEST("pci-rom-disabled", NONE); + DO_TEST("pci-rom-disabled-invalid", NONE); =20 DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, NONE); DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, GIC_NONE, NONE); diff --git a/tests/qemuxml2xmloutdata/pci-rom-disabled-invalid.xml b/tests/= qemuxml2xmloutdata/pci-rom-disabled-invalid.xml new file mode 100644 index 0000000000..745d19d8ad --- /dev/null +++ b/tests/qemuxml2xmloutdata/pci-rom-disabled-invalid.xml @@ -0,0 +1,29 @@ + + guest + c7a5fdbd-edaf-9466-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + +
+ + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 6c1f0b0fa6..4b5aa2315e 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -475,6 +475,7 @@ mymain(void) DO_TEST("hostdev-mdev-precreated", NONE); DO_TEST("pci-rom", NONE); DO_TEST("pci-rom-disabled", NONE); + DO_TEST("pci-rom-disabled-invalid", NONE); DO_TEST("pci-serial-dev-chardev", NONE); =20 DO_TEST("encrypted-disk", NONE); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list