From patchwork Wed Mar 13 15:51:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160244 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14474158jad; Wed, 13 Mar 2019 08:51:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqygXOUrJKu7xofWMYixHZ+sFT9huWuZH6Ib18GESO9xzxWIGs8ZdNv/EKvLBuZ0/FZTyY9s X-Received: by 2002:a0c:d783:: with SMTP id z3mr18707405qvi.190.1552492310308; Wed, 13 Mar 2019 08:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552492310; cv=none; d=google.com; s=arc-20160816; b=ZHzBDw+gU9yG1yLdwOsRodiFe/hnS/Obt/shCVJn4eegUHsKbC0mEAHndB23ao2s/l 9H4v7Qhc4Zmtd85rDZX8plbQajO6uUjm85HrhaxxhdQnbf3zA2yJxfvzTbzN4tSZkTcp WEoLcasummSAUtSzsT+4lAu2hgWnBkmIQVn5HGXsF8w4w5j3WO4hvI7HsaDxEWwPX6nX T1kNwCaIwlplTfNuLZPIG2qZGjr7o9BG1yMeRfuBQqeAmVkwhg+EJ4zL4FOFqg5mg/Ew d9zfe5EWlLR7b9c76kp+3d3nqFD8rI/tYQR8m3RHYxZ9JzZ4nAmS0Ox+kiHBbZrZxHFo faKA== 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=BKMN2KMPxVdaiJZhsZeQPLLmXVQwav4qyBkD6VxWBTQ=; b=lfnMCu9mTl38WafOrleAyIBSDsy/2V3W2B8Tu2TVYWp1jSJ6ATs73TtF5vZbgiIhIZ vTHmxvm01ZXDXLep1kZL0TcD4ZzXO6sE9IKho17mZ9YnsYTQY+md5n00oPvhHLEWjlOv N9ogvZFeDrvbiukoA7HFf11+eXjKQVkLo1bSuLJOZSulEeQ7LsMXc8IU2by/ZqxgqAxI hzjME1mwcCRO/MZNhoJww/0ti9uQtXCZQIHF0+FQ0d+GXPH1jfNkSoMXF99Cy4PKCeGB MXLaOfDqe3o275HENt/npbKDCGP9sO/FigCYgsAOaxXNprvmJaMaPncAotYDb60rdHyi NJCA== 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 l37si802072qte.317.2019.03.13.08.51.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 08:51:50 -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 35D4D30922E8; Wed, 13 Mar 2019 15:51:48 +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 112E25F9D7; Wed, 13 Mar 2019 15:51:48 +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 CBECB4EE06; Wed, 13 Mar 2019 15:51:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2DFpcnT001473 for ; Wed, 13 Mar 2019 11:51:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3C3AE6A96F; Wed, 13 Mar 2019 15:51:38 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-40.rdu2.redhat.com [10.10.124.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF6FD6B8CD; Wed, 13 Mar 2019 15:51:37 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 13 Mar 2019 11:51:20 -0400 Message-Id: <003cb0ea27bfacc658f66dc25daebb32a06c6205.1552492022.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 11/11] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 13 Mar 2019 15:51:49 +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 f58a6d77b9..f06070d740 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5265,6 +5265,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 505982ec0e..14b831ffac 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2769,6 +2769,7 @@ typedef enum { VIR_DOMAIN_DEF_FEATURE_USER_ALIAS = (1 << 5), VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER = (1 << 6), VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT = (1 << 7), + VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING = (1 << 8), } virDomainDefFeatures; diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index ffafa7967d..dc974dc926 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 6718dfbc22..1214e32be4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6967,7 +6967,8 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = { VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN | VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS | VIR_DOMAIN_DEF_FEATURE_USER_ALIAS | - VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT, + VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT | + VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, }; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 989dcf1784..c250c61cb6 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -645,7 +645,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