From patchwork Sun Aug 27 15:04:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 111083 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp3665504qge; Sun, 27 Aug 2017 08:05:01 -0700 (PDT) X-Received: by 10.200.40.23 with SMTP id 23mr5802955qtq.206.1503846301509; Sun, 27 Aug 2017 08:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503846301; cv=none; d=google.com; s=arc-20160816; b=lrEtdczVxIHODwLM6CQCLcLudQhY8zFnY8SNJczroP7bAPj/rf2sVYMV6CXUQ1jFV5 ohIsmegNdG3h6ARHj7Kw1b1hozeLGLd6POMPXlrqhCCX7sTdphP+FoEgUOfsTiau+cCR Pup0LgbWpdo6gek8VAHeW8766qjps5chyWxnFrX22b7G2NVEwUUGJ38l6TSP5arFtqJj EhuAwAHiapHvoJaMItHU8wTtnfgvis3ZRAg88tQOJfR4AAm62E59ukgM3KGxlLQCOjYF dEqyEmY5VbDlWepfpotgTAwipxx7OeiNl/H2jHL6x46bggxq40Rq/q24pJZ7yd4GJHf4 8Nvw== 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:dmarc-filter :arc-authentication-results; bh=ex67Eq45nuf39OWI0tmCePlOv9EhSqEkAeZFYwOOv5M=; b=T/zsukXbh2wkb48Q2KM4wWtfmi1y0D7hwvXZHWOdljBKjyMFL3LJ23hEbNxmkYVQxl /TWwcjmNtpLDXZOCebw4PwpLbDmVzgw10AXg45Zd15t108P1uSuRNiq7onFhrLzWPqZX 5T/GKoTl3iWNXLd49WuFkkFyvHptPI417H1H4McxusVF20YJ91kUEmNMwcp4Jdn5jpoL fg6XmaUjIjzzRU2TFOhnIxZhCSEM07mSwYmzMW9LLTJJKISEusd0svHyJn3QYZgQArXh oYKhzEWKnrl/d0s+DPO1Sbs5QtvapqD92wu4Mwu1GPbWtMJbRslvdD/1yS0wlHIe2fJJ vyMg== 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 c29si10788338qtb.154.2017.08.27.08.05.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Aug 2017 08:05:01 -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 160985F7AE; Sun, 27 Aug 2017 15:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 160985F7AE 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=fail smtp.mailfrom=libvir-list-bounces@redhat.com 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 E62306C41B; Sun, 27 Aug 2017 15:04:59 +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 8FAAE3FC75; Sun, 27 Aug 2017 15:04:59 +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 v7RF4lEd015458 for ; Sun, 27 Aug 2017 11:04:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id C35C06E8F4; Sun, 27 Aug 2017 15:04:47 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from colepc.redhat.com (ovpn-116-34.phx2.redhat.com [10.3.116.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57E7E6E8F5; Sun, 27 Aug 2017 15:04:47 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Sun, 27 Aug 2017 11:04:38 -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 v2 1/5] qemu: whitelist valid video types 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.39]); Sun, 27 Aug 2017 15:05:00 +0000 (UTC) Rather than require an explicit blacklist that needs to be extended for every new VIDEO_TYPE Signed-off-by: Cole Robinson --- src/qemu/qemu_domain.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.13.5 -- 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 2c77a6442..1c6b1ba79 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3014,20 +3014,17 @@ qemuDomainDefValidateVideo(const virDomainDef *def) video = def->videos[i]; switch (video->type) { - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type '%s' is not supported with QEMU"), - virDomainVideoTypeToString(video->type)); - return -1; case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: case VIR_DOMAIN_VIDEO_TYPE_VMVGA: case VIR_DOMAIN_VIDEO_TYPE_QXL: case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: - case VIR_DOMAIN_VIDEO_TYPE_LAST: break; + default: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type '%s' is not supported with QEMU"), + virDomainVideoTypeToString(video->type)); + return -1; } if (!video->primary && From patchwork Sun Aug 27 15:04:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 111087 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp3665640qge; Sun, 27 Aug 2017 08:05:07 -0700 (PDT) X-Received: by 10.55.22.1 with SMTP id g1mr6284819qkh.82.1503846306969; Sun, 27 Aug 2017 08:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503846306; cv=none; d=google.com; s=arc-20160816; b=P8wGfSEWjJ6sJJFgJq8bv6bbGU5lUGv+xh4iTlkFK/PK1FieUY6oeTza4nQiO8DAHh mtJp9pJwzg+zN/FzF60FpP5XuZJa9admOeU7BApRwssdslQOvt1Hqj8hIY5ge8nAX96R TWCCf22TXYtUIBmbYHpek5py0iJIdr1Gd+D2QCCT7f1NGOMTFDSYt510OH2H0Kht6J9w O9SErKjQt/aLGazoLuXKsIZoOJGiZyh6j9YDYqmvZ38CiizK5YTHy1WBSZi4q8Tjsp2/ jzXscA6KWWa5gQbPWEB+dM3JZE6d8ekD9tR7T2cBgowazuhdNK8tN0qqUdu77+S0EJEd 6QDQ== 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:dmarc-filter :arc-authentication-results; bh=CLs16p+bNOtKGSE2P74KtyfjoUBEFC0FekzBDd0ZErE=; b=bH3fR1XS5UQ1OiJ+M1hK7iPnFsx0a9NOPZTjij4lJJSGJW3ZWLHRL1I945cJF4E95t W/8CCHqcRNl0sa/i4pRQku74lnK0uBBm4gqoxjj/nbBT3SWHkgKz0KHjbUWOKkcV5Bck B7L7MokcMuj1Lqmfean1fi9CC7VglAOC3InbEpWgF+5qWcRDOfFn0Jd6EeslHBbmZWir uzImR/roqFTVsgNeH2Ma0umBG3ZVhUQosK6/w8buEdWI5dmN11sy0DX5St5j/eJE0XrG WCJDWeHUiySi9qpGXp0jdLMUaRbPvddwFrBaKJHsLT2Ap/EsIMnGgak8mPAiYK2Pv9W3 lNbw== 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 o7si10677748qkb.380.2017.08.27.08.05.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Aug 2017 08:05:06 -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 5B7C780C1D; Sun, 27 Aug 2017 15:05:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5B7C780C1D 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=fail smtp.mailfrom=libvir-list-bounces@redhat.com 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 9584F6E903; Sun, 27 Aug 2017 15:05:04 +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 DD5D31806101; Sun, 27 Aug 2017 15:05: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 v7RF4mSQ015466 for ; Sun, 27 Aug 2017 11:04:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93F6E6E8F5; Sun, 27 Aug 2017 15:04:48 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from colepc.redhat.com (ovpn-116-34.phx2.redhat.com [10.3.116.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF57B6E8E7; Sun, 27 Aug 2017 15:04:47 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Sun, 27 Aug 2017 11:04:39 -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 v2 2/5] 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sun, 27 Aug 2017 15:05:05 +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_address.c | 1 + tests/domaincapsschemadata/full.xml | 1 + 5 files changed, 7 insertions(+) -- 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Pavel Hrdina diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 646b60a83..a6b793075 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -551,6 +551,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 c3d684503..0c1660056 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1348,6 +1348,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 a68ff717f..bc027f85a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -97,6 +97,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", @@ -110,6 +111,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", @@ -123,6 +125,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_address.c b/src/qemu/qemu_domain_address.c index 16bf0cdf9..8afaa5209 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -753,6 +753,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 @@