From nobody Fri Apr 19 03:32:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1574679282; cv=none; d=zohomail.com; s=zohoarc; b=jTC7IrNK+F3mFNKwGvFhKICgdCzkTtIIb9PP5AeOGxVo2VAVJed8JcJVbyaA1SQ3J8RGNxzgQp+ipumOsQV+dzg8c38QU/Xjoqoe7lQEQ9/NZXviV8sa6YsR40IY3j12ruZT1Hg2iu84W/z51RTOF6uQGnHGXkQ0D2Yy6ym23qc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574679282; h=Content-Type:Content-Transfer-Encoding:Cc: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=ixCP29gAYCH5FuQz3NJsZQAds27Y2O2uBypcw1tO6eI=; b=UR8IZnlURhebRsXn/vCCvP6N7N6fYwKzZg1h6s/HSKVqcUSGMvZ22hke4M25/rtV+Z10G+7URm29oaDVENjO7/+ofFSmhk0CRo52fXfmko90KyYrl9lqRKSLf1zB8A2ZjzyFofWyz9xE0hodRiTkX/pCuy2eFkVjLN03NDE6+dU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1574679282424777.8969176385814; Mon, 25 Nov 2019 02:54:42 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-137-e-HTSvzeNlKz6uHw42nrbA-1; Mon, 25 Nov 2019 05:54:39 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBA2E18B6382; Mon, 25 Nov 2019 10:54: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 93B17600C6; Mon, 25 Nov 2019 10:54: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 4CC494BB78; Mon, 25 Nov 2019 10:54:33 +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 xAPAsWN9011950 for ; Mon, 25 Nov 2019 05:54:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id AD6C519C7F; Mon, 25 Nov 2019 10:54:32 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id D91F819C69; Mon, 25 Nov 2019 10:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574679281; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ixCP29gAYCH5FuQz3NJsZQAds27Y2O2uBypcw1tO6eI=; b=edwUCDdCEYQz8lvSkrINs0VPmx7ADZa/H3iGl4GZWo/khWG/Si1LRBY7FzXmQFf0d7WEHG wWBA4xWDivmcfsW75hgapltbluZGf4+fHrYIe0SfqiI0WKzBt5zMkbysF1khkiLkXRGoar XcuZXUOk9Ky7uCfvfdry6e6VvzCP4Pg= From: Pavel Mores To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 11:54:23 +0100 Message-Id: <20191125105426.20970-2-pmores@redhat.com> In-Reply-To: <20191125105426.20970-1-pmores@redhat.com> References: <20191125105426.20970-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Pavel Mores , crobinso@redhat.com Subject: [libvirt] [PATCH v3 1/4] qemu: default video device type selection algoritm moved into its own function 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.11 X-MC-Unique: e-HTSvzeNlKz6uHw42nrbA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The default video device type selection algorithm we're about to deploy will increase the amount of code dedicated to the task by amount enough to warra= nt factoring the whole thing into its own function so as not to pollute the caller qemuDomainDeviceVideoDefPostParse(). Do it now so that the actual algorithm change later on is in a clean commit by itself and easy to review. Signed-off-by: Pavel Mores Reviewed-by: Cole Robinson --- src/qemu/qemu_domain.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d56dfa9f00..26da41f9ee 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7876,20 +7876,26 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr = net, } =20 =20 +static int +qemuDomainDefaultVideoDevice(const virDomainDef *def) +{ + if (ARCH_IS_PPC64(def->os.arch)) + return VIR_DOMAIN_VIDEO_TYPE_VGA; + else if (qemuDomainIsARMVirt(def) || + qemuDomainIsRISCVVirt(def) || + ARCH_IS_S390(def->os.arch)) + return VIR_DOMAIN_VIDEO_TYPE_VIRTIO; + else + return VIR_DOMAIN_VIDEO_TYPE_CIRRUS; +} + + static int qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video, const virDomainDef *def) { - if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { - if (ARCH_IS_PPC64(def->os.arch)) - video->type =3D VIR_DOMAIN_VIDEO_TYPE_VGA; - else if (qemuDomainIsARMVirt(def) || - qemuDomainIsRISCVVirt(def) || - ARCH_IS_S390(def->os.arch)) - video->type =3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO; - else - video->type =3D VIR_DOMAIN_VIDEO_TYPE_CIRRUS; - } + if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) + video->type =3D qemuDomainDefaultVideoDevice(def); =20 if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_QXL && !video->vgamem) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 03:32:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1574679288; cv=none; d=zohomail.com; s=zohoarc; b=oJmesQq7M8fB3MRdZZCitl/7SnL3QS+ygFNv27XRdiibo6VdRla5OxF+rnuwIvu4a5lwrN6KXB+29zg/xNOTi9+q8Qg/Ib/Q8WZldXSd1F29ttP7sjm/s75kAV/aYzMbdoMboL2/haQxGb++JB09PIE0pgE5mkK9eHtHq/SDgRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574679288; h=Content-Type:Content-Transfer-Encoding:Cc: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=tmN+WGAK0ohH3ED/9YrZkBB8CD1nD7taPYGDHshjvME=; b=mCSIRcat3gyDGY/LrDeJvYvT9yF/1OTxWRYbFE2dZ4IkqjKQ2nJ/AqLV1oFaCKDImlCK6oE+wEL8uPpNE10hjxLHPOhLWwkXO8bjpdHK3QXqpcnWAigSYlzoRe4suDyUXiaP8yAbrft/3lmTovqewdV1/wXGiJMzsBnlxaSGaR4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574679288336655.6501792164845; Mon, 25 Nov 2019 02:54:48 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-120-5-osIn6vO4eJS8Ly0ph1Sw-1; Mon, 25 Nov 2019 05:54:43 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACB86109D080; Mon, 25 Nov 2019 10:54:37 +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 81E625D6A0; Mon, 25 Nov 2019 10:54:37 +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 3ECF34E567; Mon, 25 Nov 2019 10:54:37 +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 xAPAsXEn011958 for ; Mon, 25 Nov 2019 05:54:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id CC79919C7F; Mon, 25 Nov 2019 10:54:33 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05DE719C6A; Mon, 25 Nov 2019 10:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574679287; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=tmN+WGAK0ohH3ED/9YrZkBB8CD1nD7taPYGDHshjvME=; b=BiLuHzYSbHcftB51BFz3OQCos2N8C34g993z7Wwm/lajvcUvqCamwhXY+Ox25mKvs5c6RR 5BojKbpPxV6k11sImkuKaww1ELWyhK6SHKGmE2/wwYtXI2noUYxWiL8UWn9Ff3TikLXnaz j2tk5WyWby/GVRPFFf72GA7P+XT6sDs= From: Pavel Mores To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 11:54:24 +0100 Message-Id: <20191125105426.20970-3-pmores@redhat.com> In-Reply-To: <20191125105426.20970-1-pmores@redhat.com> References: <20191125105426.20970-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Pavel Mores , crobinso@redhat.com Subject: [libvirt] [PATCH v3 2/4] qemu: prepare existing test for change of the default video device type 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.15 X-MC-Unique: 5-osIn6vO4eJS8Ly0ph1Sw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The test relied implicitly on default video device being cirrus. As we're about to change that the test would start failing. To avoid this, just make the test's requirement explicit. Signed-off-by: Pavel Mores Reviewed-by: Cole Robinson --- tests/qemuxml2xmltest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index ed53ddc8c6..2c61d7db8a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -372,7 +372,8 @@ mymain(void) DO_TEST("graphics-egl-headless-rendernode", QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_EGL_HEADLESS, - QEMU_CAPS_EGL_HEADLESS_RENDERNODE); + QEMU_CAPS_EGL_HEADLESS_RENDERNODE, + QEMU_CAPS_DEVICE_CIRRUS_VGA); =20 DO_TEST("input-usbmouse", NONE); DO_TEST("input-usbtablet", NONE); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 03:32:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1574679284; cv=none; d=zohomail.com; s=zohoarc; b=MIlbJHP/NyqvkCTZz3FHMsGaddrjEeMbG1nJw1Xpm63z3+sVstg+dczJ7jPNodOMvgygTfm6cQXWyOgKjVe64vMiCYO5eira0PhIoNsRmHPtPNrc1utkYP4ab4cQKgYN5s+hLzk8VjJJ8xj2XwJJL77tTEV61wz/PahJaabwpzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574679284; h=Content-Type:Content-Transfer-Encoding:Cc: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=VLzc4EC1aQRAKz3qSemf8MazS4YYqtNmDaKnFFY7QoU=; b=hVWBgYl0mEWMBdzt8n2DWqbuCJzPoGRHON200svgmhQC3rsUJQk0pWAS8Tds4lDPRkyvLeQupfQu+WygBibPCebMAp+OQf/9TSsFGsi2SE8y+bniNP7plYYMV39uskcCdArtKmg/9gakY1+JmCjRc555pwiTOjvSZPVsxqf7xKw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574679284541966.7362324737745; Mon, 25 Nov 2019 02:54:44 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-126-38lyBnOVPbm3BZ-W4a3NGA-1; Mon, 25 Nov 2019 05:54:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 792EB1083E84; Mon, 25 Nov 2019 10:54:36 +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 57D8B5D6AE; Mon, 25 Nov 2019 10:54: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 1A14B4A460; Mon, 25 Nov 2019 10:54:36 +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 xAPAsYgJ011968 for ; Mon, 25 Nov 2019 05:54:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id EE34F19C7F; Mon, 25 Nov 2019 10:54:34 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2797619C6A; Mon, 25 Nov 2019 10:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574679283; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=VLzc4EC1aQRAKz3qSemf8MazS4YYqtNmDaKnFFY7QoU=; b=IC1lOdzlov7EOYXWnqhQmDs348Mjr4ScLczujwGaQbv3LwHO6ZOiWZy/43UBJ1R5eK6wx4 AnRhLLZTgOZTMfXQslZE4MNKY1cJZz6owvUO26xLSkF+TLV9SdS31/IyrNKvHDuHUIEOdQ pQPKaIFSq0/vbAT4Qv57i9F5QvFD874= From: Pavel Mores To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 11:54:25 +0100 Message-Id: <20191125105426.20970-4-pmores@redhat.com> In-Reply-To: <20191125105426.20970-1-pmores@redhat.com> References: <20191125105426.20970-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Pavel Mores , crobinso@redhat.com Subject: [libvirt] [PATCH v3 3/4] qemu: the actual change of default video devide type selection algorithm 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.15 X-MC-Unique: 38lyBnOVPbm3BZ-W4a3NGA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If a graphics device was added to XML that had no video device, libvirt automatically added a video device which was always of type 'cirrus' on x86_64, even if the underlying qemu didn't support cirrus. This patch refines a bit the decision about the type of the video device. Based on QEMU capabilities, cirrus is still preferred but only added if QEMU supports it, otherwise VGA is used if supported by QEMU. There is now no fallback as libvirt only aspires to generate a basic working config and leaves anything more specific up to higher-level management tools. Signed-off-by: Pavel Mores Reviewed-by: Cole Robinson --- src/qemu/qemu_domain.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 26da41f9ee..18b6f1ea1c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7877,25 +7877,32 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr = net, =20 =20 static int -qemuDomainDefaultVideoDevice(const virDomainDef *def) +qemuDomainDefaultVideoDevice(const virDomainDef *def, + virQEMUCapsPtr qemuCaps) { - if (ARCH_IS_PPC64(def->os.arch)) + if (ARCH_IS_PPC64(def->os.arch)) { return VIR_DOMAIN_VIDEO_TYPE_VGA; - else if (qemuDomainIsARMVirt(def) || - qemuDomainIsRISCVVirt(def) || - ARCH_IS_S390(def->os.arch)) + } else if (qemuDomainIsARMVirt(def) || + qemuDomainIsRISCVVirt(def) || + ARCH_IS_S390(def->os.arch)) { return VIR_DOMAIN_VIDEO_TYPE_VIRTIO; - else - return VIR_DOMAIN_VIDEO_TYPE_CIRRUS; + } else { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) + return VIR_DOMAIN_VIDEO_TYPE_CIRRUS; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) + return VIR_DOMAIN_VIDEO_TYPE_VGA; + return VIR_DOMAIN_VIDEO_TYPE_DEFAULT; + } } =20 =20 static int qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video, - const virDomainDef *def) + const virDomainDef *def, + virQEMUCapsPtr qemuCaps) { if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) - video->type =3D qemuDomainDefaultVideoDevice(def); + video->type =3D qemuDomainDefaultVideoDevice(def, qemuCaps); =20 if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_QXL && !video->vgamem) { @@ -7989,7 +7996,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr de= v, break; =20 case VIR_DOMAIN_DEVICE_VIDEO: - ret =3D qemuDomainDeviceVideoDefPostParse(dev->data.video, def); + ret =3D qemuDomainDeviceVideoDefPostParse(dev->data.video, def, qe= muCaps); break; =20 case VIR_DOMAIN_DEVICE_PANIC: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 03:32:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1574679288; cv=none; d=zohomail.com; s=zohoarc; b=H3JNYHStIWyZdCMu3edUNCXKxzeOtphF9wUyi6HV541KwoSW9GAO5tKX4ii11nUQQBdEauX9903+A6qWjoiimMRX2/w0Shh2yLEgrEfgCfl4T755Y/04ZxH1GRkDBt16hrvLazOS9/ziNNGtLWS7Dg8fI9gWpCkqvkwzzJNFQg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574679288; h=Content-Type:Content-Transfer-Encoding:Cc: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=rAPoeXOI4ClxxXwc2tms2lY6pOab41WSXr46mT6OWTs=; b=dpmz83IkwpRedOELF7OxUTKEnkHcYuhuRJLwtVnC1y9XrX6NI/Qqhw+KZX/qQn3fOrD7Rai0Vis+/qC7Ar8rwqnyg/Clb38X+PE9UZU5hkFryCAc0RHqfG3jGs/1HTpQxF521098AMdSNUOJHEXMnSdyPb7BubgGXmsvzzjL6dg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1574679288657423.0008038034382; Mon, 25 Nov 2019 02:54:48 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-tXkK9bvuOCKElvI4eqQBDg-1; Mon, 25 Nov 2019 05:54:45 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBDCC800581; Mon, 25 Nov 2019 10:54:39 +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 B80285D6AE; Mon, 25 Nov 2019 10:54:39 +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 7AB4B4E56D; Mon, 25 Nov 2019 10:54:39 +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 xAPAsaDJ011979 for ; Mon, 25 Nov 2019 05:54:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 442EB19C70; Mon, 25 Nov 2019 10:54:36 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 494D019C69; Mon, 25 Nov 2019 10:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574679287; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=rAPoeXOI4ClxxXwc2tms2lY6pOab41WSXr46mT6OWTs=; b=MbK5XCirAaTa04Yl1D5JnZdPdxp9Z5kVJ/szuH4vcgT0QrUVNS+xRAPuxbTmg+BME/sVR8 w+qPZQDayNpITpJlk0iXZtSEtOw8HauZ8Him8kEzdeFrfUiRPPQvlTTNbcE61R9ZWZHOzJ YQPM/Jnef+kLthGp5+dIZ7BCjkZHB68= From: Pavel Mores To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 11:54:26 +0100 Message-Id: <20191125105426.20970-5-pmores@redhat.com> In-Reply-To: <20191125105426.20970-1-pmores@redhat.com> References: <20191125105426.20970-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Pavel Mores , crobinso@redhat.com Subject: [libvirt] [PATCH v3 4/4] qemu: added tests of the new default video type selection algorithm 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.15 X-MC-Unique: tXkK9bvuOCKElvI4eqQBDg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The test case for x86_64 and neither cirrus nor vga capability is of the xml2argv type because it actually fails to parse the XML at all [*] which is something that xml2xml tests don't seem to handle. xml2argv test fails to produce a qemu argv for this case which xml2argv tests can handle. [*] This is a consequence of the decision not to have a fallback if the obvious choices (cirrus and vga) aren't viable due to missing QEMU caps. Signed-off-by: Pavel Mores Reviewed-by: Cole Robinson --- .../default-video-type-aarch64.xml | 16 +++++++ .../default-video-type-ppc64.xml | 16 +++++++ .../default-video-type-riscv64.xml | 16 +++++++ .../default-video-type-s390x.xml | 16 +++++++ .../default-video-type-x86_64-caps-test-0.xml | 17 ++++++++ .../default-video-type-x86_64-caps-test-1.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 1 + ...ault-video-type-aarch64.aarch64-latest.xml | 42 +++++++++++++++++++ .../default-video-type-ppc64.ppc64-latest.xml | 31 ++++++++++++++ ...ault-video-type-riscv64.riscv64-latest.xml | 39 +++++++++++++++++ .../default-video-type-s390x.s390x-latest.xml | 32 ++++++++++++++ .../default-video-type-x86_64-caps-test-0.xml | 31 ++++++++++++++ .../default-video-type-x86_64-caps-test-1.xml | 31 ++++++++++++++ tests/qemuxml2xmltest.c | 7 ++++ 14 files changed, 312 insertions(+) create mode 100644 tests/qemuxml2argvdata/default-video-type-aarch64.xml create mode 100644 tests/qemuxml2argvdata/default-video-type-ppc64.xml create mode 100644 tests/qemuxml2argvdata/default-video-type-riscv64.xml create mode 100644 tests/qemuxml2argvdata/default-video-type-s390x.xml create mode 100644 tests/qemuxml2argvdata/default-video-type-x86_64-caps-t= est-0.xml create mode 100644 tests/qemuxml2argvdata/default-video-type-x86_64-caps-t= est-1.xml create mode 100644 tests/qemuxml2xmloutdata/default-video-type-aarch64.aar= ch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/default-video-type-ppc64.ppc64= -latest.xml create mode 100644 tests/qemuxml2xmloutdata/default-video-type-riscv64.ris= cv64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/default-video-type-s390x.s390x= -latest.xml create mode 100644 tests/qemuxml2xmloutdata/default-video-type-x86_64-caps= -test-0.xml create mode 100644 tests/qemuxml2xmloutdata/default-video-type-x86_64-caps= -test-1.xml diff --git a/tests/qemuxml2argvdata/default-video-type-aarch64.xml b/tests/= qemuxml2argvdata/default-video-type-aarch64.xml new file mode 100644 index 0000000000..03326d3c9b --- /dev/null +++ b/tests/qemuxml2argvdata/default-video-type-aarch64.xml @@ -0,0 +1,16 @@ + + default-video-type-aarch64-test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1 + + hvm + + + + /usr/bin/qemu-system-aarch64 + + + + + diff --git a/tests/qemuxml2argvdata/default-video-type-ppc64.xml b/tests/qe= muxml2argvdata/default-video-type-ppc64.xml new file mode 100644 index 0000000000..739e07fc19 --- /dev/null +++ b/tests/qemuxml2argvdata/default-video-type-ppc64.xml @@ -0,0 +1,16 @@ + + default-video-type-ppc64-test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1 + + hvm + + + + /usr/bin/qemu-system-ppc64 + + + + + diff --git a/tests/qemuxml2argvdata/default-video-type-riscv64.xml b/tests/= qemuxml2argvdata/default-video-type-riscv64.xml new file mode 100644 index 0000000000..55f6fa9391 --- /dev/null +++ b/tests/qemuxml2argvdata/default-video-type-riscv64.xml @@ -0,0 +1,16 @@ + + default-video-type-riscv64-test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1 + + hvm + + + + /usr/bin/qemu-system-riscv64 + + + + + diff --git a/tests/qemuxml2argvdata/default-video-type-s390x.xml b/tests/qe= muxml2argvdata/default-video-type-s390x.xml new file mode 100644 index 0000000000..9eda06a3a1 --- /dev/null +++ b/tests/qemuxml2argvdata/default-video-type-s390x.xml @@ -0,0 +1,16 @@ + + default-video-type-s390x-test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1 + + hvm + + + + /usr/bin/qemu-system-s390x + + + + + diff --git a/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.x= ml b/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.xml new file mode 100644 index 0000000000..2c753fe227 --- /dev/null +++ b/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.xml @@ -0,0 +1,17 @@ + + default-video-type-x86_64-test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1 + + hvm + + + + /usr/bin/qemu-system-x86_64 + + + + + + diff --git a/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-1.x= ml b/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-1.xml new file mode 100644 index 0000000000..2c753fe227 --- /dev/null +++ b/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-1.xml @@ -0,0 +1,17 @@ + + default-video-type-x86_64-test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1 + + hvm + + + + /usr/bin/qemu-system-x86_64 + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 07e711840d..a2791d0460 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2059,6 +2059,7 @@ mymain(void) DO_TEST("video-none-device", QEMU_CAPS_VNC); DO_TEST_PARSE_ERROR("video-invalid-multiple-devices", NONE); + DO_TEST_PARSE_ERROR("default-video-type-x86_64-caps-test-0", NONE); =20 DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE_VIRTIO_RNG, diff --git a/tests/qemuxml2xmloutdata/default-video-type-aarch64.aarch64-la= test.xml b/tests/qemuxml2xmloutdata/default-video-type-aarch64.aarch64-late= st.xml new file mode 100644 index 0000000000..4b660b8d70 --- /dev/null +++ b/tests/qemuxml2xmloutdata/default-video-type-aarch64.aarch64-latest.xml @@ -0,0 +1,42 @@ + + default-video-type-aarch64-test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1048576 + 1 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + + +
+ + + + +
+ + + + +