From nobody Thu Apr 25 01:44:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637226123; cv=none; d=zohomail.com; s=zohoarc; b=dVpKka5bsl21g2n+i59ESOK58hGZ5MMYt2IGF0JLDDRkHdYBZxocVgTCZQfwatnUtqIraL6UxrF0R4Y32kXEqZldGMk1dCoGN8bI32M1/Ucr/+VgAyRZ6m6cLIRKjAgva7VPo5qKPKPpOa6ftDy48OHkPY8mQn3hc57JVxLKVQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637226123; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=btwRqlYU1/gozFGZUyfmb1Mfc11c1GTwHfobdb1BEH4=; b=X0UeQVeTcVY5l1kx3KsWo3UV/ATqonaONuAswzVozLzEV5b13JfsSMqjykz6Vj0xBDI7JXPGxWHSTeJhPd0V7OoUKoeFzo+2gS8RLY6aEqLUyShsKGCe7nI5JJgQyC1UEQzB3uWOeu/nHE8Ut/hdcGjP3hnQi0CGj/1stB5OcoM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1637226123806254.32753211659303; Thu, 18 Nov 2021 01:02:03 -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-453-2fkDlmKdPRqFEL6x_ClFgw-1; Thu, 18 Nov 2021 04:01:59 -0500 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 ADF2D425C8; Thu, 18 Nov 2021 09:01:54 +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 8F1445C22B; Thu, 18 Nov 2021 09:01:54 +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 5BFCB4A703; Thu, 18 Nov 2021 09:01:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AI8v2uD015642 for ; Thu, 18 Nov 2021 03:57:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0306510495BC; Thu, 18 Nov 2021 08:57:02 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A0091007625 for ; Thu, 18 Nov 2021 08:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637226122; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=btwRqlYU1/gozFGZUyfmb1Mfc11c1GTwHfobdb1BEH4=; b=MgMXJpDLg5F+GAOMMOtUKKBwIYf3CbNuPuDgEY25lET9aZgH1MaNy1JdJ5qAsxj/n5rPq6 eE0QVWJJiVpbuV0HdTbIYjv+U5MDktaIPfap4udMYll4kLtxi/PxKjbZe4Vd9Q1X8NK2xE 3UeFyexQBa33f+bbAMLAIOJaLgta+Do= X-MC-Unique: 2fkDlmKdPRqFEL6x_ClFgw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuBuildHostdevMediatedDevProps: Format 'ramfb' only when enabled Date: Thu, 18 Nov 2021 09:56:46 +0100 Message-Id: <036565024d38279393de32be09aab71f1f6932ca.1637225757.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637226124521100001 Content-Type: text/plain; charset="utf-8" Before commit 73c352ab8c97d3 which converted the hostdev commandline formatter to JSON the 'ramfb' property was formatted only if it was enabled. The main reason for that is that enabling 'ramfb' switches the device model to 'vfio-pci-nohotplug' which actually has the property, while 'vfio-pci' (used when 'ramfb' is disabled or absent) doesn't have it. Restore the logic to format 'ramfb' only when it's enabled and add a comment that it's deliberate. Fixes: 73c352ab8c97d3 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2024435 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 713304dd22..d1b0205eb2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5329,6 +5329,8 @@ qemuBuildHostdevMediatedDevProps(const virDomainDef *= def, g_autoptr(virJSONValue) props =3D NULL; virDomainHostdevSubsysMediatedDev *mdevsrc =3D &dev->source.subsys.u.m= dev; g_autofree char *mdevPath =3D NULL; + /* 'ramfb' property must be omitted unless it's to be enabled */ + bool ramfb =3D mdevsrc->ramfb =3D=3D VIR_TRISTATE_SWITCH_ON; mdevPath =3D virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr); @@ -5337,7 +5339,7 @@ qemuBuildHostdevMediatedDevProps(const virDomainDef *= def, "s:id", dev->info->alias, "s:sysfsdev", mdevPath, "S:display", qemuOnOffAuto(mdevsrc->display), - "T:ramfb", mdevsrc->ramfb, + "B:ramfb", ramfb, "p:bootindex", dev->info->bootIndex, NULL) < 0) return NULL; --=20 2.31.1 From nobody Thu Apr 25 01:44:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637226159; cv=none; d=zohomail.com; s=zohoarc; b=kG1X5Os7d0gC72Zs3IuRnhLx7A+x0HSSdhr1VrGxS1yZsM8DPRGQgeXEC1HCR2V15aLfBvECEmzR5IIRXvbYcBy0aBz/arZNU0lMFfiVrZ4N3P4AzZ/46DmMSj11Lw53C05xCMhUpUlx5Q9ISdnSQ1MDMMUstmiMFN0ul6JkWCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637226159; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8gKfMOGz/n1nTLOjmp2Aqxr6z735RzgNsJCHa5eSOVo=; b=estjjWpXZXVzReIorA5ljW9AQG9rZRpE3ApfA11/K1mfR6w05cI3YUO/pfutE6Qj+ytj8XcLvLtwbtOPEMumfH+rhDaHWfG4JzcO2VpPqDu7AFLIjq/jNCgEdtbeFjCcx80rnWGX9bsxIVn/zZesQqCeU+udOlljc+xHnmCyeTc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1637226159833993.7444128662322; Thu, 18 Nov 2021 01:02:39 -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-393-dN1Q-it6N2KbIyiIXt0SrA-1; Thu, 18 Nov 2021 04:02:37 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E53D185172C; Thu, 18 Nov 2021 09:02: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 3E70460C17; Thu, 18 Nov 2021 09:02: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 35B4A180BAD1; Thu, 18 Nov 2021 09:02:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AI8v64r015660 for ; Thu, 18 Nov 2021 03:57:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4258E1007625; Thu, 18 Nov 2021 08:57:06 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id A571310495BC for ; Thu, 18 Nov 2021 08:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637226158; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8gKfMOGz/n1nTLOjmp2Aqxr6z735RzgNsJCHa5eSOVo=; b=gecg4iVhBNqhP/kgN6k7LzNoyqGk0sDe8OGMRvlQplQdML5pxM4Fp9EGyj4IikILXIDjik RHbACS7DFxnI2i2t4zcKplAFnWh6g+yErJnUtkjXx6Ubd4TAEqxORMsvGeSzYfm7mUj20K BoIH73DVfNWzUKEtfP9Eg/NYK4vHmCk= X-MC-Unique: dN1Q-it6N2KbIyiIXt0SrA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] qemuxml2argvtest: Add device with 'ramfb=off' to 'hostdev-mdev-display-ramfb' Date: Thu, 18 Nov 2021 09:56:47 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637226161620100003 Content-Type: text/plain; charset="utf-8" Add a test case where 'ramfb' is explicitly disabled for a mediated device to prevent regressing again. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- .../hostdev-mdev-display-ramfb.x86_64-latest.args | 1 + tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.xml | 5 +++++ .../hostdev-mdev-display-ramfb.x86_64-latest.xml | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.x86_64-lates= t.args b/tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.x86_64-latest.ar= gs index 7ab67b3029..31ba83f0da 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.x86_64-latest.args +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.x86_64-latest.args @@ -30,5 +30,6 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest2/.config \ -vnc 127.0.0.1:0,audiodev=3Daudio1 \ -device '{"driver":"qxl-vga","id":"video0","ram_size":67108864,"vram_size"= :67108864,"vram64_size_mb":0,"vgamem_mb":16,"max_outputs":1,"bus":"pci.0","= addr":"0x2"}' \ -device '{"driver":"vfio-pci-nohotplug","id":"hostdev0","sysfsdev":"/sys/b= us/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc","display":"on","ramfb= ":true,"bus":"pci.0","addr":"0x3"}' \ +-device '{"driver":"vfio-pci","id":"hostdev1","sysfsdev":"/sys/bus/mdev/de= vices/53764d0e-85a0-42b4-af5c-2046b460b1dd","display":"on","bus":"pci.0","a= ddr":"0x4"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.xml b/tests/= qemuxml2argvdata/hostdev-mdev-display-ramfb.xml index 6fdc477ca2..a494c59f9d 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.xml @@ -25,6 +25,11 @@
+ + +
+ + diff --git a/tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-lat= est.xml b/tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-latest= .xml index a60317d811..a137bd387e 100644 --- a/tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-latest.xml @@ -40,6 +40,12 @@
+ + +
+ +
+ --=20 2.31.1