From nobody Thu Nov 21 17:29:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1715896669527454.82656497696587; Thu, 16 May 2024 14:57:49 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 489AE1A0A; Thu, 16 May 2024 17:57:48 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4636219BD; Thu, 16 May 2024 17:57:11 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9DEBE19B2; Thu, 16 May 2024 17:57:08 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 164AD19AF for ; Thu, 16 May 2024 17:57:08 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-599-Sj_2IjxiPbW8T1kg9gArgg-1; Thu, 16 May 2024 17:57:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A1A4F801211 for ; Thu, 16 May 2024 21:57:05 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.18.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C4BC100046D for ; Thu, 16 May 2024 21:57:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715896627; h=from:from: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; bh=yJIFJBPIA+xSpjXyO/gevK3vapj6isvlVAusCZlRoyo=; b=V1/lfY2a4CWrVyze/evp9LDJTMlT8zJ7omLqfgn/esE2oJxECZOn9X8vP0e5hOeUSpZTVB f1WAaKQ+UHoAbZ1ealALeRW4nCN+l/5O2+82gO2N4VkjpR57gML5vM2Nd60n6aefR1/kIA IqDOwbxYKmZYh3h98Dk0mgYX6l60ISc= X-MC-Unique: Sj_2IjxiPbW8T1kg9gArgg-1 From: Jonathon Jongsma To: devel@lists.libvirt.org Subject: [PATCH] qemu: fix qemu command for pci hostdevs and ramfb='off' Date: Thu, 16 May 2024 16:57:04 -0500 Message-ID: <20240516215704.1032051-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HHGDULJ7OV6N4BDLA5S2DL6MN2OWKU3G X-Message-ID-Hash: HHGDULJ7OV6N4BDLA5S2DL6MN2OWKU3G X-MailFrom: jjongsma@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1715896671259100001 Content-Type: text/plain; charset="utf-8"; x-default="true" There was no test for this and we mistakenly used 'B' rather than 'T' when constructing the json value for this parameter. Thus, a value of 'off' was VIR_TRISTATE_SWITCH_OFF=3D2, which was translated to a boolean value of 'true'. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/qemu/qemu_command.c | 2 +- .../hostdev-pci-display-ramfb.x86_64-latest.args | 1 + .../hostdev-pci-display-ramfb.x86_64-latest.xml | 6 ++++++ tests/qemuxmlconfdata/hostdev-pci-display-ramfb.xml | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 63bfeb790e..2d0eddc79e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4798,7 +4798,7 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, "p:bootindex", dev->info->effectiveBootIndex, "S:failover_pair_id", failover_pair_id, "S:display", qemuOnOffAuto(pcisrc->display), - "B:ramfb", pcisrc->ramfb, + "T:ramfb", pcisrc->ramfb, NULL) < 0) return NULL; =20 diff --git a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.= args b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args index 6a3bfbe6fb..e6e538ef1c 100644 --- a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args +++ b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args @@ -29,5 +29,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st2/.config \ -audiodev '{"id":"audio1","driver":"none"}' \ -vnc 127.0.0.1:0,audiodev=3Daudio1 \ -device '{"driver":"vfio-pci-nohotplug","host":"0000:06:12.5","id":"hostde= v0","display":"on","ramfb":true,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"vfio-pci","host":"0000:06:13.6","id":"hostdev1","displ= ay":"off","ramfb":false,"bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.= xml b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.xml index 16e8a1dee2..18b9bfb5bf 100644 --- a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.xml @@ -39,6 +39,12 @@
+ + +
+ +
+ diff --git a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.xml b/tests/qe= muxmlconfdata/hostdev-pci-display-ramfb.xml index 39c84da7e1..d263342b1d 100644 --- a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.xml +++ b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.xml @@ -25,6 +25,11 @@
+ + +
+ + --=20 2.45.0