From nobody Tue Dec 16 08:34:10 2025 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1749040420; cv=none; d=zohomail.com; s=zohoarc; b=OV7pKFGyC5zMk7WWzFvpOWYCKvHkKCNzTwKSPmlzv7IRF64RQ2gcYd3n0Kqg98lbztWlMIAYjKs0AyJE9jI8IOGl8UkcMN3brIva19B3DYtAaQNLPmKocu6VXcY6zufhuKqAKh7/b37+R4qLHhOGCC9hOT3GyYdmmnTbfY5L6IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749040420; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=8618SM1bTze0h7XJErpNU4cA5w0UD/lqlhDMHwM8LHk=; b=AA+jsr+hWc+ke3uQXL8EDKu+sd5EJEivhVlG7XXvxQ282TVJ0+JVtaVNY891OYuKAyIky0eOBJX7nXdXgdrXTGptu/mlB1cDfas0wz9DDRVQQoFf+R6P/08BTqwjXxIU9ysngmgYDOgTtz1bbRPSGCqrXN1EUmxqKcK4HrmZku0= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17490404196461000.8065709135333; Wed, 4 Jun 2025 05:33:39 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id B33321555; Wed, 4 Jun 2025 08:33:38 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1F2FB1474; Wed, 4 Jun 2025 08:32:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5347C11F1; Wed, 4 Jun 2025 08:32:26 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 D974DCA6 for ; Wed, 4 Jun 2025 08:32:25 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-578-sv6lvG3iNFmLCeAMvrESZw-1; Wed, 04 Jun 2025 08:32:24 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 78B201956089 for ; Wed, 4 Jun 2025 12:32:23 +0000 (UTC) Received: from kshcheti-thinkpadp1gen4i.tpbc.com (unknown [10.43.2.246]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 897D519560B2; Wed, 4 Jun 2025 12:32:22 +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.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,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=1749040345; h=from:from: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; bh=xx3j6I7TUXC2pOn0z+kDRzfnEClav01xSylCH4XYS10=; b=OSzYnET+jUxOfrEkOkxFp1rCKZp2WtL/X6EqZgFJXy2FA+WAAQL53s+xfg++wJ1M4Tx61m xnDAWjuC8Y6jDThJ+w61p3nOQFDtLDCoTNnbZ9NvkxFOPW6y/jVcJZXK9I/UlM5hm5/KpG hgJg9wtPAiml7ony92plIuyvMfzPW2Y= X-MC-Unique: sv6lvG3iNFmLCeAMvrESZw-1 X-Mimecast-MFC-AGG-ID: sv6lvG3iNFmLCeAMvrESZw_1749040343 To: devel@lists.libvirt.org Subject: [PATCH v2 2/4] conf: SDL fullscreen option refactor Date: Wed, 4 Jun 2025 14:24:13 +0200 Message-ID: <20250604123215.34281-3-kshcheti@redhat.com> In-Reply-To: <20250604123215.34281-1-kshcheti@redhat.com> References: <20250604123215.34281-1-kshcheti@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rTXsO6L0e18swz0wi7ftof72ETlpIIJfa7vMOXOHkvM_1749040343 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HOSGPRHZ3OU435JGCHDXDN73FQFV5HNK X-Message-ID-Hash: HOSGPRHZ3OU435JGCHDXDN73FQFV5HNK X-MailFrom: kshcheti@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 CC: Kirill Shchetiniuk 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: From: Kirill Shchetiniuk via Devel Reply-To: Kirill Shchetiniuk X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1749040422031116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Kirill Shchetiniuk Previously, the fullscreen option were parsed as a tristate but stored as a bool type, changed the fullscreen option type to tristate bool to avoid unnecessary type convertions. Signed-off-by: Kirill Shchetiniuk --- src/conf/domain_conf.c | 9 ++++----- src/conf/domain_conf.h | 2 +- src/qemu/qemu_command.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c16aa279fb..32a358d72c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11891,15 +11891,13 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphics= Def *def, { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr glNode; - virTristateBool fullscreen; =20 ctxt->node =3D node; =20 if (virXMLPropTristateBool(node, "fullscreen", VIR_XML_PROP_NONE, - &fullscreen) < 0) + &def->data.sdl.fullscreen) < 0) return -1; =20 - virTristateBoolToBool(fullscreen, &def->data.sdl.fullscreen); def->data.sdl.xauth =3D virXMLPropString(node, "xauth"); def->data.sdl.display =3D virXMLPropString(node, "display"); =20 @@ -26956,8 +26954,9 @@ virDomainGraphicsDefFormatSDL(virBuffer *attrBuf, =20 virBufferEscapeString(attrBuf, " xauth=3D'%s'", def->data.sdl.xauth); =20 - if (def->data.sdl.fullscreen) - virBufferAddLit(attrBuf, " fullscreen=3D'yes'"); + if (def->data.sdl.fullscreen !=3D VIR_TRISTATE_BOOL_ABSENT) + virBufferAsprintf(attrBuf, " fullscreen=3D'%s'", + virTristateBoolTypeToString(def->data.sdl.fullsc= reen)); =20 virDomainGraphicsDefFormatGL(childBuf, def->data.sdl.gl, NULL); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 58b97a2b54..8df404dc42 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2036,7 +2036,7 @@ struct _virDomainGraphicsDef { struct { char *display; char *xauth; - bool fullscreen; + virTristateBool fullscreen; virTristateBool gl; } sdl; struct { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fec48edfc1..895af0ff6d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8108,7 +8108,7 @@ qemuBuildGraphicsSDLCommandLine(virQEMUDriverConfig *= cfg G_GNUC_UNUSED, virCommandAddEnvPair(cmd, "XAUTHORITY", graphics->data.sdl.xauth); if (graphics->data.sdl.display) virCommandAddEnvPair(cmd, "DISPLAY", graphics->data.sdl.display); - if (graphics->data.sdl.fullscreen) + if (graphics->data.sdl.fullscreen =3D=3D VIR_TRISTATE_BOOL_YES) virCommandAddArg(cmd, "-full-screen"); =20 virCommandAddArg(cmd, "-display"); --=20 2.49.0