]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix virFileMakePath error handling in snapshot creation
authorMatthias Bolte <matthias.bolte@googlemail.com>
Mon, 4 Jul 2011 08:49:54 +0000 (10:49 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 5 Jul 2011 08:49:36 +0000 (10:49 +0200)
virFileMakePath returns an errno value on error, that will never
be negative. An virFileMakePath error would have been ignored here,
instead of being reported correctly.

src/qemu/qemu_driver.c

index 363a361b21eb562071d361ccee56e83f75e1d5aa..aab3ab96daea02b34bba066368e724cc53cd05d6 100644 (file)
@@ -7498,7 +7498,7 @@ static int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm,
         goto cleanup;
     }
     err = virFileMakePath(snapDir);
-    if (err < 0) {
+    if (err != 0) {
         virReportSystemError(err, _("cannot create snapshot directory '%s'"),
                              snapDir);
         goto cleanup;