From nobody Sun Feb 8 12:20:35 2026 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 1554421110309836.0893408631667; Thu, 4 Apr 2019 16:38:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BC3019CBCD; Thu, 4 Apr 2019 23:38:29 +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 17A831001E99; Thu, 4 Apr 2019 23:38:29 +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 D45E33FB16; Thu, 4 Apr 2019 23:38:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x34Nbih1011064 for ; Thu, 4 Apr 2019 19:37:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id D458660922; Thu, 4 Apr 2019 23:37:44 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-124-22.rdu2.redhat.com [10.10.124.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 062B96092D; Thu, 4 Apr 2019 23:37:43 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 4 Apr 2019 19:37:26 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] qemu: domain: Call virDomainCapsDeviceDefValidate 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 04 Apr 2019 23:38:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Fill in virDomainCaps at Validate time and use it to call virDomainCapsDeviceDefValidate Signed-off-by: Cole Robinson --- src/qemu/qemu_domain.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f0bf1aa4fe..6da27a79b0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -41,6 +41,7 @@ #include "viruuid.h" #include "virfile.h" #include "domain_addr.h" +#include "domain_capabilities.h" #include "domain_event.h" #include "virtime.h" #include "virnetdevopenvswitch.h" @@ -6119,14 +6120,24 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDe= f *dev, int ret =3D 0; virQEMUDriverPtr driver =3D opaque; virQEMUCapsPtr qemuCaps =3D NULL; + virDomainCapsPtr domCaps =3D NULL; =20 if (!(qemuCaps =3D virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator))) return -1; =20 + if (!(domCaps =3D virQEMUDriverGetDomainCapabilities(driver, qemuCaps, + def->os.machine, + def->os.arch, + def->virtType))) + goto cleanup; + if ((ret =3D qemuDomainDeviceDefValidateAddress(dev, qemuCaps)) < 0) goto cleanup; =20 + if (virDomainCapsDeviceDefValidate(domCaps, dev, def) < 0) + goto cleanup; + switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_NET: ret =3D qemuDomainDeviceDefValidateNetwork(dev->data.net); @@ -6207,6 +6218,7 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef = *dev, =20 cleanup: virObjectUnref(qemuCaps); + virObjectUnref(domCaps); return ret; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list