From nobody Mon Feb 9 16:51:30 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 1550231795575795.8091534937985; Fri, 15 Feb 2019 03:56:35 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F714315D5A; Fri, 15 Feb 2019 11:56:33 +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 1F8FD60C6B; Fri, 15 Feb 2019 11:56:33 +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 B938A3F606; Fri, 15 Feb 2019 11:56:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1FBu1SX004417 for ; Fri, 15 Feb 2019 06:56:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id AF31D26E59; Fri, 15 Feb 2019 11:56:01 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 34F8426FB6 for ; Fri, 15 Feb 2019 11:56:01 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 15 Feb 2019 12:55:50 +0100 Message-Id: <20190215115552.23904-6-abologna@redhat.com> In-Reply-To: <20190215115552.23904-1-abologna@redhat.com> References: <20190215115552.23904-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] conf: Introduce virDomainControllerDefPostParse() 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 15 Feb 2019 11:56:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4cfdfb230e..872cb3352b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4917,6 +4917,22 @@ virDomainVideoDefPostParse(virDomainVideoDefPtr vide= o, } =20 =20 +static int +virDomainControllerDefPostParse(virDomainControllerDefPtr cdev) +{ + if (cdev->iothread && + cdev->model !=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) { + virReportError(VIR_ERR_XML_ERROR, + _("'iothread' attribute only supported for " + "controller model '%s'"), + virDomainControllerModelSCSITypeToString(VIR_DOMAIN= _CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)); + return -1; + } + + return 0; +} + + static int virDomainVsockDefPostParse(virDomainVsockDefPtr vsock) { @@ -4954,18 +4970,8 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDef= Ptr dev, virDomainHostdevDefPostParse(dev->data.hostdev, def, xmlopt) < 0) return -1; =20 - if (dev->type =3D=3D VIR_DOMAIN_DEVICE_CONTROLLER) { - virDomainControllerDefPtr cdev =3D dev->data.controller; - - if (cdev->iothread && - cdev->model !=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)= { - virReportError(VIR_ERR_XML_ERROR, - _("'iothread' attribute only supported for " - "controller model '%s'"), - virDomainControllerModelSCSITypeToString(VIR_DO= MAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)); - return -1; - } - } + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_CONTROLLER) + return virDomainControllerDefPostParse(dev->data.controller); =20 if (dev->type =3D=3D VIR_DOMAIN_DEVICE_NET) { virDomainNetDefPtr net =3D dev->data.net; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list