提交 8c496a1d 编写于 作者: C Cole Robinson

conf: Replace SKIP_OSTYPE_CHECKS with SKIP_VALIDATE

SKIP_OSTYPE_CHECKS only hides some error reporting at this point,
so it can be foled into SKIP_VALIDATE
Acked-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 031363cb
...@@ -19182,7 +19182,7 @@ virDomainDefParseCaps(virDomainDefPtr def, ...@@ -19182,7 +19182,7 @@ virDomainDefParseCaps(virDomainDefPtr def,
def->os.arch, def->os.arch,
def->virtType, def->virtType,
NULL, NULL))) { NULL, NULL))) {
if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))
goto cleanup; goto cleanup;
virResetLastError(); virResetLastError();
} else { } else {
...@@ -28782,8 +28782,7 @@ virDomainDefCopy(virDomainDefPtr src, ...@@ -28782,8 +28782,7 @@ virDomainDefCopy(virDomainDefPtr src,
virDomainDefPtr ret; virDomainDefPtr ret;
unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE; unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS;
if (migratable) if (migratable)
format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE; format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE;
......
...@@ -2981,24 +2981,21 @@ typedef enum { ...@@ -2981,24 +2981,21 @@ typedef enum {
VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 6, VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 6,
/* perform RNG schema validation on the passed XML document */ /* perform RNG schema validation on the passed XML document */
VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA = 1 << 7, 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 */ /* 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 */ /* 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 */ /* 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 /* Allows updates in post parse callback for incoming persistent migration
* that would break ABI otherwise. This should be used only if it's safe * that would break ABI otherwise. This should be used only if it's safe
* to do such change. */ * 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 /* 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 * 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 * post parse callbacks before starting. Failure of the post parse callback
* is recorded as def->postParseFail */ * 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; } virDomainDefParseFlags;
typedef enum { typedef enum {
......
...@@ -273,8 +273,6 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, ...@@ -273,8 +273,6 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
if ((tmp = virXPathString("string(./domain/@type)", ctxt))) { if ((tmp = virXPathString("string(./domain/@type)", ctxt))) {
int domainflags = VIR_DOMAIN_DEF_PARSE_INACTIVE | int domainflags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; 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); xmlNodePtr domainNode = virXPathNode("./domain", ctxt);
VIR_FREE(tmp); VIR_FREE(tmp);
......
...@@ -492,7 +492,6 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms, ...@@ -492,7 +492,6 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms,
goto error; goto error;
if (!(def = virDomainDefParseFile(configFile, caps, xmlopt, NULL, if (!(def = virDomainDefParseFile(configFile, caps, xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL)))
goto error; goto error;
...@@ -544,7 +543,6 @@ virDomainObjListLoadStatus(virDomainObjListPtr doms, ...@@ -544,7 +543,6 @@ virDomainObjListLoadStatus(virDomainObjListPtr doms,
VIR_DOMAIN_DEF_PARSE_STATUS | VIR_DOMAIN_DEF_PARSE_STATUS |
VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | VIR_DOMAIN_DEF_PARSE_ACTUAL_NET |
VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES |
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL)))
goto error; goto error;
......
...@@ -2777,7 +2777,7 @@ mymain(void) ...@@ -2777,7 +2777,7 @@ mymain(void)
* will avoid the error. Still, we expect qemu driver to complain about * will avoid the error. Still, we expect qemu driver to complain about
* missing machine error, and not crash */ * missing machine error, and not crash */
DO_TEST_PARSE_FLAGS_ERROR("missing-machine", DO_TEST_PARSE_FLAGS_ERROR("missing-machine",
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE,
NONE); NONE);
DO_TEST("name-escape", DO_TEST("name-escape",
......
...@@ -76,7 +76,6 @@ testCompareStatusXMLToXMLFiles(const void *opaque) ...@@ -76,7 +76,6 @@ testCompareStatusXMLToXMLFiles(const void *opaque)
VIR_DOMAIN_DEF_PARSE_STATUS | VIR_DOMAIN_DEF_PARSE_STATUS |
VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | VIR_DOMAIN_DEF_PARSE_ACTUAL_NET |
VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES |
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL)))
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册