提交 7129b9f3 编写于 作者: P Peter Krempa

conf: snapshot: Remove file format check from parser

We already have a way stricter check in the code which is doing the
snapshot so duplicating it in the parser does not make much sense. Also
gets rid of an ugly ternary operator.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 58da6e3c
......@@ -159,17 +159,11 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node,
virDomainDiskSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0)
goto cleanup;
if ((driver = virXPathString("string(./driver/@type)", ctxt))) {
def->src->format = virStorageFileFormatTypeFromString(driver);
if (def->src->format < VIR_STORAGE_FILE_BACKING) {
if ((driver = virXPathString("string(./driver/@type)", ctxt)) &&
(def->src->format = virStorageFileFormatTypeFromString(driver)) <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
def->src->format <= 0
? _("unknown disk snapshot driver '%s'")
: _("disk format '%s' lacks backing file "
"support"),
driver);
_("unknown disk snapshot driver '%s'"), driver);
goto cleanup;
}
}
/* validate that the passed path is absolute */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册