From nobody Sun Feb 8 22:06:17 2026 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 --- 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