From nobody Mon Feb 9 12:27:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1618835997; cv=none; d=zohomail.com; s=zohoarc; b=WjQHz43d2OmxmilRPdF9ueFwVUAZsDG1WB3PLwx31lu4CokBmKiwVCRdM8CAhwiVYpwGnAWs934EdlBGMgaiZ5N+KSEn0qz80gll0utZHqBnuRRWj5nVucxGXlRJGcbhc2WxQB905EsxyFDblizWbrYhAG7f5Bi02cFTZLRUI+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618835997; 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=pi/ffhY/LLaD6AdHkOhun5D2rNIxlkLFlI85DFqDTps=; b=SM9KSKWvM8lc8Fu2+M5HupryvY75/RxGGOwpeY0T2L8JX2LbnzITO2ZY+bO0mYbNtjMwzDKEhaE8MwBa/EOjt9jmVPDASR+gFKGRdX2yCBS+zvLXqyoGZ1OwnHc7qSFco9wY89gdImNaUfM/AQTofd75TkO6FKL/Eo3NJejJJHE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618835997328896.712630271408; Mon, 19 Apr 2021 05:39:57 -0700 (PDT) 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-537-aOqGPRTnPz6a1nlPpfVa2w-1; Mon, 19 Apr 2021 08:39:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C643107ACE3; Mon, 19 Apr 2021 12:39:44 +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 2DE7760C5C; Mon, 19 Apr 2021 12:39:44 +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 ECF89181845D; Mon, 19 Apr 2021 12:39:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13JCaONX019280 for ; Mon, 19 Apr 2021 08:36:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id DF86519C66; Mon, 19 Apr 2021 12:36:24 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51EDBE730 for ; Mon, 19 Apr 2021 12:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618835995; 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=pi/ffhY/LLaD6AdHkOhun5D2rNIxlkLFlI85DFqDTps=; b=UGMLQdZYrl/zbF7UD3QVn+PRVPH32YoTxayU5rCuqU9EBT+mtAyepjie6Iwg4D6O5mnrD3 yGLQVBvkp/wuR1Xs0B0d0AYHZrOD7IRwdg2drljwFQvL8d9ucB28pSrmgFSW/oqKOl2cva hiNydGvXf6/9SlR0cyWkvzJsmyP4e8U= X-MC-Unique: aOqGPRTnPz6a1nlPpfVa2w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 22/38] qemu: command: Remove legacy '-vga' commandline formatter Date: Mon, 19 Apr 2021 14:35:26 +0200 Message-Id: <23a84dd6f90f10b840abda1ea5d407383253b834.1618834490.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.13 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) Content-Type: text/plain; charset="utf-8" All supported qemus now support using '-device' for adding a graphics device. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina Reviewed-by: Neal Gompa --- src/qemu/qemu_command.c | 115 +++------------------------------------- 1 file changed, 6 insertions(+), 109 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1b32f02543..05d074e1f0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4362,90 +4362,6 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, } -static int -qemuBuildVgaVideoCommand(virCommand *cmd, - virDomainVideoDef *video, - virQEMUCaps *qemuCaps) -{ - const char *dev; - const char *vgastr =3D qemuVideoTypeToString(video->type); - - if (!vgastr || STREQ(vgastr, "")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid model for video type '%s'"), - virDomainVideoTypeToString(video->type)); - return -1; - } - - virCommandAddArgList(cmd, "-vga", vgastr, NULL); - - /* If we cannot use --device option to specify the video device - * in QEMU we will fallback to the old --vga option. To get the - * correct device name for the --vga option the 'qemuVideo' is - * used, but to set some device attributes we need to use the - * --global option and for that we need to specify the device - * name the same as for --device option and for that we need to - * use 'qemuDeviceVideo'. - * - * See 'Graphics Devices' section in docs/qdev-device-use.txt in - * QEMU repository. - */ - dev =3D qemuDeviceVideoTypeToString(video->type); - - if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_QXL && - (video->vram || video->ram)) { - unsigned int ram =3D video->ram; - unsigned int vram =3D video->vram; - unsigned int vram64 =3D video->vram64; - unsigned int vgamem =3D video->vgamem; - unsigned int heads =3D video->heads; - - if (ram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.ram_size=3D%u", - dev, ram * 1024); - } - if (vram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram_size=3D%u", - dev, vram * 1024); - } - if (vram64 && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VRAM64)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram64_size_mb=3D%u", - dev, vram64 / 1024); - } - if (vgamem && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=3D%u", - dev, vgamem / 1024); - } - if (heads && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_MAX_OUTPUTS)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.max_outputs=3D%u", - dev, heads); - } - } - - 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)))) { - unsigned int vram =3D video->vram; - - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=3D%u", - dev, vram / 1024); - } - - return 0; -} - - static char * qemuBuildVhostUserChardevStr(const char *alias, int *fd, @@ -4497,34 +4413,15 @@ qemuBuildVideoCommandLine(virCommand *cmd, if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_NONE) continue; - if (video->primary) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) { - - if (qemuCommandAddExtDevice(cmd, - &def->videos[i]->info) < 0) - return -1; - - virCommandAddArg(cmd, "-device"); - - if (!(str =3D qemuBuildDeviceVideoStr(def, video, qemuCaps= ))) - return -1; - - virCommandAddArg(cmd, str); - } else { - if (qemuBuildVgaVideoCommand(cmd, video, qemuCaps) < 0) - return -1; - } - } else { - if (qemuCommandAddExtDevice(cmd, &def->videos[i]->info) < 0) - return -1; + if (qemuCommandAddExtDevice(cmd, &def->videos[i]->info) < 0) + return -1; - virCommandAddArg(cmd, "-device"); + virCommandAddArg(cmd, "-device"); - if (!(str =3D qemuBuildDeviceVideoStr(def, video, qemuCaps))) - return -1; + if (!(str =3D qemuBuildDeviceVideoStr(def, video, qemuCaps))) + return -1; - virCommandAddArg(cmd, str); - } + virCommandAddArg(cmd, str); } return 0; --=20 2.30.2