From patchwork Wed Apr 17 14:57:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 162402 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp5595939jan; Wed, 17 Apr 2019 07:58:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyfVjpcLuF8e3a1wS2IjCwHJTGv34HnsKQ7S3vxiTbqLp4ke/jMB6nuz3i4lyd1cXFTya9 X-Received: by 2002:ac8:268d:: with SMTP id 13mr72972433qto.53.1555513102041; Wed, 17 Apr 2019 07:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555513102; cv=none; d=google.com; s=arc-20160816; b=qlTWlSJoI4O7eAIvUjgQgXUfPv53zU1y1rVPUOOdVe/CJDtDMju/IY3QvmgsA9DXZW PrkFxLkTRNNmx5eoqU/5Pkvt8JCUu+SC6bZZgEvBetnJGXAm3/JuCUzP2xBF8kWscY3g re1YZGXytixiyP3CsAJ5+oaim+BqqqfIcwbFCFNSPfowtiVPgR+MNO3KsEmUfJ5XdILQ VL61YRL2NdhjRItayDWklMqITOVFE5RSumunGSEstHNXLTj1eFMXTRQk7nXEXa4tC+fN Mb0Zdh56brtXy1h7EFxTy6VPt0ohX/KcqZFK8foZ1iSmd0YgpB5KO1qrdIOXU/tSs3rA bdSQ== 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=Vy7yhhMyrdq+cVJmzyfNl1/ZoH5kP5H7m7Kw12FE7vI=; b=Hrs7yuoo3k70+55LRFGNYrlU0k9vkRRKdKiK4anc9IVGIvkzgHCmBGXS5sOeKvMvhZ ziyxqxWwOrXfx2ubMNuIaFegdaTybVPsSn3Fgvi6CkHuGaFbQxZJfJpBfduUQwlhGsXj Cr6qWbdIqOKBIow4kUiaoL7DAy2n+garyyotpq/EVeKp5wzpPIycy3gzr8i3ELPqLZvs 2UlFh3dYj4BEfMswHjEgNdyFS3BG4YkW9eFJDsclIIKcq9j17SKSX37CBQ8nCv0dsaOJ 4/XpeA8GKW816KOR/satUxOFNyKNvEjdE7Qe6Rf7aRRF584TQDdgDQ+3/fCtROcIaffo o1oA== 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 w30si7077013qtj.58.2019.04.17.07.58.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 07:58:22 -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-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC4E05946E; Wed, 17 Apr 2019 14:58:20 +0000 (UTC) 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 7F2F319C77; Wed, 17 Apr 2019 14:58:20 +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 E453F181AC45; Wed, 17 Apr 2019 14:58:19 +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 x3HEw91W002284 for ; Wed, 17 Apr 2019 10:58:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id EF12D608C8; Wed, 17 Apr 2019 14:58:09 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-15.rdu2.redhat.com [10.10.124.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27F51608C2; Wed, 17 Apr 2019 14:58:09 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 17 Apr 2019 10:57:56 -0400 Message-Id: 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 2/2] conf: Fix VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT validation 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 17 Apr 2019 14:58:21 +0000 (UTC) The check shouldn't be dependent on whether os->loader is set. Fix it, and add the XML feature to vmx.c which would start failing Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 6 ++---- src/vmx/vmx.c | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) -- 2.21.0 -- 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 51aa48f421..7c4a1ff7fa 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6815,9 +6815,6 @@ static int virDomainDefOSValidate(const virDomainDef *def, virDomainXMLOptionPtr xmlopt) { - if (!def->os.loader) - return 0; - if (def->os.firmware && !(xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT)) { virReportError(VIR_ERR_XML_DETAIL, "%s", @@ -6825,7 +6822,8 @@ virDomainDefOSValidate(const virDomainDef *def, return -1; } - if (!def->os.loader->path && + if (def->os.loader && + !def->os.loader->path && def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE) { virReportError(VIR_ERR_XML_DETAIL, "%s", _("no loader path specified and firmware auto selection disabled")); diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 35b83a2320..82418ceca2 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -555,7 +555,8 @@ static virDomainDefParserConfig virVMXDomainDefParserConfig = { .domainPostParseCallback = virVMXDomainDefPostParse, .features = (VIR_DOMAIN_DEF_FEATURE_WIDE_SCSI | VIR_DOMAIN_DEF_FEATURE_NAME_SLASH | - VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER), + VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER | + VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT), }; struct virVMXDomainDefNamespaceData {