From nobody Tue Feb 10 07:21:35 2026 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562879159; cv=none; d=zoho.com; s=zohoarc; b=ZdTMBu/Dr3Lmbp32XJkkSRnDogRqHkw/9WSQZC1xu1VwGRSE2VeMw1X9Sihitvaj5tFJY+oVnaUn6WdwDxnPRHLiq399j6jB8kXGmQuW2qHuCDdN31KpPi1f0FlLcsm//IvTPOkpM3G8XuNgpPKuvgpyIli7w9vgOrhj+Ej1Tqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562879159; 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:ARC-Authentication-Results; bh=a3AFku0KK9naxVcpf2q5mX+3sF4zCA+rAvickH4UPfw=; b=W/WK4Xiu9BNCAALtbnL0dJX7uHBsq4REdEqBwXRM7AGM0PXY3EAFMqRbeWbbCHazm07D37NvyHt28G5yNBgPFmfyR87Y2ami6zuiIVM3pwZpCc3oqrji+6QrFDcTn42cb5NY8P/Sv9VQoypM7VtFdrtLCdN3HNs2aEYeD+/ftKI= ARC-Authentication-Results: i=1; mx.zoho.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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562879159131324.0483385905841; Thu, 11 Jul 2019 14:05:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C7C187628; Thu, 11 Jul 2019 21:05:57 +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 24CBD5D720; Thu, 11 Jul 2019 21:05:57 +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 CD35241F53; Thu, 11 Jul 2019 21:05:56 +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 x6BL5dYt012442 for ; Thu, 11 Jul 2019 17:05:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4229B1001B02; Thu, 11 Jul 2019 21:05:39 +0000 (UTC) Received: from aegolius.redhat.com (ovpn-118-68.phx2.redhat.com [10.3.118.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 111CB10002B9 for ; Thu, 11 Jul 2019 21:05:38 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Thu, 11 Jul 2019 16:05:32 -0500 Message-Id: <20190711210533.11479-3-jjongsma@redhat.com> In-Reply-To: <20190711210533.11479-1-jjongsma@redhat.com> References: <20190711210533.11479-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/3] qemu: minor refactor of video device string handling 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 11 Jul 2019 21:05:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In preparation for adding the bochs display device, refactor the logic so that each branch handles a single device type and checks its parameters within that branch. In this case VGA and VMVGA are still grouped into the same branch since they share device-specific parameter names. Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 688dc324c6..2f98efd6bf 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4748,13 +4748,12 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, if (video->heads) virBufferAsprintf(&buf, ",max_outputs=3D%u", video->heads); } - } else if (video->vram && - ((video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || - (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { - - virBufferAsprintf(&buf, ",vgamem_mb=3D%u", video->vram / 1024); + } else if ((video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || + (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VMVGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM))) { + if (video->vram) + virBufferAsprintf(&buf, ",vgamem_mb=3D%u", video->vram / 1024); } =20 if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list