From patchwork Wed Jun 28 18:49:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 106561 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp246902qge; Wed, 28 Jun 2017 11:49:47 -0700 (PDT) X-Received: by 10.200.47.87 with SMTP id k23mr14800114qta.11.1498675787812; Wed, 28 Jun 2017 11:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498675787; cv=none; d=google.com; s=arc-20160816; b=DNWzQ3QlOBxVan1FQO12yA27YXi6GRunf9lAUyvgUYpZ408029rcykNt2+m66aJrrD ZjHXiTRhgrt347xssj1cfHrgEqrD9x3JBORwd24lUPsd9OVEK2TV5NDlzjBCNXhPxNGf en4D911uBSjb5LTYSqA2Hdxu0jWTXsyfPVPWGMLk0C2AJU+9abPJ/5RM+ZydY0ekftum LCtnwAlaonYIe/6BJdhQWTFFXYSFa4y9HgO9ZhUXn0/ZjYK7bCStur0Az1wmMcJi57Ou 4eAFd3umvQfsuHGFCozH6fMOi0KeOqaGcRJoddoA6UYZV6rhcSz6s4kYnHRWE+K8CfaW vqBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to:dkim-filter :dmarc-filter:arc-authentication-results; bh=vHaCIh3fM1SjTixOozX9KEc8q+vo7XNiY5QrVn0Z6v0=; b=omcGuGrjCvjbyv2ogqcKi5oNHxZGqBcO+FocqzO+NiI0K+qmA5zSmW64ptUbHLwbay U8MILbMR4QzOxmNlLTn6rbNt1cb5hPhYJVZPpkyhhWIe/9Yhg7wM/S9xPFc/xNymbZu1 HrnINBZrYBev4h0kvCBgXSqpkLWudBBeb+ZHl42yEdOE99zBA4zniJwuqHrZXFvaZzht WgiMN1ieeVkQUcXZ3sAwd6RHTxfrgU02mVpZHyCZ+lYnFfJ5O590NkZyiqFukKnHgkCY wOqSXY+tv6D1CkJYQsp0AIKYEeA4KkVh8cRYRrGrkhgmogE/Giquo1UKvHWTFPLZHMIj oQwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 136si2633942qke.361.2017.06.28.11.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 11:49:47 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30D15883B1; Wed, 28 Jun 2017 18:49:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 30D15883B1 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 30D15883B1 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 B1AB6183A8; Wed, 28 Jun 2017 18:49:45 +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 8CF693FADE; Wed, 28 Jun 2017 18:49:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5SIngrn031241 for ; Wed, 28 Jun 2017 14:49:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19F1B173A7; Wed, 28 Jun 2017 18:49:42 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-116-174.phx2.redhat.com [10.3.116.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7237962930; Wed, 28 Jun 2017 18:49:41 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Wed, 28 Jun 2017 14:49:27 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] qemu: parse: drop redundant video config 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 28 Jun 2017 18:49:47 +0000 (UTC) The ram/vram = 0 bits aren't needed, and PostParse will fill in the needed QXL default Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 4 ---- src/qemu/qemu_parse_command.c | 11 +---------- 2 files changed, 1 insertion(+), 14 deletions(-) -- 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c53ab97b9..ebf9c63bc 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7264,10 +7264,6 @@ qemuBuildObsoleteAccelArg(virCommandPtr cmd, } break; - case VIR_DOMAIN_VIRT_XEN: - /* XXX better check for xenner */ - break; - default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("the QEMU binary does not support %s"), diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index af9063c02..60c81f0ca 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -2608,16 +2608,7 @@ qemuParseCommandLine(virCapsPtr caps, virDomainVideoDefPtr vid; if (VIR_ALLOC(vid) < 0) goto error; - if (def->virtType == VIR_DOMAIN_VIRT_XEN) - vid->type = VIR_DOMAIN_VIDEO_TYPE_XEN; - else - vid->type = video; - if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { - vid->vgamem = QEMU_QXL_VGAMEM_DEFAULT; - } else { - vid->ram = 0; - vid->vgamem = 0; - } + vid->type = video; vid->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) { From patchwork Wed Jun 28 18:49:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 106559 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp246893qge; Wed, 28 Jun 2017 11:49:47 -0700 (PDT) X-Received: by 10.200.57.162 with SMTP id v31mr15663354qte.57.1498675787269; Wed, 28 Jun 2017 11:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498675787; cv=none; d=google.com; s=arc-20160816; b=Nx5ZsOWdEnVImdaBxQJH7sayZ6n5Oh5hEsWEws/DFSMy4BewiRDgRH0rAOBkskdkNN PDuDmEbPZL1BKfGUnUKcK/8YT7Faj7sLkk3jKhJXnYIUUg4OIto67SxNgrw4zt8GAAS0 6Ie8cbwQ+RSurqlfhhp7q731VxJD1Ryw6A1wyK3ytBKiBsKghZf2dPfSXAwYdm+tVjaR beYCm+eVGMuE2c9wBBfWRzJIBIvL9uZr0GUUcx1cFLLTqZkGakxEKa64+V5Vum9HWwln TYWXIyKRuLfFSrlabU7pbT4s0kHso/iye7Z8oeuh88gPdM4/17DXnhvth8V+eOrJ2KfS 3Fjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to:dkim-filter :dmarc-filter:arc-authentication-results; bh=3HBmSIHqjQwZBaZUVNulZsEKEfaZtB/m1enjyNIRPU4=; b=tmIOwPluW08hIGcsnZwSE6BnJ9MOm8jmoMenzqJLy0e4fltHprbxng503MqpF2oEQD cG98fK9h9CIC+rjQDRLPr1+Qrp4+damlnOHUdHZ3gBou5dyEQ2d4PQo41KV9oisYkHFr VhHOYUDlUwBkDyobFT4hmKhros+xj9xtqUtYmxbGBIW1MVUckssS/4OtiRzmHgxiCItU t2fsojB5PEEzPT138sT/EUvsJnbcNRrNqxiATyfKdrDEB2FHD6MGBpLYCfaiWO7uVl9y xCim+YpZuxQBMMV0mK0urA2UzdgdU6jEI683EvH/KnUgfR2NCh5rKLT0s2Si9CQScMxd Ms1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id f37si2692792qtc.303.2017.06.28.11.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 11:49:47 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E751A4E4CB; Wed, 28 Jun 2017 18:49:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E751A4E4CB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E751A4E4CB 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 A303A60462; Wed, 28 Jun 2017 18:49:45 +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 69DA21853E30; Wed, 28 Jun 2017 18:49:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5SIngJv031247 for ; Wed, 28 Jun 2017 14:49:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9BA3F62930; Wed, 28 Jun 2017 18:49:42 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-116-174.phx2.redhat.com [10.3.116.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 406B75D6A6; Wed, 28 Jun 2017 18:49:42 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Wed, 28 Jun 2017 14:49:28 -0400 Message-Id: <139fc7181b50d7909d7ac7f4296f4edaf1f22275.1498675591.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] qemu: domain: Move some validation out of DeviceDefPostParse 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 28 Jun 2017 18:49:46 +0000 (UTC) And into DeviceDefValidate which is the expected place Signed-off-by: Cole Robinson --- src/qemu/qemu_domain.c | 55 +++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 25 deletions(-) -- 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8e7404da6..90f489840 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3191,6 +3191,33 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, } } + /* forbid capabilities mode hostdev in this kind of hypervisor */ + if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV && + dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("hostdev mode 'capabilities' is not " + "supported in %s"), + virDomainVirtTypeToString(def->virtType)); + goto cleanup; + } + + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + dev->data.video->vgamem) { + if (dev->data.video->vgamem < 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be at least 1 MiB " + "(1024 KiB)")); + goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + } + } + } + ret = 0; cleanup: virObjectUnref(cfg); @@ -3551,31 +3578,9 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, goto cleanup; } - /* forbid capabilities mode hostdev in this kind of hypervisor */ - if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV && - dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("hostdev mode 'capabilities' is not " - "supported in %s"), - virDomainVirtTypeToString(def->virtType)); - goto cleanup; - } - - if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && - dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { - if (dev->data.video->vgamem) { - if (dev->data.video->vgamem < 1024) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("value for 'vgamem' must be at least 1 MiB " - "(1024 KiB)")); - goto cleanup; - } - if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("value for 'vgamem' must be power of two")); - goto cleanup; - } - } else { + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + !dev->data.video->vgamem) { dev->data.video->vgamem = QEMU_QXL_VGAMEM_DEFAULT; } } From patchwork Wed Jun 28 18:49:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 106564 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp247261qge; Wed, 28 Jun 2017 11:50:13 -0700 (PDT) X-Received: by 10.237.43.134 with SMTP id e6mr14476284qtd.131.1498675813403; Wed, 28 Jun 2017 11:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498675813; cv=none; d=google.com; s=arc-20160816; b=dXFKl2l6jEqHs1iBD/0oo2+me2CqxT3f+wzzGmSF6OQ8RhkBlR5uadXqohCq+GojZD DRGHgnJyJl3x/7CHDuPv+/N5VExuuSOWn3TW73f85INuwxAgjaEJGc2VbfMR35DbuScb CFzy6vKtSPvv3XiC/zKOmQjcLr+HonOlzGHJtmJJzObumNHGmpcoZVEC5uKgiQcJe+9I 7BSviHOxJfA0ud5Z+BsBO0OvXsk8NvVNkjZmJ6sgQJxGyZLyBm269geTWeMkLGyPGkSw +5myqOy3hxhFahUF+5R/rW1D1WG/FTv08DFaDQWvB8xMQyEPIHH+vomcqrcfz1AFkia0 qhnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to:dkim-filter :dmarc-filter:arc-authentication-results; bh=SfRCL3DBtVF+g+dfD1QIudboDhWK2AwtRBjR4tt6aj0=; b=DG27uuZiw0xOm1GBWLGasrWYszIfWMxE6Zd8BUMylorDV3x/jTTNN6m9M+/znG+NA7 i/eXWZha1zwUwTc3yRF7/fvwBGL6vk9W0kNDcA8MFe9Fqts1Jm1tm0ujZTYTyUMBQHos x5bcoTjdqpF9ruCEgUW+MTylqSsXsyt8vG5M1jZDu3vfRQ0B1ltxC+XPzedlWX5MF9fU 8YgRALIh5k0eU9v5OUGYJoLmaU2cYpNp6D1FZvt+8gG3ZTp1yECWFW4ICP5wIQ+lWve5 gPUa3hdAOmviBjIJ1A/RaX2EpyKqjlsFHME/S0v4bExFUnkJSoOMn4Fw69cXJ/Xs2qDW QjrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id f5si2722657qtg.123.2017.06.28.11.50.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 11:50:13 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 8A20561D36; Wed, 28 Jun 2017 18:50:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A20561D36 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8A20561D36 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 4E0C717B73; Wed, 28 Jun 2017 18:50:11 +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 00D1B1853E36; Wed, 28 Jun 2017 18:50:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5SInhFO031254 for ; Wed, 28 Jun 2017 14:49:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 29E82173A7; Wed, 28 Jun 2017 18:49:43 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-116-174.phx2.redhat.com [10.3.116.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3A475D6A6; Wed, 28 Jun 2017 18:49:42 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Wed, 28 Jun 2017 14:49:29 -0400 Message-Id: <3192e26e04a4415ed01fb1a06b4e07e4ca102dbc.1498675591.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/8] qemu: annotate some VIDEO_TYPE enum switch 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 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.39]); Wed, 28 Jun 2017 18:50:12 +0000 (UTC) For the ram/vram monitor wrappers, just add a default: clause... seems like it should be rarely extended so this saves every committer from needing to update For the validation switch, fill in the missing values Signed-off-by: Cole Robinson --- src/qemu/qemu_domain.c | 3 ++- src/qemu/qemu_monitor_json.c | 16 ++++------------ src/qemu/qemu_process.c | 7 ++----- 3 files changed, 8 insertions(+), 18 deletions(-) -- 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 90f489840..ac1bc1a1e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2950,10 +2950,11 @@ qemuDomainDefValidateVideo(const virDomainDef *def) for (i = 0; i < def->nvideos; i++) { video = def->videos[i]; - switch (video->type) { + switch ((virDomainVideoType) video->type) { case VIR_DOMAIN_VIDEO_TYPE_XEN: case VIR_DOMAIN_VIDEO_TYPE_VBOX: case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: + case VIR_DOMAIN_VIDEO_TYPE_GOP: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("video type '%s' is not supported with QEMU"), virDomainVideoTypeToString(video->type)); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 5ddc09ca6..2afc03329 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1565,7 +1565,7 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, {0} }; - switch (video->type) { + switch ((virDomainVideoType) video->type) { case VIR_DOMAIN_VIDEO_TYPE_VGA: if (qemuMonitorJSONGetObjectProperty(mon, path, "vgamem_mb", &prop) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1608,10 +1608,7 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, } video->vram = prop.val.ul * 1024; break; - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_LAST: + default: break; } @@ -1635,7 +1632,7 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon, {0} }; - switch (video->type) { + switch ((virDomainVideoType) video->type) { case VIR_DOMAIN_VIDEO_TYPE_QXL: if (video->vram64 != 0) { if (qemuMonitorJSONGetObjectProperty(mon, path, @@ -1648,12 +1645,7 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon, video->vram64 = prop.val.ul * 1024; } break; - case VIR_DOMAIN_VIDEO_TYPE_VGA: - case VIR_DOMAIN_VIDEO_TYPE_VMVGA: - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_LAST: + default: break; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d669dfb32..fb6e2c82b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2605,7 +2605,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver, for (i = 0; i < vm->def->nvideos; i++) { video = vm->def->videos[i]; - switch (video->type) { + switch ((virDomainVideoType) video->type) { case VIR_DOMAIN_VIDEO_TYPE_VGA: if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VGA_VGAMEM)) { if (qemuMonitorUpdateVideoMemorySize(priv->mon, video, "VGA") < 0) @@ -2642,10 +2642,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver, goto error; } break; - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_LAST: + default: break; } From patchwork Wed Jun 28 18:49:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 106562 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp247145qge; Wed, 28 Jun 2017 11:50:05 -0700 (PDT) X-Received: by 10.237.48.130 with SMTP id 2mr14679738qtf.17.1498675805558; Wed, 28 Jun 2017 11:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498675805; cv=none; d=google.com; s=arc-20160816; b=HIUDsXzqxVV23WGJRVKJiVNEIXw+c1fIRw9aSzYu3pj167Aa2zzX7gKDfC1dA0LnSi AP4ICsxZamkVC1lCMo+Y07QvV6/Pk9aKOtQctP2fCr9QMj8PeCobb4bGKEiwteTgbyT1 Ekewhmww6VT3XkU4nS2YOkzQEpCFANL6I1SZ6hQTqvTE9UcH+adnjmFo2tHa8JBM7j+o UTUXWOoiIjVtWFrP2kYpKmrGVOx4sMpFv5HdDXOphONmPXZ53QeqA93tYRa6oNGaCKm9 wH10KgYCoCapDqUwp3LE5LWTVfiZE5JH/PaOL8EO9eGBrPc1Krt60mGpwM9gN4xSddg8 fRMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to:dkim-filter :dmarc-filter:arc-authentication-results; bh=HtIWkxBJqJcfxLAhxl/Sc/VGFT0EnfENLZdKyyIsvU8=; b=MlrzwM/8x9Aji5djaBBHpF/Fl+lcl+S3WS+b1ypaDSYtmVnHxZBayKSaYyn7XEUzEq 36CAMEmSBboi+VZLRUdqZiSN3AiR8i2K3rbNED57ErMCSSnN5o9I5BjzPQTrfueySU+H tPV0PpeERrTZvt4pSzCouvYcfnhZeXGK+DsZ7ovuw6E3+BzhW6fWxeEUHjVDy2YETfyg TAXkTbjNM4bnrHfqfMkf+qyz5dGB8pSEsbow6Kxf2XTKfnxCt3TbiCs1FpGbxDxUrgWU h4BiSk4OOj4GjfCwaEcOP+Lg3gttiZmQIcqIjvcUg2QpdF7Xe+0MoKwnAcdi55Dl4za+ Jvgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id z78si2807368qkg.396.2017.06.28.11.50.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 11:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id 329A4C04B329; Wed, 28 Jun 2017 18:50:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 329A4C04B329 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 329A4C04B329 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 EE4EF81F37; Wed, 28 Jun 2017 18:50:03 +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 99DE41853E34; Wed, 28 Jun 2017 18:50:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5SInhLO031259 for ; Wed, 28 Jun 2017 14:49:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id A737C62930; Wed, 28 Jun 2017 18:49:43 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-116-174.phx2.redhat.com [10.3.116.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 510E75D6A6; Wed, 28 Jun 2017 18:49:43 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Wed, 28 Jun 2017 14:49:30 -0400 Message-Id: <661a663f7482b57c85f3c590bbe2d714bb992b8d.1498675591.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/8] conf: add virDomainVideoDefNew 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Jun 2017 18:50:04 +0000 (UTC) To handle setting a default heads value. Convert callers that were doing it by hand Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 21 ++++++++++++++++----- src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + src/qemu/qemu_parse_command.c | 3 +-- src/vz/vz_sdk.c | 3 +-- 5 files changed, 20 insertions(+), 9 deletions(-) -- 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c3149f976..47b668dc1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2351,6 +2351,20 @@ void virDomainShmemDefFree(virDomainShmemDefPtr def) VIR_FREE(def); } + +virDomainVideoDefPtr +virDomainVideoDefNew(void) +{ + virDomainVideoDefPtr def; + + if (VIR_ALLOC(def) < 0) + return NULL; + + def->heads = 1; + return def; +} + + void virDomainVideoDefFree(virDomainVideoDefPtr def) { if (!def) @@ -13660,7 +13674,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, ctxt->node = node; - if (VIR_ALLOC(def) < 0) + if (!(def = virDomainVideoDefNew())) return NULL; cur = node->children; @@ -13754,8 +13768,6 @@ virDomainVideoDefParseXML(xmlNodePtr node, _("cannot parse video heads '%s'"), heads); goto error; } - } else { - def->heads = 1; } if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) @@ -20944,7 +20956,7 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def) if (def->ngraphics == 0 || def->nvideos > 0) return 0; - if (VIR_ALLOC(video) < 0) + if (!(video = virDomainVideoDefNew())) goto cleanup; video->type = virDomainVideoDefaultType(def); if (video->type < 0) { @@ -20952,7 +20964,6 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def) _("cannot determine default video type")); goto cleanup; } - video->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, video) < 0) goto cleanup; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 964bc02f9..db89ffa97 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2683,6 +2683,7 @@ void virDomainSoundDefFree(virDomainSoundDefPtr def); void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def); void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def); void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def); +virDomainVideoDefPtr virDomainVideoDefNew(void); void virDomainVideoDefFree(virDomainVideoDefPtr def); virDomainHostdevDefPtr virDomainHostdevDefAlloc(virDomainXMLOptionPtr xmlopt); void virDomainHostdevDefClear(virDomainHostdevDefPtr def); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 888412ac7..248237c4a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -528,6 +528,7 @@ virDomainUSBDeviceDefForeach; virDomainVideoDefaultRAM; virDomainVideoDefaultType; virDomainVideoDefFree; +virDomainVideoDefNew; virDomainVideoTypeFromString; virDomainVideoTypeToString; virDomainVideoVGAConfTypeFromString; diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 60c81f0ca..6751868a6 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -2606,10 +2606,9 @@ qemuParseCommandLine(virCapsPtr caps, if (def->ngraphics) { virDomainVideoDefPtr vid; - if (VIR_ALLOC(vid) < 0) + if (!(vid = virDomainVideoDefNew())) goto error; vid->type = video; - vid->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) { virDomainVideoDefFree(vid); diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index a62b31079..950eeaa34 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -552,12 +552,11 @@ prlsdkAddDomainVideoInfoCt(virDomainDefPtr def) if (def->ngraphics == 0) return 0; - if (VIR_ALLOC(video) < 0) + if (!(video = virDomainVideoDefNew())) goto cleanup; video->type = VIR_DOMAIN_VIDEO_TYPE_PARALLELS; video->vram = 0; - video->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, video) < 0) goto cleanup; From patchwork Wed Jun 28 18:49:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 106563 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp247211qge; Wed, 28 Jun 2017 11:50:09 -0700 (PDT) X-Received: by 10.237.35.82 with SMTP id i18mr1735580qtc.25.1498675809632; Wed, 28 Jun 2017 11:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498675809; cv=none; d=google.com; s=arc-20160816; b=Jgg1vpU6PqYbBdZ1lXwkycogFHQ5xOo4c4NcQ56OI7TOmgp5pTaKNtLP0Fsge1LjSP ALZJ7M23X+EYgubT4R2TJBvKndzQ7fJEy+3phuF18PfdgYgUulGrWc3LxNjCSFhjDOeV 6BKWgGaBvd4p4KpfvVt4SJK1lpyUu6gPXxZBXFBRD26cWKRUk7hnExf5DphIvd/vJdwY 0OtifpdF8ZryFqAz5oajp7QAY2VQF96YE10dx0xGYpYk3n0nFnXqvM8vBATXVucs3Ydz g0XX5aEE9DbXZP7b5e42hvluUSyN8XG+/ySfSwPtXJXHzjpxTuB4i1mn7hq7qgdo4ccG Y89g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to:dkim-filter :dmarc-filter:arc-authentication-results; bh=1t//QLwKdNqmahx0BzcmNxSf4CihzJG9YmxQe/qiZmo=; b=m1APsjzeFAq2MeafcsxDB7Oryl3T9J3qHd0hcVCu+drAe9jMnk0wHCl8RqnrNQILRg IezAHYer36xSX612quGH9pONs/PmhSmfHkgRzPG0sdoddzssoBadAq6sVzCJsq1PpmXd aj7h2T4UBto24LgH8E5dYHfYSSM7XnU0yPIwxI0hPfVxWdWp+c276XZR8815otKDwxqX A3XzB21MTc1s9nGzY1Q+Ca/sqnEnXVUHfJ8Gg+J/nM11/We2bspwagAAM8B93VEwewNY fvmgT3HcuCv5+hiCmKSyJW/IrN1Y0LRQRomLs1rFyUgQ2FzgtLkbtNq5wyLdepUnYb52 le2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id q55si2710363qtf.382.2017.06.28.11.50.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 11:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id 019148553F; Wed, 28 Jun 2017 18:50:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 019148553F Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 019148553F 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 CE9EE17D4A; Wed, 28 Jun 2017 18:50:07 +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 74F6E1853E36; Wed, 28 Jun 2017 18:50:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5SIni7K031264 for ; Wed, 28 Jun 2017 14:49:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 313E062930; Wed, 28 Jun 2017 18:49:44 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-116-174.phx2.redhat.com [10.3.116.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF64B5D6A6; Wed, 28 Jun 2017 18:49:43 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Wed, 28 Jun 2017 14:49:31 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/8] conf: domain: add VIDEO_TYPE_DEFAULT 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 28 Jun 2017 18:50:08 +0000 (UTC) Will be needed for future patches to pull the default video type setting out of XML parsing routines. Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 3 +++ src/qemu/qemu_domain.c | 1 + src/qemu/qemu_domain_address.c | 1 + tests/domaincapsschemadata/full.xml | 1 + 6 files changed, 8 insertions(+) -- 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 47b668dc1..984d15abf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -550,6 +550,7 @@ VIR_ENUM_IMPL(virDomainPanicModel, VIR_DOMAIN_PANIC_MODEL_LAST, "s390") VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, + "default", "vga", "cirrus", "vmvga", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index db89ffa97..dc1516b91 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1345,6 +1345,7 @@ struct _virDomainWatchdogDef { typedef enum { + VIR_DOMAIN_VIDEO_TYPE_DEFAULT, VIR_DOMAIN_VIDEO_TYPE_VGA, VIR_DOMAIN_VIDEO_TYPE_CIRRUS, VIR_DOMAIN_VIDEO_TYPE_VMVGA, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ebf9c63bc..cf5e9092b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -96,6 +96,7 @@ VIR_ENUM_IMPL(qemuDiskCacheV2, VIR_DOMAIN_DISK_CACHE_LAST, "unsafe"); VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, + "", /* default value, we shouldn't see this */ "std", "cirrus", "vmware", @@ -109,6 +110,7 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, VIR_ENUM_DECL(qemuDeviceVideo) VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, + "", /* default value, we shouldn't see this */ "VGA", "cirrus-vga", "vmware-svga", @@ -122,6 +124,7 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, 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 */ diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ac1bc1a1e..387dade8f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2955,6 +2955,7 @@ qemuDomainDefValidateVideo(const virDomainDef *def) case VIR_DOMAIN_VIDEO_TYPE_VBOX: case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: case VIR_DOMAIN_VIDEO_TYPE_GOP: + case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("video type '%s' is not supported with QEMU"), virDomainVideoTypeToString(video->type)); diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index b5b863fe4..8f19ab824 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -752,6 +752,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: return pciFlags; + case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: case VIR_DOMAIN_VIDEO_TYPE_GOP: case VIR_DOMAIN_VIDEO_TYPE_LAST: return 0; diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemadata/full.xml index 82a92322e..ab6ef9f2e 100644 --- a/tests/domaincapsschemadata/full.xml +++ b/tests/domaincapsschemadata/full.xml @@ -62,6 +62,7 @@