mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
58da6e3c26
commit
7129b9f354
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user