From nobody Wed May 14 09:41:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=codethink.co.uk Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1525949695262177.11467400838444; Thu, 10 May 2018 03:54:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8BDA43004434; Thu, 10 May 2018 10:54:53 +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 5E0D42010CCD; Thu, 10 May 2018 10:54:53 +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 0CF094BB79; Thu, 10 May 2018 10:54:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4AAspsA020749 for ; Thu, 10 May 2018 06:54:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 27C152010CD3; Thu, 10 May 2018 10:54:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FB102010CCD for ; Thu, 10 May 2018 10:54:48 +0000 (UTC) Received: from imap1.codethink.co.uk (imap1.codethink.co.uk [176.9.8.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1549C81E05 for ; Thu, 10 May 2018 10:54:47 +0000 (UTC) Received: from [88.97.110.231] (helo=ct-lt-931.lan) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1fGjDh-00018g-Jh; Thu, 10 May 2018 11:54:45 +0100 From: Maciej Wolny To: libvir-list@redhat.com Date: Thu, 10 May 2018 11:53:55 +0100 Message-Id: <20180510105359.24803-2-maciej.wolny@codethink.co.uk> In-Reply-To: <20180510105359.24803-1-maciej.wolny@codethink.co.uk> References: <20180510105359.24803-1-maciej.wolny@codethink.co.uk> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 10 May 2018 10:54:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 10 May 2018 10:54:47 +0000 (UTC) for IP:'176.9.8.82' DOMAIN:'imap1.codethink.co.uk' HELO:'imap1.codethink.co.uk' FROM:'maciej.wolny@codethink.co.uk' RCPT:'' X-RedHat-Spam-Score: -0.011 (RCVD_IN_DNSWL_NONE, SPF_PASS) 176.9.8.82 imap1.codethink.co.uk 176.9.8.82 imap1.codethink.co.uk X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Cc: Maciej Wolny Subject: [libvirt] [PATCH v2 1/5] qemu_command: Move SDL command line building into helper 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 10 May 2018 10:54:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Create a function called `qemuBuildGraphicsSDLCommandLine` which is called from qemuBuildGraphicsCommandLine. Signed-off-by: Maciej Wolny Reviewed-by: John Ferlan --- src/qemu/qemu_command.c | 49 +++++++++++++++++++++++++++++----------------= ---- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c6bf6d583..d8a44b9e6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7568,6 +7568,34 @@ qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd, =20 =20 static int +qemuBuildGraphicsSDLCommandLine(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSE= D, + virCommandPtr cmd, + virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED, + virDomainGraphicsDefPtr graphics) +{ + if (graphics->data.sdl.xauth) + virCommandAddEnvPair(cmd, "XAUTHORITY", graphics->data.sdl.xauth); + if (graphics->data.sdl.display) + virCommandAddEnvPair(cmd, "DISPLAY", graphics->data.sdl.display); + if (graphics->data.sdl.fullscreen) + virCommandAddArg(cmd, "-full-screen"); + + /* If using SDL for video, then we should just let it + * use QEMU's host audio drivers, possibly SDL too + * User can set these two before starting libvirtd + */ + virCommandAddEnvPassBlockSUID(cmd, "QEMU_AUDIO_DRV", NULL); + virCommandAddEnvPassBlockSUID(cmd, "SDL_AUDIODRIVER", NULL); + + /* New QEMU has this flag to let us explicitly ask for + * SDL graphics. This is better than relying on the + * default, since the default changes :-( */ + virCommandAddArg(cmd, "-sdl"); + return 0; +} + + +static int qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, virCommandPtr cmd, virQEMUCapsPtr qemuCaps, @@ -7946,26 +7974,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr = cfg, { switch (graphics->type) { case VIR_DOMAIN_GRAPHICS_TYPE_SDL: - if (graphics->data.sdl.xauth) - virCommandAddEnvPair(cmd, "XAUTHORITY", graphics->data.sdl.xau= th); - if (graphics->data.sdl.display) - virCommandAddEnvPair(cmd, "DISPLAY", graphics->data.sdl.displa= y); - if (graphics->data.sdl.fullscreen) - virCommandAddArg(cmd, "-full-screen"); - - /* If using SDL for video, then we should just let it - * use QEMU's host audio drivers, possibly SDL too - * User can set these two before starting libvirtd - */ - virCommandAddEnvPassBlockSUID(cmd, "QEMU_AUDIO_DRV", NULL); - virCommandAddEnvPassBlockSUID(cmd, "SDL_AUDIODRIVER", NULL); - - /* New QEMU has this flag to let us explicitly ask for - * SDL graphics. This is better than relying on the - * default, since the default changes :-( */ - virCommandAddArg(cmd, "-sdl"); - - break; + return qemuBuildGraphicsSDLCommandLine(cfg, cmd, qemuCaps, graphic= s); =20 case VIR_DOMAIN_GRAPHICS_TYPE_VNC: return qemuBuildGraphicsVNCCommandLine(cfg, cmd, qemuCaps, graphic= s); --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list