From nobody Sun Feb 8 13:13:14 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=1623423932; cv=none; d=zohomail.com; s=zohoarc; b=V3IJC79eb9otV93o+zhzwfy+Szl359HI02XRbE7ll2y6P+b7JIxTy4jzbgjHPfE0UOWR/u1G0DxRyJY3ad0d2nFG7QUEwuF9fIHY9H1FVVLG0fsHhgybLDvYDj9zyKFnsnQZVDCGC71fUAJRlKUlLsQ1kHwmkiU3aK1mcySjArQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623423932; 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=nselbtx31EF6RRcYDEFPH9OHc4xl5Ha6uG4ZUIolB+E=; b=PHZiPTnuQW7q6cGKkXNW5pwBUIuqY5sC0/1RvBJAGZVpKtoVFin4aMLnwrLoxGN5kiXERMeJBncv6LqwTonIje6H48fsXQIW8C4BG8xMGM3PwsEdMMk4Zw3QgLAWpmBpf4TwVaD6gp7sAowDJXLVpadAb5S4fxaa3lqeNUC9BUc= 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) 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 1623423932001371.03912110754106; Fri, 11 Jun 2021 08:05:32 -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-575-Je8CgwDhMc2wPNezHtU8Tg-1; Fri, 11 Jun 2021 11:05:29 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F1506100B3AE; Fri, 11 Jun 2021 15:05:22 +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 CBA855D9C6; Fri, 11 Jun 2021 15:05:22 +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 903681826D2C; Fri, 11 Jun 2021 15:05:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15BF5Kp6009937 for ; Fri, 11 Jun 2021 11:05:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80FC65D9C6; Fri, 11 Jun 2021 15:05:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 057255D9F0 for ; Fri, 11 Jun 2021 15:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623423931; 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=nselbtx31EF6RRcYDEFPH9OHc4xl5Ha6uG4ZUIolB+E=; b=gUmKD9DcDHmtJNr9PViXITee2Brpuj1iuouXwpRK1E+d1wOcRF3ccPZeL6hLJ0CS/P5u5J 69DzJthDFRlJhpuB1nNknwDRxwrzNM/GzOK2QfWMNoAwDjRlG6Lp64I2mniJkjiWYCAZxv sTukQRVDolksx3wkiu1ZPmmt2sQlc5w= X-MC-Unique: Je8CgwDhMc2wPNezHtU8Tg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 5/7] qemu_command: Switch from VIR_ENUM_IMPL(qemuDeviceVideoSecondary) to explicit switch() Date: Fri, 11 Jun 2021 17:04:58 +0200 Message-Id: <1fecdb2d6cfb5c1acb1a22aeb4e06bc130231431.1623423850.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.14 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" This may look like a step backwards, but it isn't. The point is that in near future the chosen model will depend on more than just video type. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0a22036002..71f0b498c1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -104,25 +104,6 @@ VIR_ENUM_IMPL(qemuVideo, "", /* ramfb can't be used with -vga */ ); =20 -VIR_ENUM_DECL(qemuDeviceVideoSecondary); - -VIR_ENUM_IMPL(qemuDeviceVideoSecondary, - VIR_DOMAIN_VIDEO_TYPE_LAST, - "", /* default value, we shouldn't see this */ - "", /* no secondary device for VGA */ - "", /* no secondary device for cirrus-vga */ - "", /* no secondary device for vmware-svga */ - "", /* don't support xen */ - "", /* don't support vbox */ - "qxl", - "", /* don't support parallels */ - "virtio-gpu", - "" /* don't support gop */, - "" /* 'none' doesn't make sense here */, - "" /* no secondary device for bochs */, - "" /* no secondary device for ramfb */, -); - VIR_ENUM_IMPL(qemuSoundCodec, VIR_DOMAIN_SOUND_CODEC_TYPE_LAST, "hda-duplex", @@ -4229,7 +4210,27 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps, break; } } else { - model =3D qemuDeviceVideoSecondaryTypeToString(video->type); + switch (video->type) { + case VIR_DOMAIN_VIDEO_TYPE_QXL: + model =3D "qxl"; + break; + case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: + model =3D "virtio-gpu"; + break; + case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + case VIR_DOMAIN_VIDEO_TYPE_XEN: + case VIR_DOMAIN_VIDEO_TYPE_VBOX: + case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: + case VIR_DOMAIN_VIDEO_TYPE_GOP: + case VIR_DOMAIN_VIDEO_TYPE_NONE: + case VIR_DOMAIN_VIDEO_TYPE_BOCHS: + case VIR_DOMAIN_VIDEO_TYPE_RAMFB: + case VIR_DOMAIN_VIDEO_TYPE_LAST: + break; + } } } =20 --=20 2.31.1