From nobody Mon Feb 9 10:50:02 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=1617980595; cv=none; d=zohomail.com; s=zohoarc; b=NNdlfrh8HjcAM1n4k+dR+L4Tq8qO7rv0aQXYfHiA+23UHY8xXX3AfTchn36gR7lTRb2tGqHFMPz/cqUEYT75Kl7Z3E/nYekFPFakOdU3G5/s/i7sAYze1YhQRyTjvQB06Nrn31reunOwvbUdjF85Hjo9xB2UmMdhwZp8K2B/ZKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617980595; 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=9zIsAbpXZwDKTbezZQydq5m75dJ5MgQxTnw33TPrKic=; b=WEBArNeS6mI8bbxrBQOOKcvI7It27ihUb8i6S9yRevNeTKtLoCWJEV7ia+taoTXIJgT89Y+YjkEMoYldatDOoTUHhX1Xhv82aRjHFqRwxZAWObjMXmqm4BwfaZ/fdS4XU/Dsd3OcjVG1OoNVjV+Ex5F3b834z7cED/Cmu9+BhzM= 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 1617980595100183.67995202935333; Fri, 9 Apr 2021 08:03:15 -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-248-XTCQPl3rMDmMLfuaO_OVRw-1; Fri, 09 Apr 2021 11:01:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9755D107B05B; Fri, 9 Apr 2021 15:00:42 +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 6F8F65C1A1; Fri, 9 Apr 2021 15:00:42 +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 2FADF1806D0E; Fri, 9 Apr 2021 15:00:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 139EwFb4024007 for ; Fri, 9 Apr 2021 10:58:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id B511B6B8DD; Fri, 9 Apr 2021 14:58:15 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1454960D79 for ; Fri, 9 Apr 2021 14:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980592; 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=9zIsAbpXZwDKTbezZQydq5m75dJ5MgQxTnw33TPrKic=; b=P/t5Aau23UkgWFAxJKGlBsgAeUHxDPRS94g1gr0DzeVJPsZwhwwoybsJLvLBGI+6WGaJN4 d+9rBzx0xb/dVPGRfsQn5ic5w2+Dm6gyIWjL7chOJAixaz0HGX1l+9wWrXjkX1w6hsmB2P Jz64+zpNGfj3TBE+Ihy8Pr/Fe3X18Rw= X-MC-Unique: XTCQPl3rMDmMLfuaO_OVRw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 33/43] qemu: command: Remove legacy '-vga' commandline formatter Date: Fri, 9 Apr 2021 16:57:09 +0200 Message-Id: <34f90228878dd5c02419509a430da49e75d45cb7.1617979432.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.16 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 --- 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 a0e489fb59..60607c0f68 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4361,90 +4361,6 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, } -static int -qemuBuildVgaVideoCommand(virCommandPtr cmd, - virDomainVideoDefPtr video, - virQEMUCapsPtr 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, @@ -4496,34 +4412,15 @@ qemuBuildVideoCommandLine(virCommandPtr 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