From patchwork Fri Jan 18 23:05:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 156107 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3797573jaa; Fri, 18 Jan 2019 15:06:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN7I8+atL4m8PBlS6MgRQQfbu9T/9+dSsu9Y4xDUZu2vM25Fcg5+cGZ4v2mALsvCaUOlVw/u X-Received: by 2002:a0c:ab13:: with SMTP id h19mr17699405qvb.74.1547852778305; Fri, 18 Jan 2019 15:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547852778; cv=none; d=google.com; s=arc-20160816; b=cWaAhZ+1JcFH4ywDo3M8SjaBD53+tdalVOPBo0M+cTXk2h6a1eDqdHGQ3pD0xMM3jx laIRmKdX7RMrWdx4TPLAKAE5ImNyYBs9DNG2GscgJjvwJbAdnwAfql/fi5S84Dpxpfs6 9QIbhZ/AfhzzT1TNMF/LkLl8SK3MIH0Zbg+Hj2akNYRqzIavIpuqkdF5hmTbN/8G2YRE +PPySn3pj1q12bHy4U8R252+/M/5tDSjvmlW9UAQInMOmgOR54NAW7qEO0dqjR4Ada6v fwKnzWudD+sxdZo4EmWrby+13onWtmF35ZxwdHhcjh2NAxgl8FO5X+UidxKRMp99qBAo evkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=IsTVd7DR/b7vxjn0mIYamtZqELeAtIRLfg58vlvEPbs=; b=guBPHeXAWw01AiT1oVYJx25Ir5HFgFiKlvDP+6p1e57hVyf18Prq7HPaiusjB2TTaM fgz9X7DHfKtA8jjchvWw7R7KnNfOyy2qqFPPznakXFcVThllOeWKZ3C8gnuh71fPKxpj OvulRbqQ1gXR3aC9qB7zhEUG1XmXzsRVJN0V4fnzA0Vaq4TJx+mM49xsnT03rurg39U2 upoMw9k7ahPPQj8K4RJ0eRGADrYZweEiCUGr5zrajgO4LatXgqUtQYTi5sSbl6SvH6Ie 9OA6bObllnYiQe29T/jVL3OIv7rI1HzNmsVBNouRo4RAeKEhgFcl8udqsq3wmqpXz70L G2WA== 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 l45si874255qtk.229.2019.01.18.15.06.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 15:06:18 -0800 (PST) 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 C8D0D80F94; Fri, 18 Jan 2019 23:06:16 +0000 (UTC) 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 99E8F60C55; Fri, 18 Jan 2019 23:06:16 +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 45B853F60B; Fri, 18 Jan 2019 23:06:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0IN5dsu008697 for ; Fri, 18 Jan 2019 18:05:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 707ED600D7; Fri, 18 Jan 2019 23:05:39 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-125-139.rdu2.redhat.com [10.10.125.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06B3D600C2; Fri, 18 Jan 2019 23:05:38 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 18 Jan 2019 18:05:28 -0500 Message-Id: <3bd2f9447197b482ebb0d78ee051267e297c3857.1547851898.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/10] conf: Add VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 18 Jan 2019 23:06:17 +0000 (UTC) This requires drivers to opt in to handle the raw modelstr network model, all others will error if a passed in XML value is not in the model enum. Enable this feature for libxl/xen/xm and qemu drivers Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 9 +++++++++ src/conf/domain_conf.h | 1 + src/libxl/libxl_domain.c | 1 + src/qemu/qemu_domain.c | 3 ++- src/security/virt-aa-helper.c | 3 ++- 5 files changed, 15 insertions(+), 2 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e951e8153b..19564c3e4f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4972,6 +4972,15 @@ virDomainDeviceDefPostParseCheckFeatures(virDomainDeviceDefPtr dev, virDomainDeviceDefCheckUnsupportedMemoryDevice(dev) < 0) return -1; + if (UNSUPPORTED(VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING) && + dev->type == VIR_DOMAIN_DEVICE_NET && + dev->data.net->modelstr) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("driver does not support net model '%s'"), + dev->data.net->modelstr); + return -1; + } + return 0; } #undef UNSUPPORTED diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b4e70480ac..b25d539cb2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2739,6 +2739,7 @@ typedef enum { VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS = (1 << 4), VIR_DOMAIN_DEF_FEATURE_USER_ALIAS = (1 << 5), VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER = (1 << 6), + VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING = (1 << 7), } virDomainDefFeatures; diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 3ada51f517..f4093411e3 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -424,6 +424,7 @@ virDomainDefParserConfig libxlDomainDefParserConfig = { .macPrefix = { 0x00, 0x16, 0x3e }, .devicesPostParseCallback = libxlDomainDeviceDefPostParse, .domainPostParseCallback = libxlDomainDefPostParse, + .features = VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, }; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 44d43a85c9..e1b0b08dcc 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6804,7 +6804,8 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = { .features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG | VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN | VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS | - VIR_DOMAIN_DEF_FEATURE_USER_ALIAS, + VIR_DOMAIN_DEF_FEATURE_USER_ALIAS | + VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, }; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 3bd30bb417..86abd35de6 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -646,7 +646,8 @@ caps_mockup(vahControl * ctl, const char *xmlStr) virDomainDefParserConfig virAAHelperDomainDefParserConfig = { .features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG | VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN | - VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS, + VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS | + VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, }; static int