From nobody Fri Apr 26 00:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585066536; cv=none; d=zohomail.com; s=zohoarc; b=XpymUoBNeb5PNvZwtTDSZQcCSR8Yj40+tjvWP+5teElILsBk6spcpcQUpCoWXstyrIEZ+Y+fuGaVmiCgyAUaq4mc/RGjXIaMkFhOfwk1gQ1kKlA7d2sZPu2Q1N2QwHugnw64JyOEUdoW9MdQv6urCT68VS7fCqvL8kA++czQ31c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585066536; 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=ynaGp6yRbDfOnt5VChQfSh3azW88Gt12FHB3810HsiU=; b=PkfFlhMPWLB4o/2eo9Qcd633j0gwkp9KO6Z1QbF5bcqyW/AqXRRFGNuo5B/SbuqxMsSLEwTC4FJCzXwrFA2EQSuXUhpxrXBFoyLzgAloczgMfYAGNM0JPJzmHmgdmUGs8kE1SafsJAdxzgBFkmbC4AvXZwBAVxyLD0xSVU6cWoI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585066536971477.6923132515582; Tue, 24 Mar 2020 09:15:36 -0700 (PDT) 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-390-Gl23D1fFORS2DM-k3RdRdA-1; Tue, 24 Mar 2020 12:15:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D5FEDBA8; Tue, 24 Mar 2020 16:15:24 +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 0259489E76; Tue, 24 Mar 2020 16:15:24 +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 B5BD086386; Tue, 24 Mar 2020 16:15:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02OGFIhD029499 for ; Tue, 24 Mar 2020 12:15:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id A22442166B29; Tue, 24 Mar 2020 16:15:18 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B5B02166B2B for ; Tue, 24 Mar 2020 16:15:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9BA14101A55A for ; Tue, 24 Mar 2020 16:15:15 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-7uzcDdriOlaHoTPUj7B1DA-1; Tue, 24 Mar 2020 12:15:12 -0400 Received: by mail-wr1-f66.google.com with SMTP id u10so1850073wro.7 for ; Tue, 24 Mar 2020 09:15:12 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id r17sm762028wrx.46.2020.03.24.09.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585066535; 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=ynaGp6yRbDfOnt5VChQfSh3azW88Gt12FHB3810HsiU=; b=U4Yc+4pVxEOt+TgUndIE4QUN+iXF62YOu7DkbaDYt8v3WWwondS6XFniRgS5C3jB1kbiu9 6W3oLGG1w9eYUDUE0xOSkXCVElNsTmPFBe+ynxj8k8BxPlGgMBP27uodKEg1xPMVjQf/rC M1WsMJuPSlxpFZGUnR7mHp3qhx7XMMI= X-MC-Unique: Gl23D1fFORS2DM-k3RdRdA-1 X-MC-Unique: 7uzcDdriOlaHoTPUj7B1DA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5MjChbDJ+KCtw660ln9UStDR2QXuroITyJY7+ahFhkI=; b=QwryceCqNbMCDodJAO/Hy9/8ddFRNw4FV1Zspb0nxYdoq/k+XCbpjS+gf6suiIvE8O FdsiyQWWFl33yHF5DH6Uz3qGKRXLjP9Qcni5B5k4XX7eazpTAcK60lj0nUXJOhbyvo63 1eNz/cuAoinFtcEkXazSM4FbogL+eNx+DGNRrJ/eg5lCWpG25ZlLw6UTbmfLs0i0pw7Z CFt9kmEvdUfzA+Ta+KVBAHZCOtBqh1VJysYfymeqRuNeGu1RVkLsaDeCJbdbCYkry27y Jl07yXcQcy5PcAAL4ZKGXVZSZtYMGw4NfmzUWm/XxIRvAEmWPNCdUCzC/FWS7L1UEyhF vgxQ== X-Gm-Message-State: ANhLgQ1MWII3b/LL4C6wSn54cORW54PQpWfgn9xHAJYtN3ii04cYVsX8 9YlEHJafkCd7zuSdj0nij1OjKO688Hw= X-Google-Smtp-Source: ADFU+vuI6zDFFQwTzj5IEC6vMNacDBb3Pt48D/tn4O/3qpvY9c/NRiNqIQk3Lij7vn76GLNaTn5zNA== X-Received: by 2002:adf:fcc8:: with SMTP id f8mr19062480wrs.132.1585066511201; Tue, 24 Mar 2020 09:15:11 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 1/7] bhyve: move video default logic to driver Date: Tue, 24 Mar 2020 17:14:30 +0100 Message-Id: <20200324161436.2138755-2-r4f4rfs@gmail.com> In-Reply-To: <20200324161436.2138755-1-r4f4rfs@gmail.com> References: <20200324161436.2138755-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OGFIhD029499 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The logic setting a device default should be in the post parse function of individual driver code. Signed-off-by: Rafael Fonseca Reviewed-by: Michal Privoznik --- src/bhyve/bhyve_domain.c | 5 +++++ src/conf/domain_conf.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index a2a0619846..40ee461b19 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -161,6 +161,11 @@ bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr de= v, } } =20 + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video.type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + dev->data.video.type =3D VIR_DOMAIN_VIDEO_TYPE_GOP; + } + return 0; } =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a88a5a744e..957989e848 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15738,7 +15738,6 @@ virDomainVideoDefaultType(const virDomainDef *def) else return VIR_DOMAIN_VIDEO_TYPE_PARALLELS; case VIR_DOMAIN_VIRT_BHYVE: - return VIR_DOMAIN_VIDEO_TYPE_GOP; case VIR_DOMAIN_VIRT_QEMU: case VIR_DOMAIN_VIRT_KQEMU: case VIR_DOMAIN_VIRT_KVM: --=20 2.25.1 From nobody Fri Apr 26 00:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585066546; cv=none; d=zohomail.com; s=zohoarc; b=f8P0soeVjaEFcAiKJY5SU5zD8SVz/rlLFC+TasQp0OUife6v6FRkuSlJwzBkDs4YFmTd62/4pvA2WGkPYD8ccHKf6abjvnTgaHCpKuxSH/REkdDk/qNhBsQOtm+++1OFB+vPbZsI8UBwsFsqVfq/DZHxviGkqaueu89RicBq0YA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585066546; 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=MnNlAVGSXP3vWMGBO7oi+8f8JNbpdDn1H+JytcbiTHw=; b=aLojrzN8g/BMymuy4itrOIbgpmRTvrShWsLP61HFI8EocLyYBCcKBDXtCPK8SfTigrlwCV+KATFCuWnTDwTYaywciaKa+fGw3r4bGH8Jv9DpnY/LWBVODMFuW6XgI7uF1LKze/4Wb3U3F4ZQ05Ga1uRmcSUaR0AWak+zfJudutk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585066546809340.59519134311563; Tue, 24 Mar 2020 09:15:46 -0700 (PDT) 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-26-tekbqRHXP32--VU37kxB1w-1; Tue, 24 Mar 2020 12:15:40 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28694DBA8; Tue, 24 Mar 2020 16:15:35 +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 E6A231000322; Tue, 24 Mar 2020 16:15:34 +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 8ACAE86382; Tue, 24 Mar 2020 16:15:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02OGFR5d029531 for ; Tue, 24 Mar 2020 12:15:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 46D5E2063FEA; Tue, 24 Mar 2020 16:15:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4218C2063FE7 for ; Tue, 24 Mar 2020 16:15:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE8268007CB for ; Tue, 24 Mar 2020 16:15:22 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-LhOV8QTTP0ioD9UnWIMB6Q-1; Tue, 24 Mar 2020 12:15:14 -0400 Received: by mail-wr1-f67.google.com with SMTP id s1so22215504wrv.5 for ; Tue, 24 Mar 2020 09:15:14 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id r17sm762028wrx.46.2020.03.24.09.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585066545; 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=MnNlAVGSXP3vWMGBO7oi+8f8JNbpdDn1H+JytcbiTHw=; b=A1/suXzOtHlEFfgc9WofXspEKkYXh2UM/LjOV2U2awEtR0/Y1ETEudTXkWOxfhO+mtPscW 5LPavaSC97mywqc+Q5iOFRThUouWxnhCWKF1dI1bvYI5XWnJ8NJFzuBGhYVMREaUWSo/IF TZeiGkba4MMTfnwU/easy3kqHZ56Zps= X-MC-Unique: tekbqRHXP32--VU37kxB1w-1 X-MC-Unique: LhOV8QTTP0ioD9UnWIMB6Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GXD94sgVfh8einRzCjApLn5NTBvI7kbwsWC6p25sY1g=; b=cSOLd+sRyawlFBKVWRYjul3hwNiod/pdAl96vyHkoZBfv/ZKq97rnV932DDHt3XlPM v7sUEv+GL41yAgYPK9Tkpfn2dYjNPnUf02s8Y8cgwKwOYr8h1R/0CYpDkgs02iERld8/ s2k9Tw9VXkUqrZcpjVkJvNTHmqjzcMoi1ASly+uVr957vHRaaZkqHLHZZXKMejXJjQrH 3gL/Zi4jHRCrmQm8bQtUK0TZkU6zX0zba35ftIAiwViUbnXFi3ihwO+Dz6tVR3sBxwj/ 4MYMbIMVZL44xIZ5bjVW0rkdApg+xRfwW1nObeXZPIxQRCT12UQQDJpXEHXYto2RNlDf oC9w== X-Gm-Message-State: ANhLgQ2IwivSzB1lvaxxglO3AXEcVmewvtGFFTC7a7rTJUmlHw+keOAx BzYOFNVprvGy3Nq9p9m/sOXQ9YRuBGQ= X-Google-Smtp-Source: ADFU+vvZ17YNxVBk36Lfm+nsQrJApc1cEXP6H9v2CLvOlYWNLqoS47NUBy31OcsNkQu1uc2C7G8rLg== X-Received: by 2002:a5d:468c:: with SMTP id u12mr23569485wrq.394.1585066512853; Tue, 24 Mar 2020 09:15:12 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 2/7] libxl: move video default logic to driver Date: Tue, 24 Mar 2020 17:14:31 +0100 Message-Id: <20200324161436.2138755-3-r4f4rfs@gmail.com> In-Reply-To: <20200324161436.2138755-1-r4f4rfs@gmail.com> References: <20200324161436.2138755-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OGFR5d029531 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The logic setting a device default should be in the post parse function of individual driver code. Signed-off-by: Rafael Fonseca Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 2 +- src/libxl/libxl_domain.c | 60 ++++++++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 957989e848..04636e8694 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15716,7 +15716,6 @@ virDomainVideoDefaultType(const virDomainDef *def) { switch ((virDomainVirtType)def->virtType) { case VIR_DOMAIN_VIRT_TEST: - case VIR_DOMAIN_VIRT_XEN: if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_XEN || def->os.type =3D=3D VIR_DOMAIN_OSTYPE_LINUX) return VIR_DOMAIN_VIDEO_TYPE_XEN; @@ -15737,6 +15736,7 @@ virDomainVideoDefaultType(const virDomainDef *def) return VIR_DOMAIN_VIDEO_TYPE_VGA; else return VIR_DOMAIN_VIDEO_TYPE_PARALLELS; + case VIR_DOMAIN_VIRT_XEN: case VIR_DOMAIN_VIRT_BHYVE: case VIR_DOMAIN_VIRT_QEMU: case VIR_DOMAIN_VIRT_KQEMU: diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index e3da9f777d..cc53a765e1 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -315,31 +315,43 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr d= ev, pcisrc->backend =3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN; } =20 - if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && def->os.type =3D=3D VI= R_DOMAIN_OSTYPE_HVM) { - int dm_type =3D libxlDomainGetEmulatorType(def); - - switch (dev->data.video->type) { - case VIR_DOMAIN_VIDEO_TYPE_VGA: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - if (dev->data.video->vram =3D=3D 0) { - if (dm_type =3D=3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) - dev->data.video->vram =3D 16 * 1024; - else - dev->data.video->vram =3D 8 * 1024; - } - break; - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - if (dev->data.video->vram =3D=3D 0) { - if (dm_type =3D=3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) - dev->data.video->vram =3D 8 * 1024; - else - dev->data.video->vram =3D 4 * 1024; + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO) { + if (dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_XEN || + def->os.type =3D=3D VIR_DOMAIN_OSTYPE_LINUX) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_XEN; + else if (ARCH_IS_PPC64(def->os.arch)) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VGA; + else + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_CIRRUS; + } + + if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) { + int dm_type =3D libxlDomainGetEmulatorType(def); + + switch (dev->data.video->type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_XEN: + if (dev->data.video->vram =3D=3D 0) { + if (dm_type =3D=3D LIBXL_DEVICE_MODEL_VERSION_QEMU= _XEN) + dev->data.video->vram =3D 16 * 1024; + else + dev->data.video->vram =3D 8 * 1024; + } + break; + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + if (dev->data.video->vram =3D=3D 0) { + if (dm_type =3D=3D LIBXL_DEVICE_MODEL_VERSION_QEMU= _XEN) + dev->data.video->vram =3D 8 * 1024; + else + dev->data.video->vram =3D 4 * 1024; + } + break; + case VIR_DOMAIN_VIDEO_TYPE_QXL: + if (dev->data.video->vram =3D=3D 0) + dev->data.video->vram =3D 128 * 1024; + break; } - break; - case VIR_DOMAIN_VIDEO_TYPE_QXL: - if (dev->data.video->vram =3D=3D 0) - dev->data.video->vram =3D 128 * 1024; - break; } } =20 --=20 2.25.1 From nobody Fri Apr 26 00:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585066549; cv=none; d=zohomail.com; s=zohoarc; b=OdXhFtdcT0cBxrIGtposxy+bjPkajShfK6ib5hzmfXWlLtR5Auh/Tdx+I0kEzp9V6gBSnhHLfkIxK7zWeQexBAlrUYH0U51EJp3pWBox23HiaRlJ3cx5ciIOjrr0ftP2HcDbWOcuTdn+zX56tMXFeZsySywoU/3Ue3AzXn/bvSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585066549; 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=flUETnfisRBArCw6Pl8noe0fvDLP6ow89VhxKn+beMg=; b=cmn1/AA0Jkn4+XgGGJtuNGiN2a2Y7X6O7e2+wIGRA6liYo/PPeaFC10vIp8HufqjtyhiDJ6ay0deSXK7JRhR1xowgMIV79sSdK24G0Xi+D++mDX516mJyv7JPXgLUXmEoSvIRKNoTJj1ykLecTl8zIAgk3GUqbsJIKm9H8LrnXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585066549344717.9144984409435; Tue, 24 Mar 2020 09:15:49 -0700 (PDT) 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-195-V2Ft2lxxM_yHXACoVRb7KA-1; Tue, 24 Mar 2020 12:15:45 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9284318C35A3; Tue, 24 Mar 2020 16:15: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 4FA695D9C5; Tue, 24 Mar 2020 16:15: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 D827818089D6; Tue, 24 Mar 2020 16:15:36 +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 02OGFTba029545 for ; Tue, 24 Mar 2020 12:15:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 75B8F10EE780; Tue, 24 Mar 2020 16:15:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E9101004C65 for ; Tue, 24 Mar 2020 16:15:25 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE77A8007B3 for ; Tue, 24 Mar 2020 16:15:25 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-477-IiW-NHWBPRepi63vmGSmAA-1; Tue, 24 Mar 2020 12:15:18 -0400 Received: by mail-wm1-f66.google.com with SMTP id l20so4176842wmi.3 for ; Tue, 24 Mar 2020 09:15:18 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id r17sm762028wrx.46.2020.03.24.09.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585066548; 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=flUETnfisRBArCw6Pl8noe0fvDLP6ow89VhxKn+beMg=; b=UCaFiN23E+hk6DPvmTX2WO261QaDy+OyXaILyWh/RHFwqlrl6RGAw+Lttf0jr3uNhJOeAT O8BjWoMCXKAgYIyCH8547c9dz2R3WiB7zt2mj6sWt7kwXTfTTaZ2Q/REbB9teUDXSduMjj FlDL7/8LNzg+G31a/ZM/lKXkTcs51U0= X-MC-Unique: V2Ft2lxxM_yHXACoVRb7KA-1 X-MC-Unique: IiW-NHWBPRepi63vmGSmAA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i/NMtwVX52BMVQNzJ0U7TFcQwYHqduBuwZuVu8GtHYs=; b=F65ilHsAXmJTIyOjr10fRm0IQvz4X6s+YFtfMy+8JEfHpGn6J7ImlCVm5cXwx03hdB WiBWR3/ZbhwOR+8etDbWy2rdIGLfh1khG4duR5ZiBrVSh03OTC4a5qOw6ZL3TthhFpBs TJiPjbqlogl2c1GOpnPnAs3kVdY9baos1Jn6p9TBr/u4jO6jT71OPsQV+QaUY6O68IAh L4PIvBHR8N+D2YMirAzG3NzXB2VJO7Lzx3df2jllbv73rdvXj+0D3I9MerEGDHDObRD4 SjFhI6l74T2AyYVq0lmFTqLpFggWKH8AbeRZ+kkYHrXa2sjA0KSfzjHZK2d9Qes/qbb8 aV4Q== X-Gm-Message-State: ANhLgQ0rq1afk9gnoanpg0pkR567xvLpYdKbwS58/GapwH2E2ZlMYj7T OpC1JtKYYQfpi1Mej9dHLF2crKDcluc= X-Google-Smtp-Source: ADFU+vvdC/KUmfggPoU5NeIRzANMruUwdd/R+XUjCTr0x3Uo1/QT7+44Dqk7OtvvaqSRJzdOlznsQA== X-Received: by 2002:a05:600c:24d2:: with SMTP id 18mr6269235wmu.38.1585066515413; Tue, 24 Mar 2020 09:15:15 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 3/7] vz: openvz: move video default logic to driver Date: Tue, 24 Mar 2020 17:14:32 +0100 Message-Id: <20200324161436.2138755-4-r4f4rfs@gmail.com> In-Reply-To: <20200324161436.2138755-1-r4f4rfs@gmail.com> References: <20200324161436.2138755-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OGFTba029545 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The logic setting a device default should be in the post parse function of individual driver code. Signed-off-by: Rafael Fonseca Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 4 ---- src/openvz/openvz_conf.c | 8 ++++++++ src/vz/vz_driver.c | 8 ++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 04636e8694..e6a3500b7a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15732,10 +15732,6 @@ virDomainVideoDefaultType(const virDomainDef *def) =20 case VIR_DOMAIN_VIRT_VZ: case VIR_DOMAIN_VIRT_PARALLELS: - if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) - return VIR_DOMAIN_VIDEO_TYPE_VGA; - else - return VIR_DOMAIN_VIDEO_TYPE_PARALLELS; case VIR_DOMAIN_VIRT_XEN: case VIR_DOMAIN_VIRT_BHYVE: case VIR_DOMAIN_VIRT_QEMU: diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 1d60afae93..78547b8b28 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -1117,6 +1117,14 @@ openvzDomainDeviceDefPostParse(virDomainDeviceDefPtr= dev, return -1; } =20 + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VGA; + else + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_PARALLELS; + } + return 0; } =20 diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 6605247dd9..d882b91def 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -281,6 +281,14 @@ vzDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) dev->data.net->model =3D VIR_DOMAIN_NET_MODEL_E1000; =20 + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VGA; + else + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_PARALLELS; + } + return 0; } =20 --=20 2.25.1 From nobody Fri Apr 26 00:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585066543; cv=none; d=zohomail.com; s=zohoarc; b=f2/Zyh2PDc0mA7CxsECXrEe2H+KDxzodlqgPBo1wuMw9Lh5LC39y90Z/m5DuZpQZJbPZyvNlg7V12jYcpouIQHN+fNri3x+HK2v/r33p3gMIikP1Ne5gpivIXqJ50js7r0u362m1AawUImRwJceDbnLPH3lf4P3qm/8umonfSMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585066543; 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=lJ4R/C6zf0Ox6ahT75iJ28JMB7+IZKMCUaXy3GnjDRo=; b=F7TZD9VzD+G4gzjKSlSlDJHaNPq8rNtUjw3k7fqa56SKSbwm6cK9klvxy8dAhY3OwQJSIxHW6tCUKdQnr5h3cetz/HRbiy6AMfNJJeOIQCd9DVsuiZ7jrNxxedYV+oaG/OH8MiCJHaLW4fa2+gDDWlqf1auAviBl0TeQ5tYpgyo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585066543326182.0740749107822; Tue, 24 Mar 2020 09:15:43 -0700 (PDT) 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-108-2OtUHHkgMHa7qxnes-rG2A-1; Tue, 24 Mar 2020 12:15:38 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E88D88024CE; Tue, 24 Mar 2020 16:15:32 +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 B356A5C554; Tue, 24 Mar 2020 16:15:32 +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 59B4B18089D8; Tue, 24 Mar 2020 16:15:32 +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 02OGFQYV029514 for ; Tue, 24 Mar 2020 12:15:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5E9D9D961B; Tue, 24 Mar 2020 16:15:26 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 581B4DBF03 for ; Tue, 24 Mar 2020 16:15:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE520800298 for ; Tue, 24 Mar 2020 16:15:23 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-QnbZOhRyMjyzZy_ctxlliw-1; Tue, 24 Mar 2020 12:15:18 -0400 Received: by mail-wm1-f65.google.com with SMTP id g62so4192013wme.1 for ; Tue, 24 Mar 2020 09:15:18 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id r17sm762028wrx.46.2020.03.24.09.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585066541; 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=lJ4R/C6zf0Ox6ahT75iJ28JMB7+IZKMCUaXy3GnjDRo=; b=dvedYTvzbK9TsxxuNUqT1X5dMYGzYHEk+x+i1eCrdyVtAaybNKX72LYLkH0Oj9613eLZEy WJRxhCGVnGSb47KK6w7ykMHrfZahs4VMWl2LTMWy9ztzXfs7S4yhVhb6Zm7VhSEN8TZetJ /bU9dl5yS11HCM1a71WtQ7DIN9QoysQ= X-MC-Unique: 2OtUHHkgMHa7qxnes-rG2A-1 X-MC-Unique: QnbZOhRyMjyzZy_ctxlliw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rZ+0+oR1UfzqLXMgKE62eDFt9eNPIrg+Rb4snmZ5jaw=; b=J/O/iu0IrQKmFmW08B2oJSXDlPfiDKqhWT1urE05orsg4KeSrBhjhhLnOyXLeAT8// uhXOYjasQmZgB36YNsBv17riA+vC2B+aiJlDHbVZVWKrcIgLd0QdR7MFMo1g1diZpAao /IW1T6JbEYQIRrQvjcHoOxrxOkTqkBzlCNHllTsp8faMz98lp2wBcnw6KJSYNQcTPaGT j0APVZknB7bnvotfzdP1k6SqiN9gyDBBKg2QXE/0O9wk/HLG90x/6E+htumqWHhK+IKi 6DhJftIEQdyRXxcW13GXaUmPzrIrzOxVkV5yH77LZn+dVYErHPunBqeFORVEjszlYaC+ mZGw== X-Gm-Message-State: ANhLgQ0F1YmUPisi6tPyhxUPkrUd0ntCGfa1oEN1qsnsTNYWZ1GAVJ8P qY7+qYBhOQ3f43JlpoWDGjyBkKykgQk= X-Google-Smtp-Source: ADFU+vsFI+qyqaoVMMVErG5wh0No7ah33cu/5GWZM/+fU0i9BPHIaRsnYBekMMmwarH09j8VOedfpw== X-Received: by 2002:a1c:6285:: with SMTP id w127mr6757061wmb.133.1585066516999; Tue, 24 Mar 2020 09:15:16 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 4/7] vmx: vmware: move video default logic to driver Date: Tue, 24 Mar 2020 17:14:33 +0100 Message-Id: <20200324161436.2138755-5-r4f4rfs@gmail.com> In-Reply-To: <20200324161436.2138755-1-r4f4rfs@gmail.com> References: <20200324161436.2138755-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OGFQYV029514 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The logic setting a device default should be in the post parse function of individual driver code. Signed-off-by: Rafael Fonseca Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 2 -- src/vmware/vmware_driver.c | 4 ++++ src/vmx/vmx.c | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e6a3500b7a..53bc791e10 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15728,8 +15728,6 @@ virDomainVideoDefaultType(const virDomainDef *def) return VIR_DOMAIN_VIDEO_TYPE_VBOX; =20 case VIR_DOMAIN_VIRT_VMWARE: - return VIR_DOMAIN_VIDEO_TYPE_VMVGA; - case VIR_DOMAIN_VIRT_VZ: case VIR_DOMAIN_VIRT_PARALLELS: case VIR_DOMAIN_VIRT_XEN: diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 32c81b13a0..d5dd6e4f5e 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -137,6 +137,10 @@ vmwareDomainDeviceDefPostParse(virDomainDeviceDefPtr d= ev G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, void *parseOpaque G_GNUC_UNUSED) { + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VMVGA; + return 0; } =20 diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 6c6ef7acf3..b1fd1181eb 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -548,6 +548,10 @@ virVMXDomainDevicesDefPostParse(virDomainDeviceDefPtr = dev G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, void *parseOpaque G_GNUC_UNUSED) { + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VMVGA; + return 0; } =20 --=20 2.25.1 From nobody Fri Apr 26 00:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585066540; cv=none; d=zohomail.com; s=zohoarc; b=GULwmZlD8ERQ2VOHoxVOL6Bz8z0QoHjYv3KKNg1f2zsD1YhVVcaZoD8hQwQhSY79tBnrZTLykA+oz4WM79F8ODacp7bCKKljinQQKg/Hc/M5Y/2OC7/vNC3KjLQMIWNdypde7b+djzoGxfBw3x92cosOdUV+v/cSDjKWQPur+u8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585066540; 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=dMXwE6kFTq0hdziVGJvssbqdlNi3sBa9VrKcv53sOSc=; b=gA9BM0NM+cE1xU6DpdE7dCGEHVRKrnuNmIIB8cporjopZK2r0ax22WOqK+q5cp4Zh1Agh5gwi6X+osLinQZhNBruGqhX3uqpLWD0AJ7IECfihVyTpqn1iagZP8H7aGeH7hGkOm0Lc6w5U8GhmamzEWxerQY+Kg0QQcI+WMKdBUQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585066540770568.7746133239197; Tue, 24 Mar 2020 09:15:40 -0700 (PDT) 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-177-nklKdzp3NVyXSx4OKQzARA-1; Tue, 24 Mar 2020 12:15:36 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5577DBAC; Tue, 24 Mar 2020 16:15:30 +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 8E38690795; Tue, 24 Mar 2020 16:15:30 +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 2737C18089D5; Tue, 24 Mar 2020 16:15:30 +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 02OGFQ0q029516 for ; Tue, 24 Mar 2020 12:15:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 60B26D95FE; Tue, 24 Mar 2020 16:15:26 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5911EDBF0A for ; Tue, 24 Mar 2020 16:15:24 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2144B8007AC for ; Tue, 24 Mar 2020 16:15:24 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-306-Y9MfuIElP8-djAgtFZcFXw-1; Tue, 24 Mar 2020 12:15:20 -0400 Received: by mail-wr1-f66.google.com with SMTP id j17so18812807wru.13 for ; Tue, 24 Mar 2020 09:15:20 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id r17sm762028wrx.46.2020.03.24.09.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585066539; 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=dMXwE6kFTq0hdziVGJvssbqdlNi3sBa9VrKcv53sOSc=; b=PoRO4vSURWwuRiQ6S82qziTaE/OWBdL1i27V/L7coikTuWQjoGUw57zGiHFQ+2V9pS7iKM iy45BIZrp1VhdxleYvEmvHxRDn+WHiqbltSk+w9hKj9Zt360TYYwESYxJliKZsOyafhAW1 1Eera/zb1w5IHSprZUMFfWInHODApIc= X-MC-Unique: nklKdzp3NVyXSx4OKQzARA-1 X-MC-Unique: Y9MfuIElP8-djAgtFZcFXw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X9sS+C3Nx1PpPL+nssbbn7VEokCldPWskGT2LWL9qCk=; b=NhgYKOVdirPfIKC9eryt/vHhQYJ+aJ1QnfD+HtiSJaeGZmBs9B/ek/uogQE5BmzWWS prAx4FkLuFvWVpQENScPihor9K56WINmlViXX3bww00bnda9LfDM0IT3DEW9VOARYYlg UII6Ur+7btlCA9ipgMk3/VenLuAV02Eu8Qu+b5pF9YGJgoY11aC3qbjCGX0hSYa+4/Jy W2n1cRuKiljjtNYwnI15+V4/hZSFEA7JHSZ+GXem5P+ok/fiAZbN1q5za3vnTWjUOayh Jla+743eMqoH1buJpgyuaaezkSfh2ejNGR4kd74uwRftntA1Ce9OixCxSN3LQXR0U+4F J3tQ== X-Gm-Message-State: ANhLgQ1gw3s1x9qOd4FlwUvc5d/dMp84CPffjkAKSiBCdx4O0XDVIVxD BgRUTqAl2iP7r0VY4VZWWI5uNfeumg0= X-Google-Smtp-Source: ADFU+vvqiRMwvHSb4kM+6PJHr74jBBSwvGNF5G6n6MWVUYa2NfgTbzsXgUYtYITH8MDFeUWkb+4sjw== X-Received: by 2002:adf:d846:: with SMTP id k6mr4600007wrl.268.1585066518690; Tue, 24 Mar 2020 09:15:18 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 5/7] test: move video default logic to driver Date: Tue, 24 Mar 2020 17:14:34 +0100 Message-Id: <20200324161436.2138755-6-r4f4rfs@gmail.com> In-Reply-To: <20200324161436.2138755-1-r4f4rfs@gmail.com> References: <20200324161436.2138755-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OGFQ0q029516 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The logic setting a device default should be in the post parse function of individual driver code. Signed-off-by: Rafael Fonseca Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 10 +--------- src/test/test_driver.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 53bc791e10..53fd13e80f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15715,18 +15715,10 @@ int virDomainVideoDefaultType(const virDomainDef *def) { switch ((virDomainVirtType)def->virtType) { - case VIR_DOMAIN_VIRT_TEST: - if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_XEN || - def->os.type =3D=3D VIR_DOMAIN_OSTYPE_LINUX) - return VIR_DOMAIN_VIDEO_TYPE_XEN; - else if (ARCH_IS_PPC64(def->os.arch)) - return VIR_DOMAIN_VIDEO_TYPE_VGA; - else - return VIR_DOMAIN_VIDEO_TYPE_CIRRUS; - case VIR_DOMAIN_VIRT_VBOX: return VIR_DOMAIN_VIDEO_TYPE_VBOX; =20 + case VIR_DOMAIN_VIRT_TEST: case VIR_DOMAIN_VIRT_VMWARE: case VIR_DOMAIN_VIRT_VZ: case VIR_DOMAIN_VIRT_PARALLELS: diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 73fe1ad6ce..7759847c2d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -407,6 +407,28 @@ testDomainObjPrivateAlloc(void *opaque) } =20 =20 +static int +testDomainDevicesDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, + const virDomainDef *def G_GNUC_UNUSED, + unsigned int parseFlags G_GNUC_UNUSED, + void *opaque G_GNUC_UNUSED, + void *parseOpaque G_GNUC_UNUSED) +{ + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_XEN || + def->os.type =3D=3D VIR_DOMAIN_OSTYPE_LINUX) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_XEN; + else if (ARCH_IS_PPC64(def->os.arch)) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VGA; + else + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_CIRRUS; + } + + return 0; +} + + static void testDomainObjPrivateFree(void *data) { @@ -431,6 +453,7 @@ testDriverNew(void) VIR_DOMAIN_DEF_FEATURE_USER_ALIAS | VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT | VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, + .devicesPostParseCallback =3D testDomainDevicesDefPostParse, .defArch =3D VIR_ARCH_I686, }; virDomainXMLPrivateDataCallbacks privatecb =3D { --=20 2.25.1 From nobody Fri Apr 26 00:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585066539; cv=none; d=zohomail.com; s=zohoarc; b=EPHG2fBdT2QRYwV65wqIkDz40RKejtL9/hWDQnukk+wZxs3AG1jXTEmu/1YY6sVykNIRkYdi0kwiHa00Axhf2qbLyEoQBBQa07IV99CK0n6xAreP1dS7n6A9a/ad3aFh7cNTIz8WKuJPWyUMF+ZbI0lx4GUDdcJSlz56HwHxYkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585066539; 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=sIoKczSg8qFT3QiysCA6CP3xlOBj/L/BV6sy/Qj2lG0=; b=X8PCQbWizKsY1cJXQWMueadHTd4hY5SJq4eDqL/pXNas+PM7RvX46+jJFfnloLjm9BT9grhc6R93rF7KCiltV0tLz9KHDW7qJRG/8u/U5hIbJ7D5mx84RILGkePfx8OiZerKsCSoowfJ+wVqwAvUtOd1mXH2JyKSgcGAW5TGCgc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585066539766635.8766412219999; Tue, 24 Mar 2020 09:15:39 -0700 (PDT) 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-345-JWyu0NQ1OdC80d1blqb4lw-1; Tue, 24 Mar 2020 12:15:36 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3696D18C35A3; Tue, 24 Mar 2020 16:15:30 +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 E9CD51001DD8; Tue, 24 Mar 2020 16:15: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 7496C18089CF; Tue, 24 Mar 2020 16:15:29 +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 02OGFQbg029515 for ; Tue, 24 Mar 2020 12:15:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5E7F4DA673; Tue, 24 Mar 2020 16:15:26 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5899ADBF08 for ; Tue, 24 Mar 2020 16:15:24 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3FD838F7825 for ; Tue, 24 Mar 2020 16:15:24 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-217-8c9tmLMaNlOf-Tw7f4i70A-1; Tue, 24 Mar 2020 12:15:21 -0400 Received: by mail-wr1-f65.google.com with SMTP id 31so16190215wrs.3 for ; Tue, 24 Mar 2020 09:15:21 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id r17sm762028wrx.46.2020.03.24.09.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585066538; 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=sIoKczSg8qFT3QiysCA6CP3xlOBj/L/BV6sy/Qj2lG0=; b=ZhBMZqBMZaIR3zXevDcw0o0StLdMJXa161VHsaC9iOPePznSB1J4JPxZtWXI3ZKZ/q3qPy yUxf55fXBOFEDSnZnNWJ/857eLvU8fIEc/S5Gt+Bmg5klLqMjRXByygTaTCj1cOAYqR2pS p4zQtRRGShH5wE3WfMQpiSZekgMmthk= X-MC-Unique: JWyu0NQ1OdC80d1blqb4lw-1 X-MC-Unique: 8c9tmLMaNlOf-Tw7f4i70A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eL8y7XM1KmsCbehfkhZsqh+tzFRVoJesOjc2Wt8ZQnE=; b=Tn0zyZZNA/e3s0j4clVrHVYEwsm/pS/W93QdfNh4tYEtKX7/v+fay0BLgoxAgfifJz el5rIL6YvjmidG/ShXQ7D3EsdE6M933ZFwOxW4SVs6BG2HxniIiredM+tvPhfcaoZW8C 2o9Z/nbRUl/Bb5azx8mpK7B5Eapjc3qVvlss3R3OW3LEoTSFZbCohXswHW8MQPz6lLTV 99XyrYzDt9uEckS9PdJuCJtzjOgatwOOmyBvypBhccypQKP9phBtOIQ7MGPe3h3kEe9+ aPuQ7qYLPPhh/jQN2zRPmIzq9Q8e2pNIP/05xmz0N2ZT4M8XRaMsNIlrA43KF3oihKVF mHGw== X-Gm-Message-State: ANhLgQ04k+CtMkpv3henN451G7rPVNKfDRGvFURy97wlii5MXF9bhlLt K3//Q3WceQVa12Gg+v2dLIOXPMI5VoU= X-Google-Smtp-Source: ADFU+vtT59K0KcH1IT9uq2oVFXVecLmq/JeEM+kUG0XSjGKker0SjGcwm7cvU/Lx5xr40c5WWuosJg== X-Received: by 2002:a5d:630b:: with SMTP id i11mr12168479wru.94.1585066520069; Tue, 24 Mar 2020 09:15:20 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 6/7] vbox: move video default logic to driver Date: Tue, 24 Mar 2020 17:14:35 +0100 Message-Id: <20200324161436.2138755-7-r4f4rfs@gmail.com> In-Reply-To: <20200324161436.2138755-1-r4f4rfs@gmail.com> References: <20200324161436.2138755-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OGFQbg029515 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The logic setting a device default should be in the post parse function of individual driver code. Signed-off-by: Rafael Fonseca Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 2 -- src/vbox/vbox_common.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 53fd13e80f..665bb10b27 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15716,8 +15716,6 @@ virDomainVideoDefaultType(const virDomainDef *def) { switch ((virDomainVirtType)def->virtType) { case VIR_DOMAIN_VIRT_VBOX: - return VIR_DOMAIN_VIDEO_TYPE_VBOX; - case VIR_DOMAIN_VIRT_TEST: case VIR_DOMAIN_VIRT_VMWARE: case VIR_DOMAIN_VIRT_VZ: diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 618663952a..e98ae04ec0 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -62,9 +62,25 @@ static virMutex vbox_driver_lock =3D VIR_MUTEX_INITIALIZ= ER; static vboxDriverPtr vbox_driver; static vboxDriverPtr vboxDriverObjNew(void); =20 +static int +vboxDomainDevicesDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, + const virDomainDef *def G_GNUC_UNUSED, + unsigned int parseFlags G_GNUC_UNUSED, + void *opaque G_GNUC_UNUSED, + void *parseOpaque G_GNUC_UNUSED) +{ + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VBOX; + } + + return 0; +} + static virDomainDefParserConfig vboxDomainDefParserConfig =3D { .macPrefix =3D { 0x08, 0x00, 0x27 }, .features =3D VIR_DOMAIN_DEF_FEATURE_NAME_SLASH, + .devicesPostParseCallback =3D vboxDomainDevicesDefPostParse, }; =20 static virCapsPtr --=20 2.25.1 From nobody Fri Apr 26 00:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585066538; cv=none; d=zohomail.com; s=zohoarc; b=Ea7RKZU/H4gD90egz16FjcRPqYl8wmADOyF3klxHuSAWF0bmtHwUQ2KIkM3WQfzkWVz6Rg5KLkYEmqbXYxpcxkvdn0/GYLjFBMOF7OSXaXuoCIfJ4g1oF5rbYzAoNoDqDN11HJZ3A+2HwAX2EZ/kO92Knw+N2kxCqaeDEmrzmbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585066538; 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=321dvr0pUJ3DY4jKESTvejN+lVRYYhZG15mQbTTk0Rk=; b=oCqpvvbs899klHKqWLaG22mhU690W9VHYQa/EHr/ffGDaZ7g56ac1C0LMs+rq1+mdgYoGD1ZyY5ojCwcRiK6XHQhI/l9M7i91YWsGPTS0kSEtP9jI81PQACfiyghexecNV+OkXcUksA1HVuFpGKlv0PeH2RgUxJylF1Gc5rPA7E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585066538126227.22181150783126; Tue, 24 Mar 2020 09:15:38 -0700 (PDT) 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-366-Gx2ii6BKN0KOWkV_jJIBKQ-1; Tue, 24 Mar 2020 12:15:34 -0400 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 AC8C21005513; Tue, 24 Mar 2020 16:15:27 +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 7977CA0A67; Tue, 24 Mar 2020 16:15:27 +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 1B29518089C8; Tue, 24 Mar 2020 16:15:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02OGFPnn029509 for ; Tue, 24 Mar 2020 12:15:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id D05A52166B2B; Tue, 24 Mar 2020 16:15:25 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBD032166B2A for ; Tue, 24 Mar 2020 16:15:25 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A95DC8FF668 for ; Tue, 24 Mar 2020 16:15:25 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-7D2N6lm2MoabmL914wrF5Q-1; Tue, 24 Mar 2020 12:15:23 -0400 Received: by mail-wr1-f66.google.com with SMTP id p10so9808034wrt.6 for ; Tue, 24 Mar 2020 09:15:22 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id r17sm762028wrx.46.2020.03.24.09.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585066536; 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=321dvr0pUJ3DY4jKESTvejN+lVRYYhZG15mQbTTk0Rk=; b=NkhU+DV8ALLfyh55tvmxUkOHR2yKRI/xvh4H7jgmJ1EUJxWKj4U0ERKoDwXxKG7H+DC+vv mJj/JFzZQOETomp2bDxowcH+mYVC8XaEjRC+BaIQli6NPh/JxSdYFhyM1UQhmddmbVfjKx y9XDs2AGz8tx3vYGV8oC79KxOv31h5s= X-MC-Unique: Gx2ii6BKN0KOWkV_jJIBKQ-1 X-MC-Unique: 7D2N6lm2MoabmL914wrF5Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vF4EPGDURq41mSGMiRVG0Qy463zOycXyL7T07Hd3Phk=; b=RxdtujWPCiHIkBFCRUL83pouPADoG4YY7rd5kuhkR+5EhCWMfxgh+T3TDpmteR9nK2 icCx5h+969nRE3AXhgxWiJVVUjrEtFexEe/8nMGlhMvaU09rBGf5Flj9rlVRZBC9xpgp Yu6fRT8YA1Ct2SfP3vDB+prUFsiyH3mpAvukCFc17DaN/EhmpCg8vLrjYNqaGWetNA8X ih7RPy0ta3/A7gqzX87MXXN8s8nbmUTv4fGy1rXUsAIkbGej458mPwWveU9iDcRA7XR9 MhzNv0L73SvNTWbCbxjY+YvDu76AMyOI+kbhTnxT9C7WmPL79jvghv2bWEtFWh2JiYv7 wfYQ== X-Gm-Message-State: ANhLgQ0xgiCtW7VPq5sh1rfCWf/OZ5Yb1ItE2o1EVe5vdchx9PwM/L37 XYYYMvBPbXwVnFXRYYa4YTaeR9/qDuw= X-Google-Smtp-Source: ADFU+vsCSAFkIM01DTCwkczH9OumBy2ahA25XhiaylLlfrEUzMr/x3SPaER9m/FDfbhRVwuiS7z6dQ== X-Received: by 2002:a5d:5451:: with SMTP id w17mr37674737wrv.142.1585066521622; Tue, 24 Mar 2020 09:15:21 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 7/7] conf: domain_conf: remove virDomainVideoDefaultType Date: Tue, 24 Mar 2020 17:14:36 +0100 Message-Id: <20200324161436.2138755-8-r4f4rfs@gmail.com> In-Reply-To: <20200324161436.2138755-1-r4f4rfs@gmail.com> References: <20200324161436.2138755-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OGFPnn029509 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The logic has been moved to the individual drivers. Signed-off-by: Rafael Fonseca Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 35 ++++------------------------------- src/conf/domain_conf.h | 1 - src/libvirt_private.syms | 1 - 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 665bb10b27..27bc5a797b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15711,32 +15711,6 @@ virDomainVideoDefaultRAM(const virDomainDef *def, } =20 =20 -int -virDomainVideoDefaultType(const virDomainDef *def) -{ - switch ((virDomainVirtType)def->virtType) { - case VIR_DOMAIN_VIRT_VBOX: - case VIR_DOMAIN_VIRT_TEST: - case VIR_DOMAIN_VIRT_VMWARE: - case VIR_DOMAIN_VIRT_VZ: - case VIR_DOMAIN_VIRT_PARALLELS: - case VIR_DOMAIN_VIRT_XEN: - case VIR_DOMAIN_VIRT_BHYVE: - case VIR_DOMAIN_VIRT_QEMU: - case VIR_DOMAIN_VIRT_KQEMU: - case VIR_DOMAIN_VIRT_KVM: - case VIR_DOMAIN_VIRT_LXC: - case VIR_DOMAIN_VIRT_UML: - case VIR_DOMAIN_VIRT_OPENVZ: - case VIR_DOMAIN_VIRT_HYPERV: - case VIR_DOMAIN_VIRT_PHYP: - case VIR_DOMAIN_VIRT_NONE: - case VIR_DOMAIN_VIRT_LAST: - default: - return VIR_DOMAIN_VIDEO_TYPE_DEFAULT; - } -} - static virDomainVideoAccelDefPtr virDomainVideoAccelDefParseXML(xmlNodePtr node) { @@ -15854,7 +15828,6 @@ static virDomainVideoDefPtr virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, - const virDomainDef *dom, unsigned int flags) { virDomainVideoDefPtr def; @@ -15925,7 +15898,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xml= opt, goto error; } } else { - def->type =3D virDomainVideoDefaultType(dom); + def->type =3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT; } =20 if (driver_name) { @@ -16871,7 +16844,7 @@ virDomainDeviceDefParse(const char *xmlStr, break; case VIR_DOMAIN_DEVICE_VIDEO: if (!(dev->data.video =3D virDomainVideoDefParseXML(xmlopt, node, - ctxt, def, flags= ))) + ctxt, flags))) return NULL; break; case VIR_DOMAIN_DEVICE_HOSTDEV: @@ -21633,7 +21606,7 @@ virDomainDefParseXML(xmlDocPtr xml, ssize_t insertAt =3D -1; =20 if (!(video =3D virDomainVideoDefParseXML(xmlopt, nodes[i], - ctxt, def, flags))) + ctxt, flags))) goto error; =20 if (video->primary) { @@ -24314,7 +24287,7 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def, v= irDomainXMLOptionPtr xmlopt) =20 if (!(video =3D virDomainVideoDefNew(xmlopt))) goto cleanup; - video->type =3D virDomainVideoDefaultType(def); + video->type =3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, video) < 0) goto cleanup; =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b7c31eb62f..33875d942f 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3364,7 +3364,6 @@ int virDomainFSInsert(virDomainDefPtr def, virDomainF= SDefPtr fs); int virDomainFSIndexByName(virDomainDefPtr def, const char *name); virDomainFSDefPtr virDomainFSRemove(virDomainDefPtr def, size_t i); =20 -int virDomainVideoDefaultType(const virDomainDef *def); unsigned int virDomainVideoDefaultRAM(const virDomainDef *def, const virDomainVideoType type); =20 diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c9f0da2bf9..3f032c7963 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -633,7 +633,6 @@ virDomainTPMModelTypeFromString; virDomainTPMModelTypeToString; virDomainUSBDeviceDefForeach; virDomainVideoDefaultRAM; -virDomainVideoDefaultType; virDomainVideoDefClear; virDomainVideoDefFree; virDomainVideoDefNew; --=20 2.25.1