From nobody Sun Feb 8 13:33:11 2026 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=1642527853; cv=none; d=zohomail.com; s=zohoarc; b=fzf5zS9b3DsXVQhcAu4VaVa6fU+RZ7Zhbl+FnjPZitH5fWqjO+zkPVxhmoJhPFrZltCfBqucQZdKa7ZZtWwVkYslnVRggG8yje+Rqg455EGR9Q6/VpTK5WWdqpnyQfH1NReV+Jbcpu28RDVEY8OmWNbAZlz/4mTgPvf4GJbQz9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642527853; 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=qV6fRzLjcdbQSTg2nqzIy5/F3i2RWd86VD4MJmuQZ9s=; b=AO1rZu9uJMTiSvNZD4lB2i953FjqOpmJ2hVS+KW4lNFD4UcKaNNbX4PgZ8eYxSIFH8iiwE9tqtrjafzeoEewkR3PomOeegp4Lv3AmTyLuQDsbE3rY+/41jCYtu+2O3pkufBYrnhhSC0O9bWttyDQDHRosVMa7eGJhsC0iqftwAQ= 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 1642527853721795.0378076633269; Tue, 18 Jan 2022 09:44:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-345-SK9jcrqIOIeqPE0GrjXflg-1; Tue, 18 Jan 2022 12:43:57 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id F23A3BFFAC; Tue, 18 Jan 2022 17:28:18 +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 D3DBB7EBF6; Tue, 18 Jan 2022 17:28:18 +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 840FD4A705; Tue, 18 Jan 2022 17:28:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20IG5NNX030681 for ; Tue, 18 Jan 2022 11:05:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 52D29B18AD; Tue, 18 Jan 2022 16:05:23 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2B35B18A7 for ; Tue, 18 Jan 2022 16:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642527852; 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=qV6fRzLjcdbQSTg2nqzIy5/F3i2RWd86VD4MJmuQZ9s=; b=eot67/mJ/WQnmj3iQpbCaP90Z0ZJyo1EwTPHytRLoAC7QTdnDtn6+lJJzxsOuYSjNGCSLo GMsUeydTdJAbsVEyc0mq97qvWj2WoPlkensUwFBPc+vv28yfU8zRK5N5bj7O3/kQvIP9Jd C48BaxB6bTnEGNi/SkSb5RDJOPGKFds= X-MC-Unique: SK9jcrqIOIeqPE0GrjXflg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/5] qemuValidateDomainDeviceDefVideo: Refactor condition checking for qxl and virtio-vga Date: Tue, 18 Jan 2022 17:04:55 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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: 1642527855606100001 Content-Type: text/plain; charset="utf-8" Subsequent patch will use the same condition so move the primary device check into a nested condition. Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3a69733f81..5b2af94890 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2472,14 +2472,14 @@ qemuValidateDomainDeviceDefVideo(const virDomainVid= eoDef *video, return -1; } - if (!video->primary && - video->type !=3D VIR_DOMAIN_VIDEO_TYPE_QXL && + if (video->type !=3D VIR_DOMAIN_VIDEO_TYPE_QXL && video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type '%s' is only valid as primary " - "video device"), - virDomainVideoTypeToString(video->type)); - return -1; + if (!video->primary) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type '%s' is only valid as primary vid= eo device"), + virDomainVideoTypeToString(video->type)); + return -1; + } } if (video->accel && video->accel->accel2d =3D=3D VIR_TRISTATE_SWITCH_O= N) { --=20 2.34.1