From patchwork Fri Jan 22 19:30:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 60193 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp51306lbb; Fri, 22 Jan 2016 11:33:18 -0800 (PST) X-Received: by 10.55.81.3 with SMTP id f3mr5952932qkb.35.1453491192863; Fri, 22 Jan 2016 11:33:12 -0800 (PST) Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com. [209.132.183.25]) by mx.google.com with ESMTPS id 107si8559357qgo.100.2016.01.22.11.33.11 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jan 2016 11:33:12 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0MJUwlr001598; Fri, 22 Jan 2016 14:30:58 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0MJUmhh019962 for ; Fri, 22 Jan 2016 14:30:48 -0500 Received: from colepc.redhat.com (ovpn-113-198.phx2.redhat.com [10.3.113.198]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MJUaPZ002518; Fri, 22 Jan 2016 14:30:47 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 22 Jan 2016 14:30:27 -0500 Message-Id: <2cd4c68e4ee5d25d6a405b1e09af57953eb55ee2.1453489952.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/17] qemu: command: drop QEMU_CAPS_DEVICE for video cli 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com The whole block was also conditionalized on nvideos >= 1, which the loop will handle fine after the QEMU_CAPS_DEVICE check is dropped. --- src/qemu/qemu_command.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 516f351..d48f173 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10706,33 +10706,24 @@ qemuBuildCommandLine(virConnectPtr conn, dev, vram / 1024); } - if (def->nvideos > 1) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - for (i = 1; i < def->nvideos; i++) { - char *str; - if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is only valid as primary video card"), - virDomainVideoTypeToString(def->videos[0]->type)); - goto error; - } - - virCommandAddArg(cmd, "-device"); - - if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], qemuCaps, false))) - goto error; - - virCommandAddArg(cmd, str); - VIR_FREE(str); - } - } else { + for (i = 1; i < def->nvideos; i++) { + char *str; + if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("only one video card is currently supported")); + _("video type %s is only valid as primary video card"), + virDomainVideoTypeToString(def->videos[0]->type)); goto error; } + + virCommandAddArg(cmd, "-device"); + + if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i], qemuCaps, false))) + goto error; + + virCommandAddArg(cmd, str); + VIR_FREE(str); } } - } /* Add sound hardware */