From patchwork Tue Jul 24 21:23:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142824 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55717ljj; Tue, 24 Jul 2018 14:23:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdxeOCoqkhy9dQoeXxRq3qbOV4B7aUbZE8yU9quNyA/4vxgJnq3WcHV0vzc4H7ux15V4L0w X-Received: by 2002:a37:1194:: with SMTP id 20-v6mr17795008qkr.379.1532467436810; Tue, 24 Jul 2018 14:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467436; cv=none; d=google.com; s=arc-20160816; b=r3KuZe6YzW55wLpankzPYSnexEYYqv6oY/2gn8xffKPCRqSvb6SjBz3Opg+rqaYxVY rMJvPRGnOnnHsGxsp5HLUL5H9Bz+B5b7PDmFLFCWJq+M/zQPuou3kVGpxIfjNwy+5Jwd GRY4H2YjJ6kmLnbrBRksAIN83GsMUo6rg5Tmze167nnqn7q+h/sV+kgPRM+k6YGpKEMO yPakc/HmDU2WYL8lg4+w9rEGF/jfqK0vSKqtLaSemEqPw0WHSnN9sdh5VrKFd6LIw45/ MDfh8LE2ryytvmW5Z69AeqbhC+V8ffEFkekhbCrNI4AuK+iJ6c28Gg79csasrV8et46m IB+Q== 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 :arc-authentication-results; bh=I1eL8XCTXwc/xOPyGgYWCLXwzY3APZtyUEGMAHkM+os=; b=ZhIgYiyDbPiUIq7HfAPsSyZjSlCsoyOC+PfnEJa3j8uJYoVPgXXejdWiH5j0nAtgpl j43b21iY0rcbqJwZXR28qVtbRIiD4CPNQ4tCVkVEyGBCRfj2UXf4MKSCCII/XBJdcc/M nkrrSehe/f8ttyJ0LPlMcJ3N+Z7idzpf88UQCiVrnuxQkfs+LHy/EJgWiYhTMnldpJ2w Agl7YcaPHoMV/ialcrYDmHc8T0qPT7kEcFq/cAqJ1xy10KfTgDt7TvVDvZSehVDY6MWd zouGYtNuXU72fjZCfSUofLfOqQH6kZfc8F4d+oli8rBAYF1ZeMij3GmHAfQ+xfR7fq6v JXwA== 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 k1-v6si3793233qkc.104.2018.07.24.14.23.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:23:56 -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-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5157308FB9A; Tue, 24 Jul 2018 21:23:54 +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 6F1412016208; Tue, 24 Jul 2018 21:23:54 +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 F2A751800B69; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6OLNpEA018727 for ; Tue, 24 Jul 2018 17:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 55008202704B; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B8112026D68; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:48 -0400 Message-Id: <41c968ac8374fcc8bc515e766062c5b7ca213448.1532467269.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/7] conf: Replace SKIP_OSTYPE_CHECKS with SKIP_VALIDATE 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 24 Jul 2018 21:23:55 +0000 (UTC) SKIP_OSTYPE_CHECKS only hides some error reporting at this point, so it can be foled into SKIP_VALIDATE Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 3 +-- src/conf/domain_conf.h | 13 +++++-------- src/conf/snapshot_conf.c | 2 -- src/conf/virdomainobjlist.c | 2 -- tests/qemuxml2argvtest.c | 2 +- tests/qemuxml2xmltest.c | 1 - 6 files changed, 7 insertions(+), 16 deletions(-) -- 2.17.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 78ee000857..41baac08c0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28780,8 +28780,7 @@ virDomainDefCopy(virDomainDefPtr src, virDomainDefPtr ret; unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS; + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; if (migratable) format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5e2f21dea3..a804e86f6c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2981,24 +2981,21 @@ typedef enum { VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 6, /* perform RNG schema validation on the passed XML document */ VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA = 1 << 7, - /* don't validate os.type and arch against capabilities. Prevents - * VMs from disappearing when qemu is removed and libvirtd is restarted */ - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 8, /* allow updates in post parse callback that would break ABI otherwise */ - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 8, /* skip definition validation checks meant to be executed on define time only */ - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 10, + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 9, /* skip parsing of security labels */ - VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL = 1 << 11, + VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL = 1 << 10, /* Allows updates in post parse callback for incoming persistent migration * that would break ABI otherwise. This should be used only if it's safe * to do such change. */ - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 12, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 11, /* Allows to ignore certain failures in the post parse callbacks, which * may happen due to missing packages and can be fixed by re-running the * post parse callbacks before starting. Failure of the post parse callback * is recorded as def->postParseFail */ - VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL = 1 << 13, + VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL = 1 << 12, } virDomainDefParseFlags; typedef enum { diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 9c537ac7d1..adba149241 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -273,8 +273,6 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, if ((tmp = virXPathString("string(./domain/@type)", ctxt))) { int domainflags = VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; - if (flags & VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL) - domainflags |= VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS; xmlNodePtr domainNode = virXPathNode("./domain", ctxt); VIR_FREE(tmp); diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c index 72064d7c66..52171594f3 100644 --- a/src/conf/virdomainobjlist.c +++ b/src/conf/virdomainobjlist.c @@ -492,7 +492,6 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms, goto error; if (!(def = virDomainDefParseFile(configFile, caps, xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) goto error; @@ -544,7 +543,6 @@ virDomainObjListLoadStatus(virDomainObjListPtr doms, VIR_DOMAIN_DEF_PARSE_STATUS | VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) goto error; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 03b6d92912..84117a3e63 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2777,7 +2777,7 @@ mymain(void) * will avoid the error. Still, we expect qemu driver to complain about * missing machine error, and not crash */ DO_TEST_PARSE_FLAGS_ERROR("missing-machine", - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS, + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE, NONE); DO_TEST("name-escape", diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 795ddc7003..c6cb2dda0c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -76,7 +76,6 @@ testCompareStatusXMLToXMLFiles(const void *opaque) VIR_DOMAIN_DEF_PARSE_STATUS | VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) goto cleanup;